From 485339ee7f535d8d25d563a676432394a4cf4721 Mon Sep 17 00:00:00 2001 From: p4u1 Date: Tue, 21 Nov 2023 15:00:43 +0100 Subject: [PATCH] document running integration tests localy --- docs/abra/hack.md | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/docs/abra/hack.md b/docs/abra/hack.md index 6d8ca80..3c32eba 100644 --- a/docs/abra/hack.md +++ b/docs/abra/hack.md @@ -62,14 +62,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` @@ -81,6 +83,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 ```