Restructure the just recipes for running integration tests#5720
Merged
Conversation
`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) <noreply@anthropic.com>
just's completion is clap-dynamic and exposes no hook for completing a recipe's arguments, so `just e2e <Tab>` couldn't suggest anything. Wrap just's completer: for the e2e/e2e-cli recipes, complete the test names found under pkg/integration/tests/, delegating everything else back to just. The names are fed to _multi_parts so they complete one "/"-separated segment at a time — an empty <Tab> offers just the categories, then drills into the tests within a category — and the .go extension and the shared helper files are stripped so the candidates are exactly the names the recipe accepts. Source it from ~/.zshrc (after compinit) to enable; it's a no-op without just installed and only activates inside a repo with a justfile and a pkg/integration/tests/ directory. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The integration README still described the raw `go run cmd/integration_test` and `go test` invocations, which are easy to get wrong (the headless go-test command in particular) and don't match how we actually run the tests. Rewrite the running/debugging/sandbox instructions around the justfile's e2e recipes instead, and point at the optional zsh completion script. Also switch the test-list regeneration hint to `just generate`, matching the rest of our docs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
I never use this.
…task For running an integration test just to see if it fails or succeeds, headless mode is sufficient and actually better, because it works in small terminals like vscode's bottom panel; the "main.go cli" way of running tests tends to fail there because the layout renders differently in such a small window. Headless tests use a fixed window size, so they don't have this problem. It's also slightly faster. The other vscode tasks (slow and sandbox) are unchanged, they only make sense with a visible UI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
just e2eused to be the visible-UI test runner. Running it with no arguments launched every integration test in a visible UI — painfully slow — and it was easy to typejust e2eout of habit when you actually meantjust e2e-all(the headless run-all). This PR reshuffles the recipes so the common, fast path is the one with the shortest name.Recipe changes
just e2ejust e2e <name>just e2e-cli [--slow|--sandbox|--debug] <name>e2e)just e2e-tuijust e2e-alljust e2eandjust e2e-cliaccept either a test name (submodule/reset) or a full file path (pkg/integration/tests/submodule/reset.go), ande2e-cli/e2e-tuimirror the twocmd/integration_test/main.gosubcommands (cliandtui).Also added zsh tab-completion for the test names, so
just e2e sub<Tab>expands tojust e2e submodule/, then drills into the tests within.