Archived
Add mock-backed integration testing tier and fake Dynu API
This commit is contained in:
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
echo "[test-integration] running mock-backed provider integration tests"
|
||||
go test ./internal/provider -run '^TestIntegration' -count=1 -v
|
||||
+13
-3
@@ -1,13 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
mode="mock"
|
||||
if [[ "${1:-}" == "--live" || "${LIVE:-}" == "1" ]]; then
|
||||
mode="live"
|
||||
fi
|
||||
|
||||
if [[ "${mode}" == "mock" ]]; then
|
||||
echo "[testacc] no --live flag detected; running local mock-backed integration tests"
|
||||
exec "$(dirname "$0")/test-integration.sh"
|
||||
fi
|
||||
|
||||
if [[ "${TF_ACC:-}" != "1" ]]; then
|
||||
echo "[testacc][error] TF_ACC must be set to 1" >&2
|
||||
echo "[testacc][error] live mode requires TF_ACC=1" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z "${DYNU_API_KEY:-}" ]]; then
|
||||
echo "[testacc][error] DYNU_API_KEY must be set" >&2
|
||||
echo "[testacc][error] live mode requires DYNU_API_KEY" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -15,5 +25,5 @@ if [[ -z "${DYNU_DOMAIN:-}" ]]; then
|
||||
echo "[testacc][warn] DYNU_DOMAIN not set; domain-specific acceptance tests will skip"
|
||||
fi
|
||||
|
||||
echo "[testacc] running acceptance tests"
|
||||
echo "[testacc] running live acceptance tests"
|
||||
go test ./internal/provider -run '^TestAcc' -count=1 -v
|
||||
|
||||
Reference in New Issue
Block a user