Manual Test Runbook — X2: Terratest Harness
Owner: Sagar | Time: ~20 min | Sandbox: snowops-sandbox-01
Purpose
Validate that the X2 Terratest harness is correctly installed, that the self-test
(TestNoopHarness) passes without cloud credentials, that the sandbox validate test
(TestSandboxValidate) confirms the X1 HCL is valid, and that the integration probe
(TestSandboxProbe) can deploy and destroy a real resource in the sandbox subscription.
Prerequisites
- Go 1.22+ installed:
go version - Terraform 1.6+ installed:
terraform version - Azure CLI installed:
az version - Sandbox sub access via PIM activated (Owner or Contributor)
-
az login --tenant <TENANT_ID>completed;az account showreturns the sandbox sub -
SNOWOPS_SANDBOX_SUBSCRIPTION_IDandSNOWOPS_SANDBOX_TENANT_IDenv vars exported
Steps
1. Install Go dependencies
-
go mod downloadcompletes without error - No "module not found" or checksum errors
2. Run the X2 self-test (no cloud needed)
-
--- PASS: TestNoopHarnessin output -
--- PASS: TestSandboxValidatein output - Exit code 0
3. Run the sandbox integration probe
export SNOWOPS_SANDBOX_SUBSCRIPTION_ID="<guid>"
export SNOWOPS_SANDBOX_TENANT_ID="<guid>"
go test -v -tags integration -timeout 15m ./sandbox/...
-
--- PASS: TestSandboxProbein output - In the Azure portal, resource group
snowops-x2-probe-*appeared during the run - Resource group was destroyed on test completion (not visible in portal)
- Exit code 0
4. Verify ephemeral safety net
If the test had been aborted mid-run, the probe RG would survive. Confirm the X7 nightly cleanup would catch it:
- Resource group is gone (404) — destroy completed normally
- If it still exists: tags must include
ephemeral=true(X7 will collect it)
Pass criteria
-
TestNoopHarnessPASS without any Azure env vars set -
TestSandboxValidatePASS without any Azure env vars set -
TestSandboxProbePASS with sandbox env vars; probe RG created and destroyed - No residual resources left in the subscription
Teardown
Terraform destroy runs automatically via defer terraform.Destroy(t, opts) inside
the test. If a test is aborted:
# List any surviving probe resource groups
az group list --subscription $SNOWOPS_SANDBOX_SUBSCRIPTION_ID \
--query "[?contains(name,'snowops-x2-probe')].[name]" -o tsv
# Destroy manually if needed
az group delete --name <name> --subscription $SNOWOPS_SANDBOX_SUBSCRIPTION_ID --yes
Sign-off
- Tester: _ | Date: _ | Result: PASS / FAIL / N/A
- Notes: