document running integration tests localy #236

Merged
decentral1se merged 1 commits from p4u1/docs.coopcloud.tech:local-integration-tests into main 2023-11-27 09:46:54 +00:00
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
Review

@p4u1

I wonder should we possible develop a tag or something for tests that can only succeed when run on a remote server? I assume there are some, i.e. requiring public DNS? This could be a # bats test_tags=remote?

Just a thought.

@p4u1 I wonder should we possible develop a tag or something for tests that can only succeed when run on a remote server? I assume there are some, i.e. requiring public DNS? This could be a `# bats test_tags=remote`? Just a thought.
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
```