Repository navigation
ci: run the full test suite across the feature powerset, not just lib - #3068
Conversation
#3059 added a per-combination test sweep to nightly but bounded it to `--lib` (plus a separate `--doc` pass) because the integration suite snapshots highlighted `wt` output and only passes with syntax-highlighting on. This runs the unfiltered `cargo hack test --feature-powerset` — lib, integration, and doctests per combination — and moves the scoping to where it's semantically correct: - The `integration` test target declares `required-features = ["cli", "syntax-highlighting"]`. It execs the `wt` binary (needs `cli`) and snapshots its highlighted output (needs `syntax-highlighting`), so cargo runs it only on combinations that satisfy both and skips it elsewhere instead of failing. - The `git-wt` binary gets `test = false`. `git_wt.rs` is `include!("main.rs")`, so its unit tests are byte-identical duplicates of the `wt` binary's; insta derives snapshot filenames from the crate name, so the duplicates look for `git_wt__*.snap` files that don't exist (only `wt__*`). The `check` powerset still compiles the binary. Dropping the target filter lets cargo-hack (which runs workspace-style `cargo test --manifest-path`) build the mock-stub helper bin via default-members and run doctests on its own, so the explicit `cargo build -p mock-stub` and `--doc` steps are gone. zsh/fish/nushell are installed to match the test matrix, since the full suite now runs PTY tests on the shell-integration-tests combinations. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
worktrunk-bot
left a comment
There was a problem hiding this comment.
The manifest changes line up: mock-stub is a default-member, so dropping --lib lets the default cargo test build it (replacing the explicit cargo build -p mock-stub); git-wt's test = false avoids the duplicate git_wt__* snapshot lookups; and the integration required-features gate lets cargo-hack skip incompatible combos while lib+doc tests still run everywhere. Inlined shell setup matches .github/actions/test-setup exactly.
One non-blocking note: this adds a third copy of the shell-install pins (cache-apt-pkgs-action + [email protected]) alongside test-setup and ci.yaml's code-coverage job. They now have to be bumped in lockstep — a small shared composite action (or just a cross-reference comment) would keep the setup-nu version from drifting across sites.
Follow-up to #3059, which added a per-combination test sweep to nightly but bounded it to
--lib(plus a separate--docpass). The integration suite snapshots highlightedwtoutput, so it only passes withsyntax-highlightingon —--libwas a blunt way to keep it out of the combinations that can't satisfy that. This runs the unfilteredcargo hack test --feature-powerset— lib, integration, and doctests per combination — and moves the scoping to where it's semantically correct, inCargo.toml:integrationtest target declaresrequired-features = ["cli", "syntax-highlighting"]. It execs thewtbinary (needscli) and snapshots its highlighted output (needssyntax-highlighting), so cargo runs it only on combinations that satisfy both and skips it elsewhere instead of failing.git-wtbinary getstest = false.git_wt.rsisinclude!("main.rs"), so its unit tests are byte-identical duplicates of thewtbinary's; insta derives snapshot filenames from the crate name, so the duplicates look forgit_wt__*.snapfiles that don't exist (onlywt__*). Thecheckpowerset still compiles the binary, so compile coverage is unchanged.Dropping the target filter also lets cargo-hack (which runs workspace-style
cargo test --manifest-path) build the mock-stub helper bin via default-members and run doctests on its own, so the explicitcargo build -p mock-stuband--docsteps are gone. zsh/fish/nushell are installed to match the test matrix (.github/actions/test-setup), since the full suite now runs PTY tests on theshell-integration-testscombinations.Verified locally: the full 20-combination sweep is green, with integration running only on the
cli + syntax-highlightingcombinations and skipped on the rest. CI runs this job on the PR (it touchesnightly.yaml), so the powerset exercises itself here.