forked from coop-cloud/abra
test: long flags, drop docker, use run_tests for all tests
This commit is contained in:
parent
57728e58e8
commit
415df981ff
|
@ -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";
|
|
|
@ -1,11 +1,20 @@
|
||||||
# integration tests
|
# integration tests
|
||||||
|
|
||||||
- `cp .envrc.sample .envrc` (fill out values && `direnv allow`)
|
> You need to be a member of Autonomic Co-op to run these tests, sorry!
|
||||||
- `TARGET=install.sh make` (ensure `docker context use default`)
|
|
||||||
|
|
||||||
`testfunctions.sh` contains the functions necessary to save and manipulate logs
|
`testfunctions.sh` contains the functions necessary to save and manipulate
|
||||||
run `test_all.sh logdir` to run tests specified in that file and save the logs to `logdir`
|
logs. Run `test_all.sh logdir` to run tests specified in that file and save the
|
||||||
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:
|
logs to `logdir`.
|
||||||
`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
|
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.
|
||||||
|
|
|
@ -3,14 +3,12 @@
|
||||||
source ./testfunctions.sh
|
source ./testfunctions.sh
|
||||||
source ./common.sh
|
source ./common.sh
|
||||||
|
|
||||||
echo "all apps, all servers"
|
|
||||||
run_test '$ABRA app ls'
|
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'
|
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 swarm.autonomic.zone'
|
||||||
run_test '$ABRA app ls --type wordpress --server server2'
|
|
||||||
printf "\\n\\n\\n"
|
run_test '$ABRA app ls --type wordpress --server swarm.autonomic.zone --status'
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
source ./testfunctions.sh
|
source ./testfunctions.sh
|
||||||
source ./common.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'
|
||||||
|
|
|
@ -3,15 +3,8 @@
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
ABRA="$HOME/.local/bin/abra"
|
ABRA="$(PWD)/../../abra"
|
||||||
INSTALLER_URL="https://install.abra.coopcloud.tech"
|
INSTALLER_URL="https://git.coopcloud.tech/coop-cloud/abra/raw/branch/main/scripts/installer/installer"
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
export PATH=$PATH:$HOME/.local/bin
|
export PATH=$PATH:$HOME/.local/bin
|
||||||
|
|
||||||
|
|
|
@ -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 \
|
|
||||||
'
|
|
|
@ -6,7 +6,8 @@ source ./common.sh
|
||||||
run_test '$ABRA recipe new testrecipe'
|
run_test '$ABRA recipe new testrecipe'
|
||||||
|
|
||||||
run_test '$ABRA recipe list'
|
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'
|
run_test '$ABRA recipe versions peertube'
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
source ./testfunctions.sh
|
||||||
source ./common.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'
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
source ./testfunctions.sh
|
||||||
source ./common.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'
|
||||||
|
|
Loading…
Reference in New Issue