Skip to content

Restructure the just recipes for running integration tests#5720

Merged
stefanhaller merged 6 commits into
masterfrom
restructure-e2e-just-targets
Jun 23, 2026
Merged

Restructure the just recipes for running integration tests#5720
stefanhaller merged 6 commits into
masterfrom
restructure-e2e-just-targets

Conversation

@stefanhaller

Copy link
Copy Markdown
Collaborator

just e2e used 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 type just e2e out of habit when you actually meant just 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

Command Before After
just e2e All tests, visible UI (very slow) All tests, headless (what CI runs)
just e2e <name> — (no such target) That one test, headless
just e2e-cli [--slow|--sandbox|--debug] <name> A test in a visible UI (the old e2e)
just e2e-tui unchanged unchanged
just e2e-all All tests, headless removed (now redundant)

just e2e and just e2e-cli accept either a test name (submodule/reset) or a full file path (pkg/integration/tests/submodule/reset.go), and e2e-cli/e2e-tui mirror the two cmd/integration_test/main.go subcommands (cli and tui).

Also added zsh tab-completion for the test names, so just e2e sub<Tab> expands to just e2e submodule/, then drills into the tests within.

stefanhaller and others added 6 commits June 23, 2026 13:09
`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>
…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.
@stefanhaller stefanhaller added the maintenance For refactorings, CI changes, tests, version bumping, etc label Jun 23, 2026
@stefanhaller stefanhaller enabled auto-merge June 23, 2026 11:44
@stefanhaller stefanhaller merged commit f103cf2 into master Jun 23, 2026
24 of 25 checks passed
@stefanhaller stefanhaller deleted the restructure-e2e-just-targets branch June 23, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance For refactorings, CI changes, tests, version bumping, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant