use tests library for enable-service tests

This commit is contained in:
Alexander Tomokhov 2023-12-22 14:03:50 +04:00
parent 55cf8bc0a6
commit ec339bb8d1

View file

@ -97,7 +97,7 @@ steps:
TESTS_REPO: git+https://git.selfprivacy.org/alexoundos/selfprivacy-tests.git TESTS_REPO: git+https://git.selfprivacy.org/alexoundos/selfprivacy-tests.git
TIMEOUT_1: 100 TIMEOUT_1: 100
commands: commands:
- source $(nix build $TESTS_REPO#library --print-out-paths)/library.sh - source $(nix build $TESTS_REPO#library --print-out-paths)
- dig api.$DOMAIN - dig api.$DOMAIN
- retry $TIMEOUT_1 10 http -v --verify=false --check-status --ignore-stdin GET https://api.$DOMAIN/services/status Authorization:"Bearer $USER_PASS" - retry $TIMEOUT_1 10 http -v --verify=false --check-status --ignore-stdin GET https://api.$DOMAIN/services/status Authorization:"Bearer $USER_PASS"
- swaks --to ci@$DOMAIN -s selfprivacy.org -tls -au test@selfprivacy.org -ap $TEST_EMAIL_PASS -ahp - swaks --to ci@$DOMAIN -s selfprivacy.org -tls -au test@selfprivacy.org -ap $TEST_EMAIL_PASS -ahp
@ -116,13 +116,14 @@ steps:
TESTS_REPO: git+https://git.selfprivacy.org/alexoundos/selfprivacy-tests.git TESTS_REPO: git+https://git.selfprivacy.org/alexoundos/selfprivacy-tests.git
TIMEOUT_1: 100 TIMEOUT_1: 100
commands: commands:
- timer=0; while true; do nix run $TESTS_REPO#query-minimum-services && break; [ "$timer" -lt "$TIMEOUT_1" ]; echo "$((TIMEOUT_1 - timer)) seconds remain for retries"; sleep 10; ((timer+=10)); done - source $(nix build $TESTS_REPO#library --print-out-paths)
- nix run $TESTS_REPO#enable-service bitwarden - retry $TIMEOUT_1 10 query-minimum-services
- nix run $TESTS_REPO#enable-service gitea - enable-service bitwarden
- nix run $TESTS_REPO#enable-service jitsi-meet - enable-service gitea
- nix run $TESTS_REPO#enable-service ocserv - enable-service jitsi-meet
- nix run $TESTS_REPO#enable-service pleroma - enable-service ocserv
- nix run $TESTS_REPO#nixos-rebuild Rebuild - enable-service pleroma
- nixos-rebuild Rebuild
- sleep 70 - sleep 70
- timer=0; while true; do nix run $TESTS_REPO#query-all-services && break; [ "$timer" -lt "$TIMEOUT_1" ]; echo "$((TIMEOUT_1 - timer)) seconds remain for retries"; sleep 10; ((timer+=10)); done - timer=0; while true; do nix run $TESTS_REPO#query-all-services && break; [ "$timer" -lt "$TIMEOUT_1" ]; echo "$((TIMEOUT_1 - timer)) seconds remain for retries"; sleep 10; ((timer+=10)); done
- nix run $TESTS_REPO#nixos-rebuild Rollback - nix run $TESTS_REPO#nixos-rebuild Rollback