Skip to content

ci: run the full test suite across the feature powerset, not just lib - #3068

Merged
max-sixty merged 2 commits into
mainfrom
ci-test-feature-combos
Jun 13, 2026
Merged

max-sixty merged 2 commits into
mainfrom
ci-test-feature-combos

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Follow-up to #3059, which added a per-combination test sweep to nightly but bounded it to --lib (plus a separate --doc pass). The integration suite snapshots highlighted wt output, so it only passes with syntax-highlighting on — --lib was a blunt way to keep it out of the combinations that can't satisfy that. 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, in Cargo.toml:

  • 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, 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 explicit cargo build -p mock-stub and --doc steps 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 the shell-integration-tests combinations.

Verified locally: the full 20-combination sweep is green, with integration running only on the cli + syntax-highlighting combinations and skipped on the rest. CI runs this job on the PR (it touches nightly.yaml), so the powerset exercises itself here.

This was written by Claude Code on behalf of max

max-sixty and others added 2 commits June 13, 2026 15:25
#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 worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@max-sixty
max-sixty merged commit 465b8fd into main Jun 13, 2026
36 checks passed
@max-sixty
max-sixty deleted the ci-test-feature-combos branch June 13, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants