diff --git a/tests/integration/Dockerfile b/tests/integration/Dockerfile deleted file mode 100644 index 87375592..00000000 --- a/tests/integration/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM debian:bullseye-slim - -RUN apt update && apt install -y wget curl git; - -RUN git config --global user.email "integration-tests@coopcloud.tech"; - -RUN git config --global user.name "integration-tests"; diff --git a/tests/integration/README.md b/tests/integration/README.md index feefe70b..4e38b637 100644 --- a/tests/integration/README.md +++ b/tests/integration/README.md @@ -1,11 +1,20 @@ # integration tests -- `cp .envrc.sample .envrc` (fill out values && `direnv allow`) -- `TARGET=install.sh make` (ensure `docker context use default`) +> You need to be a member of Autonomic Co-op to run these tests, sorry! -`testfunctions.sh` contains the functions necessary to save and manipulate logs -run `test_all.sh logdir` to run tests specified in that file and save the logs to `logdir` -when creating new tests, make sure the test command is a one-liner (you can use `;` to separate commands). include `testfunctions.sh` and then write your tests like this: -`run_test '$ABRA other stuff here'` +`testfunctions.sh` contains the functions necessary to save and manipulate +logs. Run `test_all.sh logdir` to run tests specified in that file and save the +logs to `logdir`. -by default, the testing script will ask after every command if the execution succeeded. If you reply `n`, it will log the test in the `logdir`. If you want all tests to run without questions, run `export logall=yes` before executing the test script +When creating new tests, make sure the test command is a one-liner (you can use +`;` to separate commands). Include `testfunctions.sh` and then write your tests +like this: + +``` +run_test '$ABRA other stuff here' +``` + +By default, the testing script will ask after every command if the execution +succeeded. If you reply `n`, it will log the test in the `logdir`. If you want +all tests to run without questions, run `export logall=yes` before executing +the test script. diff --git a/tests/integration/app.sh b/tests/integration/app.sh index 5921dfd3..93f43c98 100755 --- a/tests/integration/app.sh +++ b/tests/integration/app.sh @@ -3,14 +3,12 @@ source ./testfunctions.sh source ./common.sh -echo "all apps, all servers" run_test '$ABRA app ls' -printf "\\n\\n\\n" -echo "all wordpress apps, all servers" +run_test '$ABRA app ls --status' + run_test '$ABRA app ls --type wordpress' -printf "\\n\\n\\n" -echo "all wordpress apps, only server2" -run_test '$ABRA app ls --type wordpress --server server2' -printf "\\n\\n\\n" +run_test '$ABRA app ls --type wordpress --server swarm.autonomic.zone' + +run_test '$ABRA app ls --type wordpress --server swarm.autonomic.zone --status' diff --git a/tests/integration/catalogue.sh b/tests/integration/catalogue.sh index 9513f604..de0b2e1e 100755 --- a/tests/integration/catalogue.sh +++ b/tests/integration/catalogue.sh @@ -3,6 +3,6 @@ source ./testfunctions.sh source ./common.sh -run_test '$ABRA --debug catalogue generate' +run_test '$ABRA catalogue generate --debug' -run_test '$ABRA --debug catalogue generate gitea' +run_test '$ABRA catalogue generate gitea --debug' diff --git a/tests/integration/common.sh b/tests/integration/common.sh index c1d4e345..aae653e0 100755 --- a/tests/integration/common.sh +++ b/tests/integration/common.sh @@ -3,15 +3,8 @@ set -e function init() { - ABRA="$HOME/.local/bin/abra" - INSTALLER_URL="https://install.abra.coopcloud.tech" - - for arg in "$@"; do - if [ "$arg" == "--dev" ]; then - ABRA="/src/abra" - INSTALLER_URL="https://git.coopcloud.tech/coop-cloud/abra/raw/branch/main/scripts/installer/installer" - fi - done + ABRA="$(PWD)/../../abra" + INSTALLER_URL="https://git.coopcloud.tech/coop-cloud/abra/raw/branch/main/scripts/installer/installer" export PATH=$PATH:$HOME/.local/bin diff --git a/tests/integration/makefile b/tests/integration/makefile deleted file mode 100644 index 58dc4e1b..00000000 --- a/tests/integration/makefile +++ /dev/null @@ -1,11 +0,0 @@ -default: - @docker run \ - -v $$(pwd)/../../:/src \ - -v $$(pwd)/.abra:/root/.abra \ - --env-file .envrc \ - decentral1se/abra-int:latest \ - sh -c '\ - echo "Running $(TARGET)..."; \ - cd /src/tests/integration; \ - bash "$(TARGET)" -- --dev \ - ' diff --git a/tests/integration/recipe.sh b/tests/integration/recipe.sh index 7ef627a0..7ac3b129 100755 --- a/tests/integration/recipe.sh +++ b/tests/integration/recipe.sh @@ -6,7 +6,8 @@ source ./common.sh run_test '$ABRA recipe new testrecipe' run_test '$ABRA recipe list' -run_test '$ABRA recipe list -p cloud' + +run_test '$ABRA recipe list --pattern cloud' run_test '$ABRA recipe versions peertube' diff --git a/tests/integration/records.sh b/tests/integration/records.sh index c8f157fb..54ba2d5f 100755 --- a/tests/integration/records.sh +++ b/tests/integration/records.sh @@ -1,9 +1,10 @@ #!/bin/bash +source ./testfunctions.sh source ./common.sh -$ABRA record new -p gandi -t A -n int-core -v 192.157.2.21 coopcloud.tech +run_test '$ABRA record new --provider gandi --type A --name integration-tests --value 192.157.2.21 coopcloud.tech' -$ABRA record list -p gandi coopcloud.tech | grep -q int-core +run_test '$ABRA record list --provider gandi coopcloud.tech' -$ABRA -n record rm -p gandi -t A -n int-core coopcloud.tech +run_test '$ABRA -n record rm --provider gandi --type A --name integration-tests coopcloud.tech' diff --git a/tests/integration/server.sh b/tests/integration/server.sh index ae8dfcaa..a0630ce6 100755 --- a/tests/integration/server.sh +++ b/tests/integration/server.sh @@ -1,9 +1,10 @@ #!/bin/bash +source ./testfunctions.sh source ./common.sh -$ABRA -n server new -p hetzner-cloud --hn int-core +run_test '$ABRA -n server new --provider hetzner-cloud --hetzner-name integration-tests' -$ABRA server ls | grep -q int-core +run_test '$ABRA server ls' -$ABRA -n server rm -s -p hetzner-cloud --hn int-core +run_test '$ABRA server rm --provider hetzner-cloud --hetzner-name int-core --server --no-input'