test: start on integration script
continuous-integration/drone/push Build is passing Details

This commit is contained in:
decentral1se 2022-01-01 21:36:00 +01:00
parent 94522178b1
commit 49f565e5db
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
4 changed files with 97 additions and 5 deletions

1
.e2e.env.sample Normal file
View File

@ -0,0 +1 @@
GANDI_TOKEN=...

11
.gitignore vendored
View File

@ -1,6 +1,7 @@
abra
.vscode/
vendor/
.envrc
dist/
*fmtcoverage.html
.e2e.env
.envrc
.vscode/
abra
dist/
vendor/

View File

@ -43,3 +43,13 @@ loc-author:
sort -f | \
uniq -ic | \
sort -n
e2e:
@docker run \
-v $$(pwd):/src \
--env-file .e2e.env \
debian:bullseye-slim \
sh -c "\
apt update && apt install -y wget curl; echo ""; echo ""; \
cd /src/tests && bash e2e.sh -- --dev \
"

80
tests/e2e.sh Executable file
View File

@ -0,0 +1,80 @@
#!/bin/bash
set -e
ABRA="$HOME/.local/bin/abra -d"
INSTALLER_URL="https://install.abra.coopcloud.tech"
for arg in "$@"; do
if [ "$arg" == "--dev" ]; then
ABRA="/src/abra -d"
INSTALLER_URL="https://git.coopcloud.tech/coop-cloud/abra/raw/branch/main/scripts/installer/installer"
fi
done
export PATH=$PATH:$HOME/.local/bin
echo "========================================================================"
echo "choosing abra executable for test run"
echo "========================================================================"
echo "choosing $ABRA as abra executable"
echo "choosing $INSTALLER_URL as abra installer url"
echo ""
echo ""
echo "========================================================================"
echo "latest stable release"
echo "========================================================================"
wget -O- https://install.abra.autonomic.zone | bash
~/.local/bin/abra -v
echo ""
echo ""
echo "========================================================================"
echo "latest rc release"
echo "========================================================================"
wget -O- https://install.abra.autonomic.zone | bash -s -- --rc
~/.local/bin/abra -v
echo ""
echo ""
echo "========================================================================"
echo "upgrade to stable in-place"
echo "========================================================================"
$ABRA upgrade
~/.local/bin/abra -v
echo ""
echo ""
echo "========================================================================"
echo "upgrade to rc in-place"
echo "========================================================================"
$ABRA upgrade --rc
~/.local/bin/abra -v
echo ""
echo ""
echo "========================================================================"
echo "autocomplete"
echo "========================================================================"
$ABRA autocomplete bash
$ABRA autocomplete fizsh
$ABRA autocomplete zsh
echo ""
echo ""
echo "========================================================================"
echo "record command"
echo "========================================================================"
$ABRA record new -p gandi -t A -n e2e -v 192.157.2.21 coopcloud.tech
$ABRA record list -p gandi coopcloud.tech | grep -q e2e
$ABRA -n record rm -p gandi -t A -n e2e coopcloud.tech
echo ""
echo ""