Skip to content

fix(test): gate the highlighted hook-template snapshot on syntax-highlighting - #4427

Merged
max-sixty merged 1 commit into
mainfrom
fix/ci-38115848986
Oct 11, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/ci-38115848986

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

The nightly feature-powerset job (run 38115848986) fails in cargo test --no-default-features on git::error::tests::snapshot_worktrunk_error_display. #4352 added a case to that test where an unnamed hook failure renders its template (echo test) through format_bash_with_gutter. That output is only highlighted when the syntax-highlighting feature is on, so without default features the snapshot gets plain echo test and doesn't match.

This change moves that case into its own test, snapshot_unnamed_hook_failure_shows_template, gated on #[cfg(feature = "syntax-highlighting")]. snapshot_worktree_creation_failed in the same module is already gated this way for the same reason. The other assertions in snapshot_worktrunk_error_display still run in every feature configuration. This only changes tests.

Verification: cargo test --lib --no-default-features snapshot_worktrunk_error_display failed before the change and passes after it. With default features, both tests pass. cargo fmt --check and cargo clippy --lib --tests --no-default-features -D warnings are clean.

…lighting

snapshot_worktrunk_error_display gained a case in #4352 that renders an
unnamed hook's template through format_bash_with_gutter, whose output is
highlighted only with the syntax-highlighting feature. The nightly
feature-powerset job's cargo test --no-default-features run rendered it
unhighlighted and failed. Move that case into its own test gated on the
feature, as snapshot_worktree_creation_failed already is, so the rest of
the test still runs in every feature configuration.
@worktrunk-bot worktrunk-bot added the automated-fix Automated CI fix label Oct 11, 2026
This was referenced Oct 11, 2026
@max-sixty
max-sixty merged commit c388ec3 into main Oct 11, 2026
37 of 47 checks passed
@max-sixty
max-sixty deleted the fix/ci-38115848986 branch October 11, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-fix Automated CI fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants