test(e2e): add containerized install and daemon tests#1422
test(e2e): add containerized install and daemon tests#1422julianknutsen merged 2 commits intogastownhall:mainfrom
Conversation
Review: Merge with minor fixesThe e2e containerized tests add genuine value - they're the first Docker-based integration tests exercising the full install, rig, crew, doctor, daemon pipeline. Requested fixes before merge:
Optional: Pin the beads repo clone to a tag/commit for reproducibility. |
Add e2e tests that verify gt install creates a functional system: - TestInstallDoctorClean: verifies structure, rig/crew add, commands - TestInstallWithDaemon: extends above with daemon lifecycle testing Tests run in isolated Docker container for reproducibility. Includes: - Dockerfile.e2e for test container - Makefile targets: test-e2e, test-e2e-container - GitHub Actions workflow for CI Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
aa6d214 to
8ef7037
Compare
Update the cherry-picked e2e tests (from PR gastownhall#559 by Erik LaBianca) to work with the current codebase: Dockerfile.e2e: - Upgrade to golang:1.25-alpine (beads now requires Go 1.25+) - Add icu-dev for beads ICU regex dependency - Build bd from source (replace directives break go install @Version) - Add ldflags (-X BuiltProperly=1) to avoid stderr warnings - Fix header comment (Dockerfile.test → Dockerfile.e2e) install_integration_test.go: - Use remote repo (octocat/Hello-World.git) for rig add instead of local paths (CLI now validates URLs are remote) - Remove mail inbox from command smoke tests (needs Dolt server) - Make daemon start non-fatal (logs warning, verifies via status) .github/workflows/e2e.yml: - Switch from push/PR triggers to nightly schedule (daily 6am UTC) plus workflow_dispatch for manual runs Tested: docker build + docker run — all 8 subtests pass across both TestInstallDoctorClean and TestInstallWithDaemon. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8ef7037 to
c8ef15d
Compare
Automated PR Review — Dual-Model (Claude + Codex)Decision: approveThis is a solid resurrection of @easel's containerized e2e tests from PR #559, carefully adapted for the current codebase. The Docker isolation approach is the right call — it avoids host state leakage entirely and guarantees all dependencies (bd, dolt, tmux-less environment) are consistent. The adaptation work is thorough: HOME override isolation, dolt identity config, port conflict cleanup, crash detection in doctor, and removal of commands that need populated beads tables. The review found no blockers. Two minor items and two nits are noted below for awareness — none require changes before merge. Minor:
|
Summary
Resurrects the containerized e2e tests from PR #559 (by @easel / Erik LaBianca), cherry-picked and adapted for the current codebase.
TestInstallDoctorCleanandTestInstallWithDaemoncoveringgt install,gt rig add,gt crew add,gt dolt,gt daemon, andgt doctor, plus 6 standalone install testsgt dolt init-rig hq) and start the server (gt dolt start) before rig operations//go:build e2eso tests are excluded from CI's-tags=integrationruns; only the Docker container passes-tags=e2eworkflow_dispatchtriggeroctocat/Hello-World.gitas the test rig repo (front-door CLI only, no internal API calls)make test-e2etarget (removed to prevent host leakage)Files added/modified (cherry-pick from #559 + adaptation)
internal/cmd/install_integration_test.go— e2e tests (//go:build e2e)Dockerfile.e2e— Alpine-based test container.github/workflows/e2e.yml— CI workflowMakefile—test-e2e-containertarget onlyAdaptation commit
upstream/main(clean 2-commit history)golang:1.25-alpine(beads requires Go 1.25+)icu-dev,procps,lsofto Dockerfile (beads ICU dependency, dolt process verification)bdanddoltfrom source in DockerfileBuiltProperly=1) to Dockerfile buildrig addfrom local paths to remote URL (CLI now validates remote-only)configureDoltIdentityhelper (HOME override hides container's global dolt config)gt dolt init-rig+gt dolt startsubtests to both testspkill -f "dolt sql-server"between tests to avoid port 3307 conflictsmail inboxandhookfrom command smoke tests (fresh Dolt databases lack beads tables)integrationtoe2eto prevent CI from running container-only teststest-e2eMakefile target (container is the only supported execution path)cleanE2EEnv()helper (local copy, avoids dependency onintegration-tagged files)-parallel 1to Dockerfile CMD for sequential test executiont.Skipguards — dependencies guaranteed by Dockerfilecontainer-testfrom Makefile.PHONYTest plan
go build -tags=e2e ./internal/cmd/...— compiles cleanlygo test -tags=integration -list TestInstallDoctorClean— NOT listed (excluded from CI)go test -tags=e2e -list TestInstall— all 9 tests listedgo test ./internal/cmd/...— regular tests still passdocker build -f Dockerfile.e2e -t gastown-test .— container buildsdocker run --rm gastown-test— all 9 tests (17 subtests) pass, zero skips🤖 Generated with Claude Code