test: long flags, drop docker, use run_tests for all tests
continuous-integration/drone/push Build is passing Details

This commit is contained in:
decentral1se 2022-01-24 16:49:51 +01:00
parent 57728e58e8
commit 415df981ff
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
9 changed files with 35 additions and 50 deletions

View File

@ -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";

View File

@ -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.

View File

@ -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'

View File

@ -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'

View File

@ -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

View File

@ -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 \
'

View File

@ -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'

View File

@ -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'

View File

@ -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'