Skip to content

Commit

Permalink
Update DDEV config to add fqdns for localgov_microsites_group phpunit… (
Browse files Browse the repository at this point in the history
#53)

* Update DDEV config to add fqdns for localgov_microsites_group phpunit tests.
* Remove rogue comma.
* Add ddev phpunit guidance to REAME.md.
* Correct last fqdns typo.
---------

Co-authored-by: ekes <ekes@iskra.net>
  • Loading branch information
finnlewis and ekes authored May 21, 2024
1 parent 9ba4ebe commit 87d1b5c
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 11 deletions.
23 changes: 14 additions & 9 deletions .ddev/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
52 changes: 50 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 87d1b5c

Please sign in to comment.