Skip to content

Commit 3ed0d70

Browse files
tnsardesaiclaude
andauthored
chore: split e2e tests for real-time output (#152)
## Summary - Split `make test` so e2e tests run as a separate `go test` invocation instead of bundled in `go test ./...` - Unit tests still run together (fast, ~2s total) - E2e tests run alone with a banner message before they start ## Why `go test ./...` buffers each package's output until the package completes. Since e2e tests take ~2 minutes (testcontainers), the terminal shows nothing for that entire duration — it looks like the tests are hung. Running e2e as a separate `go test ./e2e/` invocation makes it the only active package, so output (container startup, health checks, test progress) streams in real time. There's no way to disable per-package buffering in `go test` when running multiple packages in parallel — it's intentional to prevent interleaved output. The `-p 1` flag would work but slows down the overall run which is why it was removed #137. The split approach gives real-time streaming where it matters (e2e) with no performance cost. ## Test plan - [x] `make test` passes (all unit + e2e tests green) - [x] E2e output streams in real time after the banner - [x] Unit tests still run in parallel as before 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Makefile-only change that alters test execution ordering/invocation but not production code; main risk is accidentally excluding/duplicating packages due to the `go list | grep -v /e2e$` filter. > > **Overview** > `make test` now runs non-e2e packages first and executes `./e2e` tests as a separate `go test` step, with a banner printed before the e2e run to make progress/logs visible while testcontainers start up. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 310bc74. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 134924c commit 3ed0d70

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

server/Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,14 @@ build: | $(BIN_DIR)
3333
dev: build $(RECORDING_DIR)
3434
OUTPUT_DIR=$(RECORDING_DIR) DISPLAY_NUM=$(DISPLAY_NUM) ./bin/api
3535

36+
# we run the e2e tests separately so that we can see the logs from the e2e tests as they run instead of waiting for all tests to complete
3637
test:
3738
go vet ./...
38-
# E2E tests use dynamic ports via TestContainer, enabling parallel execution
39-
go test -v -race ./...
39+
go test -v -race $$(go list ./... | grep -v /e2e$$)
40+
@echo ""
41+
@echo "=== Running e2e tests (testcontainers — this may take a few minutes) ==="
42+
@echo ""
43+
go test -v -race ./e2e/
4044

4145
clean:
4246
@rm -rf $(BIN_DIR)

0 commit comments

Comments
 (0)