Files
spinifex/tests/e2e/single/teardown_test.go
T
Josh Siviour 40f8c4da94 refactor(e2e/single): drop phase numbers + parallel bucket #1 (#247)
- Rename 36 phaseN_X / phaseIAM_N funcs to runX.
- Drop numeric suffix from 7 TestIAMN_X wrappers (TestIAM1_UserCRUD -> TestIAMUserCRUD).
- Rewrite harness.Phase log strings "Phase N - X" -> "Single - X" to mirror multinode convention.
- Add t.Parallel() to bucket #1: 10 read-only / own-everything top-level Tests (Environment, ClusterStatsCLI, Discovery, SerialConsoleAccess, KeyPairs, Image, TagManagement, AccountScoping, VPCSubnetE2E, RouteTableValidation). Sequential bucket retains source-order singleton lifecycle (InstanceLaunch through FinalClusterStats).
2026-05-21 22:47:26 +10:00

33 lines
1.1 KiB
Go

//go:build e2e
package single
import (
"strings"
"testing"
"github.com/mulgadc/spinifex/tests/e2e/harness"
)
// runFinalClusterStats is a single-node sanity pass against `spx get
// vms`. Replaces the umbrella's phase9 + phase9a (deleted) — resource
// cleanup is now owned by harness.Fixture.Close, invoked from TestMain
// after every Test* in the package has run.
func runFinalClusterStats(t *testing.T, fix *Fixture) {
harness.Phase(t, "Single — Final Cluster Stats")
if fix.Env.Mode != harness.ModeSingle {
t.Skipf("Phase 9b is single-node only (mode=%s)", fix.Env.Mode)
}
out := harness.SpxGetVMs(t)
harness.Detail(t, "spx_get_vms_bytes", len(out))
// Best-effort sanity: log (don't fail) if the output unexpectedly lists
// any i-XXXXXX rows. Per-test fixture cleanups should have terminated
// every instance the suite launched in single-node mode, but other
// suites running in parallel would surface here.
if strings.Contains(out, "i-") {
t.Logf("phase9b: spx get vms still references instance-like rows (may be from concurrent suites):\n%s", out)
}
}