Convert bats E2E tests to Go + Ginkgo#439
Conversation
Convert all 5 bats E2E test files (tests.bats, tests-hooks.bats, tests-direct-listener.bats, compat/tests-old-client.bats, compat/tests-old-controller.bats) to Go + Ginkgo test suites. Key changes: - New e2e/test/ Go module with ginkgo/gomega dependencies - utils.go: shared helpers for command execution, process tracking, exporter lifecycle management, and debug logging - e2e_test.go: core tests (login, CRUD, leases, connectivity) - hooks_test.go: hook execution tests (groups A-H) - direct_listener_test.go: direct TCP listener mode tests - compat_old_client_test.go: old client compatibility tests - compat_old_controller_test.go: old controller compatibility tests - Updated run-e2e.sh and compat/run.sh to use ginkgo runner Label structure for subset filtering: - "core" - main test suite - "hooks" - hook execution tests - "direct-listener" - direct listener tests - "compat" - all compatibility tests - "old-client" - old client compat tests - "old-controller" - old controller compat tests - "operator-only" - tests requiring operator deployment Environment variables: - E2E_TEST_NS / JS_NAMESPACE - test namespace - PYTHON_VENV / PYTHON_OLD_VENV - python venv paths - OLD_JMP - path to old jmp binary for compat tests - REPO_ROOT - repository root directory Closes #436 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✅ Deploy Preview for jumpstarter-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Fix yq stdout contamination: use RunCmdSplit in Yq helper to separate stdout from stderr, preventing Go toolchain switching messages from polluting extracted values. Replace inline bash+yq pipe with MustYq in the lease transfer test. - Fix hooks test timing: replace fixed time.Sleep + immediate assertion with Gomega Eventually (10s timeout) when checking that exporter processes have exited, avoiding flaky failures on slow CI. - Fix direct listener connection refused: add port-release wait in AfterEach so the next test does not attempt to bind port 19090 before the OS has fully released it from the previous exporter. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nd increase process exit timeouts The "afterLease hook runs on exporter shutdown" test was sending SIGKILL (via cmd.Process.Kill()) which prevents cleanup hooks from running, then asserting the afterLease hook output was present. Changed to SIGTERM to allow the exporter's cleanup handler to execute. Also increased IsProcessRunning timeouts from 10s to 30s for the B3 and C2 hook tests, as ARM CI runners need more time for exporter shutdown. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CI Fix: e2e test failures on ARMTwo e2e tests were failing on 1.
|
…n ARM When StartExporterSingle starts a child process via cmd.Start() without ever calling cmd.Wait(), the process becomes a zombie after it exits. Signal(0) returns nil for zombies, so IsProcessRunning() never detects the exit — causing tests B3 and C2 to time out waiting for the exporter to stop (especially on slower ARM runners). Fix by spawning a background goroutine that calls cmd.Wait() to reap the child process, allowing Signal(0) to correctly report it as gone. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
e2e/test/utils.gofor command execution, process tracking, exporter lifecycle, and debug logginge2e/run-e2e.shande2e/compat/run.shto use the ginkgo runner instead of batscore,hooks,direct-listener,compat,old-client,old-controller,operator-onlyE2E_TEST_NS,PYTHON_VENV,PYTHON_OLD_VENVenvironment variables as specified in the issueTest file mapping
tests.batse2e_test.gocoretests-hooks.batshooks_test.gohookstests-direct-listener.batsdirect_listener_test.godirect-listenercompat/tests-old-client.batscompat_old_client_test.gocompat,old-clientcompat/tests-old-controller.batscompat_old_controller_test.gocompat,old-controllerWorkflow file changes
The
.github/workflows/e2e.yamlworkflow currently invokesmake e2e-runandmake e2e-compat-runwhich call the shell scripts that have been updated. The workflow should work as-is since the runner scripts now invoke ginkgo instead of bats. However, the following optional workflow improvements could be made:batsinstallation step insetup-e2e.shis no longer needed for the test runner (though it may still be needed for other setup steps)GINKGO_LABEL_FILTERsupport to the workflow matrix for selective test runsTest plan
go vetandgo buildpass ine2e/test/(verified locally)make e2e-runin a cluster environment to validate the converted testsmake e2e-compat-run COMPAT_TEST=old-controllerto validate compat testsmake e2e-compat-run COMPAT_TEST=old-clientto validate old-client testsGINKGO_LABEL_FILTER=hooks make e2e-runCloses #436
🤖 Generated with Claude Code