Document testing process

This commit is contained in:
Christopher C. Wells 2021-04-09 15:17:03 -07:00
parent 0836e3ecf3
commit b0e1403ffa
1 changed files with 34 additions and 0 deletions

View File

@ -18,6 +18,7 @@ to use recipe presentation for preparing meals.
- [Configuration](#configuration)
- [Search](#search-mag)
- [Development](#development)
- [Testing](#testing)
## Demo
@ -127,6 +128,8 @@ Set `SCOUT_DRIVER=null` in kcal's `.env` file to use the fallback driver.
- [Docker](https://docs.docker.com/get-docker/)
- [Docker compose](https://docs.docker.com/compose/install/)
#### Steps
1. Clone the repository.
git clone https://github.com/kcal-app/kcal.git
@ -169,3 +172,34 @@ Set `SCOUT_DRIVER=null` in kcal's `.env` file to use the fallback driver.
Once the application finishes starting, navigate to [http://127.0.0.1:8080](http://127.0.0.1:8080)
(or [http://kcal.test:8080](http://kcal.test:8080) if configured).
### Testing
Ensure that Sail is running (primarily to provide ElasticSearch):
vendor/bin/sail up -d
Execute tests.
vendor/bin/sail artisan test --parallel
#### Caveats
In order to support parallel testing, tests are run using sqlite (even though Sail
provides MySQL). To test with MySQL make a copy of `phpunit.xml.dist` as `phpunit.dist`
and change:
```
<server name="DB_CONNECTION" value="sqlite"/>
<server name="DB_DATABASE" value=":memory:"/>
```
to
```
<server name="DB_CONNECTION" value="mysql"/>
<server name="DB_HOST" value="db"/>
```
Now running `vendor/bin/sail artisan test` will run tests with MySQL **but** tests
cannot be run in parallel.