Skip to content

ci: fix cargo-affected invocations (drop --verbose, use -- for nextest args) - #2546

Merged
max-sixty merged 2 commits into
mainfrom
fix-affected-verbose
May 3, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix-affected-verbose

Conversation

@max-sixty

@max-sixty max-sixty commented May 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two fixes to the cargo affected invocations in .github/workflows/ci.yaml.

1. Drop --verbose from affected tests (commit 1)

The affected tests (linux, advisory) job was running:

cargo affected run --features shell-integration-tests --verbose

cargo-affected's run subcommand currently uses trailing_var_arg = true, so once clap sees an unknown flag (--features), it sweeps everything after it — including --verbose — into the trailing args sink and forwards it verbatim to cargo nextest run. nextest's --verbose:

  • bumps status level to all (per-test START [progress] lines), and
  • prints the spawned command for each test (command: /path/to/binary --exact <test> --nocapture).

With ~3400 tests, that's two extra lines per test — the CI log becomes unreadable. See the reference run around test 2684/3429 (e.g., test_switch_remote_prefix_stripped):
https://github.com/max-sixty/worktrunk/actions/runs/25270305877/job/74091452305?pr=2541

cargo-affected already prints its own pipeline progress, so we don't want nextest's verbose mode layered on top.

2. Use -- before --features in both call sites (commit 2)

cargo-affected PR max-sixty/cargo-affected#11 makes both run and collect parsers strict (last = true), so unknown flags will error unless preceded by --. The workflow pulls cargo-affected from the latest default-branch sha (no rev pin), so once that PR merges:

  • cargo affected collect --features shell-integration-tests → UnknownArgument
  • cargo affected run --features shell-integration-tests → UnknownArgument

Both call sites move to cargo affected {run,collect} -- --features shell-integration-tests. The new form is also accepted by the current (loose) parser, so this is safe to merge before PR #11 lands.

Test plan

  • CI on this PR runs cargo affected run without the verbose nextest output (no START / command: lines per test).
  • Once cargo-affected#11 merges, both collect and run steps continue to work without UnknownArgument.

🤖 Generated with Claude Code

max-sixty and others added 2 commits May 2, 2026 22:33
cargo-affected's `run` subcommand uses `trailing_var_arg = true`, so any
unknown flag causes everything after it to be swept into the trailing
args sink and forwarded verbatim to `cargo nextest run`. With
`--features shell-integration-tests --verbose`, the `--verbose` was
forwarded to nextest, which bumped the status level to `all` (per-test
START lines) and printed the spawned command for each test. The result
was two extra lines per test across ~3400 tests, making CI logs
unreadable.

cargo-affected already prints its own pipeline progress, so we don't
need nextest's verbose mode on top of it.

Reference run with the noise:
https://github.com/max-sixty/worktrunk/actions/runs/25270305877/job/74091452305?pr=2541

Co-Authored-By: Claude <noreply@anthropic.com>
cargo-affected PR #11 (max-sixty/cargo-affected#11)
makes the `run`/`collect` arg parsers strict — both subcommands switch
from `trailing_var_arg = true` to `last = true`, so unknown flags now
error unless preceded by `--`. The workflow installs cargo-affected at
the latest default-branch sha (no rev pin), so once that PR merges,
both `cargo affected collect --features shell-integration-tests` and
`cargo affected run --features shell-integration-tests` would fail
with `UnknownArgument`.

Move `--features shell-integration-tests` after `--` in both call
sites. This is the new documented form and it works against the
current (loose) parser too, so the change is safe to merge before
PR #11 lands.

Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty max-sixty changed the title ci: drop --verbose from cargo affected run ci: fix cargo-affected invocations (drop --verbose, use -- for nextest args) May 3, 2026
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