document running integration tests localy

This commit is contained in:
p4u1 2023-11-21 15:00:43 +01:00
parent 2568322fbd
commit 73dc1400a1
1 changed files with 31 additions and 3 deletions

View File

@ -61,14 +61,16 @@ cd bats-core
sudo ./install.sh /usr/local
```
### Run tests
### Setup Test Server
Then you can run the integration test suite with the following.
For many tests an actual server is needed, where apps can be deployed. You can
either use a local one or a remote test server.
#### With remote test server
```
export ABRA_TEST_DOMAIN="test.example.com"
export ABRA_DIR="$HOME/.abra_test"
bats -Tp tests/integration # DO NOT run this just yet, read below...
```
`ABRA_TEST_DOMAIN` should also have a DNS A record for `*.test.example.com`
@ -80,6 +82,32 @@ Traefik for you. Then you'll have more stable results.
You probably don't want to run the entire test suite though, it takes a while.
Try the following for starters.
#### With local swarm
When running the test suite localy you need a running docker swarm setup:
```
docker swarm init
docker network create -d overlay proxy
```
To use the local swarm set the foloowing env var:
```
export TEST_SERVER=default
export ABRA_DIR="$HOME/.abra_test"
```
### Run tests
Now you can run the whole test suite:
```
bats -Tp tests/integration
```
Or you can run a single test file:
```
bats -Tp tests/integration/autocomplete.bats
```