fix(e2e): skip GCP tests when billing is disabled (#3146)

Add a billing pre-check to _gcp_validate_env so the E2E orchestrator
skips GCP gracefully ("skipped — credentials not configured") instead
of failing every agent individually when billing is disabled.

Fixes #3091

Agent: test-engineer

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
A 2026-04-02 05:26:42 -07:00 committed by GitHub
parent 70bba831f6
commit e3278578ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -80,6 +80,18 @@ process.stdout.write(d.GCP_ZONE || '');
return 1
fi
# Check if billing is enabled on the project. Without billing, instance
# creation always fails — skip early so the orchestrator reports "skipped"
# instead of failing every agent individually. See #3091.
local _billing_enabled
_billing_enabled=$(gcloud billing projects describe "${GCP_PROJECT}" \
--format="value(billingEnabled)" 2>/dev/null || true)
if [ "${_billing_enabled}" = "False" ]; then
log_err "Billing is disabled on GCP project '${GCP_PROJECT}' — cannot create instances"
log_err "Re-enable billing at: https://console.cloud.google.com/billing/linkedaccount?project=${GCP_PROJECT}"
return 1
fi
log_ok "GCP credentials validated (project: ${GCP_PROJECT}, zone: ${GCP_ZONE:-us-central1-a})"
return 0
}