From 658a66e14b4c5b7629fac3bd2e7f4a7787103c51 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Tue, 23 Jun 2026 09:54:05 +0200 Subject: [PATCH] Restructure integration-test just targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `just e2e` was the visible-UI runner, but it's only useful for a single test (and even then only with --sandbox/--slow); running it without arguments is far too slow, yet it was easy to invoke by reflex when `just e2e-all` (run all headlessly) was meant. Make `just e2e` the everyday headless runner: no arguments runs the whole suite (what e2e-all did), and a test name runs just that one headlessly via `go test -run` — which we had no target for before. The visible-UI runner moves to `e2e-cli`, pairing with the existing `e2e-tui` (the two main.go subcommands). e2e-all is now redundant and removed. Co-Authored-By: Claude Opus 4.8 (1M context) --- AGENTS.md | 5 +++-- justfile | 23 +++++++++++++++++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 2fb36392e..8a4f924e4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -21,8 +21,9 @@ Windows box has only `just`). - `just format` — `gofumpt -l -w .`. Run before every commit. - `just build` — build the binary. - `just unit-test` — `go test ./... -short`. -- `just e2e-all` — run all integration tests headlessly (`just e2e ` runs a - single one with a visible UI). +- `just e2e` — run all integration tests headlessly; `just e2e ` runs a + single one headlessly too. `just e2e-cli ` runs one with a visible UI + (most useful with `--sandbox` or `--slow`). - `just lint` — run golangci-lint. ## When to commit diff --git a/justfile b/justfile index e7f9fcdc5..c6785b933 100644 --- a/justfile +++ b/justfile @@ -23,7 +23,7 @@ unit-test: # Run both unit tests and integration tests. [unix] -test: unit-test e2e-all +test: unit-test e2e # On Windows, integration tests are not supported right now [windows] @@ -39,18 +39,29 @@ format: lint: ./scripts/golangci-lint-shim.sh run -# Run integration tests with a visible UI. Most useful for running a single test; for running all tests, use `e2e-all` instead. +e2e-test-command := "go test pkg/integration/clients/*.go" + +# Run integration tests headlessly: no args runs all tests, a test name (or path) runs just that one. Use e2e-cli for a visible UI. e2e *args: + {{ if args == "" { e2e-test-command } else { \ + e2e-test-command + " -run 'TestIntegration/" + \ + replace( \ + replace_regex( \ + replace_regex(args, '\S*pkg/integration/tests/', ''), \ + '\.go( |$)', '${1}' \ + ), \ + " ", "$' && " + e2e-test-command + " -run 'TestIntegration/" \ + ) + "$'" \ + } }} + +# Run a single integration test with a visible UI; most useful with --sandbox or --slow. +e2e-cli *args: go run cmd/integration_test/main.go cli {{ args }} # Open the TUI for running integration tests. e2e-tui *args: go run cmd/integration_test/main.go tui {{ args }} -# Run all integration tests headlessly (without a visible UI). -e2e-all: - go test pkg/integration/clients/*.go - # Run some tests on the current commit, similar to what CI does. check: ./scripts/check_commit.sh