Harden CI, release, and acceptance test safety

This commit is contained in:
beatz174-bit
2026-05-12 15:12:44 +10:00
parent 878a472005
commit 1980d1f08a
7 changed files with 159 additions and 382 deletions
+9 -8
View File
@@ -11,19 +11,20 @@ if [[ "${mode}" == "mock" ]]; then
exec "$(dirname "$0")/test-integration.sh"
fi
if [[ "${TF_ACC:-}" != "1" ]]; then
echo "[testacc][error] live mode requires TF_ACC=1" >&2
if [[ "${DYNU_ACC:-}" != "1" ]]; then
echo "[testacc][error] live mode requires DYNU_ACC=1" >&2
exit 1
fi
if [[ -z "${DYNU_API_KEY:-}" ]]; then
echo "[testacc][error] live mode requires DYNU_API_KEY" >&2
if [[ -z "${DYNU_ACC_API_KEY:-}" ]]; then
echo "[testacc][error] live mode requires DYNU_ACC_API_KEY" >&2
exit 1
fi
if [[ -z "${DYNU_DOMAIN:-}" ]]; then
echo "[testacc][warn] DYNU_DOMAIN not set; domain-specific acceptance tests will skip"
if [[ -z "${DYNU_ACC_TEST_DOMAIN:-}" ]]; then
echo "[testacc][error] live mode requires DYNU_ACC_TEST_DOMAIN" >&2
exit 1
fi
echo "[testacc] running live acceptance tests"
go test ./internal/provider -run '^TestAcc' -count=1 -v
echo "[testacc] running live acceptance tests (destructive: creates/updates/deletes records)"
TF_ACC=1 DYNU_API_KEY="${DYNU_ACC_API_KEY}" DYNU_DOMAIN="${DYNU_ACC_TEST_DOMAIN}" go test ./internal/provider -run '^TestAcc' -count=1 -v