diff --git a/.ddev/config.yaml b/.ddev/config.yaml index ccc2e11..9044479 100644 --- a/.ddev/config.yaml +++ b/.ddev/config.yaml @@ -6,15 +6,20 @@ webserver_type: nginx-fpm router_http_port: "80" router_https_port: "443" xdebug_enabled: false -additional_hostnames: [ - localgov-micro, - localgov-micro-1, - localgov-micro-2, - localgov-micro-3, - localgov-micro-4, - localgov-micro-5 -] -additional_fqdns: [] +additional_hostnames: + - localgov-micro + - localgov-micro-1 + - localgov-micro-2 + - localgov-micro-3 + - localgov-micro-4 + - localgov-micro-5 +additional_fqdns: + - group-0.web + - group-1.web + - group-2.web + - group-3.web + - group-4.web + - group-5.web database: type: mariadb version: "10.3" diff --git a/README.md b/README.md index 3497d30..b39dac1 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ First you need to [install Composer](https://getcomposer.org/doc/00-intro.md#ins After that you can create the project: ```shell -composer create-project --stability alpha localgovdrupal/localgov_microsites_project MY_PROJECT --no-install +composer create-project --stability beta localgovdrupal/localgov_microsites_project:^4.0@beta MY_PROJECT --no-install ``` ## Using Lando @@ -72,10 +72,58 @@ lando ssh phpunit --filter=myTestName ``` + +## Running PHPUnit tests in DDEV + +The included phpunit.xml.dist file contains configuration for automatically +running the LocalGov Drupal test suite. + +The default .ddev/config.yml includes configuration for some extra domains that +ddev and phpunit will need to resolve different microsite domains. + +When ddev starts, it will attempt to write these to /etc/hosts + +If DDEV cannot write to /etc/hosts, you may need to add these manually. + +If you are having problems runnign phpunit tests in DDEV, try adding the +following to `/etc/hosts` + +``` +127.0.0.1 group-1.web group-2.web group-3.web group-4.web group-5.web +``` + +To allow html output, manually create a directory for browser output. + +```bash +mkdir web/sites/simpletest/browser_output +``` + +To run all LocalGov Drupal tests from inside DDEV: + +```bash +ddev ssh +phpunit +``` + +To run all the tests for a specific module: + +```bash +ddev ssh +phpunit web/modules/contrib/localgov_my_module +``` + +Tests can be filtered using the `--filter` option. To only run a specific test: + +```bash +ddev ssh +phpunit --filter=myTestName +``` + + ## Maintainers -This project is currently maintained by: +This project is currently maintained by: - Ekes: https://www.drupal.org/u/ekes - Finn Lewis: https://www.drupal.org/u/finn-lewis - - Stephen Cox: https://www.drupal.org/u/stephen-cox + - Stephen Cox: https://www.drupal.org/u/stephen-cox diff --git a/composer.json b/composer.json index 76e1e74..dd2f921 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "drupal/core-composer-scaffold": "^10.0@stable", "drupal/core-recommended": "^10.0@stable", "drush/drush": "^12.0", - "localgovdrupal/localgov_microsites": "^4.0@alpha" + "localgovdrupal/localgov_microsites": "^4.0@beta" }, "require-dev": { "brianium/paratest": "^6.3",