End-to-End (E2E) Cluster Testing Workflow (`test-e2e-cluster`)
1. Preconditions & Inputs
Before running or modifying E2E suites, verify:
- Local Kind CPU E2E (
test/e2e/):makeinstalls./bin/kindautomatically, andBeforeSuiteapplies the vendored manifests intest/e2e/testdata/(seeMakefile##@ Development). - GKE GPU E2E (
test/e2e/gpu/): Configure the.env/ environment variables defined inMakefile(##@ E2E GPU Testing) andtest/e2e/infra/gke-gpu-cluster-setup.sh.
2. Guardrails
- Confirmation gate for GKE GPU cluster creation:
make test-e2e-gpuandmake setup-infra-gpucreate billable GKE clusters and GPU node pools viatest/e2e/infra/gpu-cluster-setup.sh. Obtain user confirmation before running them. - Use
ResetSlurmAndK8sStateintest/utils/slurm.gofor E2E cleanup: Never force-delete dynamicslurmdpods with--grace-period=0(see skills/ops-cleanup-state/SKILL.md). - Reload Lua
ConfigMapobjects when iterating onhack/*.luain an existing Kind cluster: If testinghack/*.luachanges against an existing Kind E2E cluster without rerunningBeforeSuite, reload the Lua ConfigMaps via skills/dev-slurm-lua/SKILL.md (Step 2, Option B).
3. Step-by-Step Procedure
Select the step matching your target E2E task (do not run Steps 1, 2, and 3 together):
Step 1: Run Full Local Kind CPU E2E Suite (`make test-e2e`)
Run the full Kind CPU E2E lifecycle (cluster setup, image build/load, Ginkgo suite, and teardown):
make test-e2e
Step 2: Run Focused Ginkgo Specs Against an Existing Kind Cluster
Create the Kind cluster once via make setup-test-e2e, run focused specs with KIND and KIND_CLUSTER set, and tear down via make cleanup-test-e2e when finished:
KIND=./bin/kind KIND_CLUSTER=k8s-bridge-test-e2e go test -tags=e2e ./test/e2e/ -v -ginkgo.v -ginkgo.focus="<spec pattern>" -timeout 20m
Step 3: Run GKE GPU E2E Suite (`make test-e2e-gpu` vs `make run-test-e2e-gpu`)
- Configure
.envin the repository root withGCP_PROJECTand the GPU test variables listed inMakefile(##@ E2E GPU Testing). When testing local code changes on GKE (INFRA_PROVIDER=gke), build and pushIMGfirst (make docker-build docker-push IMG=$IMG; seeREADME.md#### GPU E2E Tests on a Provided Cluster). - Full lifecycle (provision GKE cluster + run tests + tear down cluster): After user confirmation, run
make test-e2e-gpu IMG=$IMG. - Existing cluster execution (skip cluster creation and teardown): When the GKE GPU cluster is already running in
kubectl config current-context, runmake run-test-e2e-gpu IMG=$IMG.
Step 4: Write New E2E Test Specs (`test/e2e/`)
Reuse the E2E job submission (DefaultSlurmTestUser), state verification, and cluster reset helpers in test/utils/slurm.go, test/utils/login_node.go, and test/utils/jobset.go, following the patterns in test/e2e/e2e_test.go, test/e2e/slurm_flag_rejection_test.go, and test/e2e/gpu/gpu_test.go.
4. Verification
- Verify the Ginkgo suite passes and any temporary Kind/GKE test cluster created by
make test-e2eormake test-e2e-gpuwas cleaned up. - Run
make fmt vet lintafter editing any files undertest/.
5. Handoffs & Related Skills
- If an E2E spec fails with a stuck or cancelled Slurm job: Read skills/ops-diagnose-workload/SKILL.md to inspect
slurmctld,k8s-bridge, and Kueue state. - To run fast local unit and
envtestsuites: Read skills/test-unit-and-lint/SKILL.md. - To install or upgrade the base operator stack in a cluster: Read skills/infra-deploy-stack/SKILL.md.