Skip to content

fix(check): nextest --workspace covers member crates - #223

Merged
calvin-archastro merged 1 commit into
mainfrom
fix/nextest-workspace-covers-members
Oct 30, 2026
Merged

calvin-archastro merged 1 commit into
mainfrom
fix/nextest-workspace-covers-members

Conversation

@calvin-archastro

Copy link
Copy Markdown
Contributor

Problem and author intent

orphan-test-target (since #217) lets a reached cargo test --workspace cover member-crate cargo test targets. In firstlanding, //services/rust/archdev:test is with-rust-toolchain cargo nextest run --locked --workspace --all-targets .... Member crate projects have a detected cargo test or cargo nextest run ... target. They are still reported as orphans, because the workspace rule only matched cargo test.

Intent: a reached --workspace/--all run under either runner covers members running either runner.

What changed

  • TestTarget::is_cargo_test matches cargo test and cargo nextest run. TestTarget::selects_cargo_tests flags -p/--package/--exclude/--test/--lib/--bin(s)/--example/--bench/--doc/-E/--filterset/--.
  • src/check.rs: the workspace root is a reached cargo target (either runner) with --workspace/--all and no selection. Members are non-selective cargo targets (either runner) under it that do not pick packages or tests. Same directory-containment rule as before.
  • README orphan-test-target row updated.

Scope

Backend-only (aster check).

Risk

Low. Fewer orphan-test-target findings. A member with -p other, --test, a filter or -- stays reported. Side effect: a reached cargo test --workspace no longer covers a member cargo test -p x through the old textual match for the workspace rule. It can still be covered by the plain whole-suite comparison.

User impact

Fewer spurious orphan warnings for Cargo workspaces tested with nextest.

Testing

  • Canonical proof: tests/check.rs::a_workspace_wide_cargo_test_covers_the_member_crates. It drives the real binary on a scratch workspace with a root crate, a member crate with cargo nextest run and cargo nextest run -p other targets, and entries cargo test --workspace, cargo test --all --locked and cargo nextest run --locked --workspace --all-targets. It asserts only the -p other member is reported, and that a plain cargo test entry covers neither member target.
  • Ran: cargo test --locked --test check (14 pass), --lib affected_files, clippy -D warnings, cargo fmt. CI runs tests/check.rs via cargo test --all-targets.
  • Not proven here: the with-rust-toolchain wrapper path (the wrapper is stripped before the program is read, as in fix(check): resolve package scripts in orphan-test-target #217's {files}/script cases) and the real firstlanding tree.

Follow-ups

  • Membership is directory containment, not the [workspace] members list.

🤖 Generated with Claude Code

@calvin-archastro

calvin-archastro commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor Author

ArchDev is watching this pull request. State: settled (cycle 2 of 2 for head 89ac725).

when trigger decision result
2026-10-30T00:10:24.078Z failed ci enqueue job_f15f0a90bbecb9db926c2157 published a6337a4
2026-10-30T00:24:38.493Z verify head enqueue job_f543cfa918d9b3c4eef6d2a7 no change

Paused by the no-autofix label or a draft; never resolves reviewer threads. Jobs: job_f15f0a90bbecb9db926c2157, job_f543cfa918d9b3c4eef6d2a7.

@calvin-archastro
calvin-archastro force-pushed the fix/nextest-workspace-covers-members branch from f3c44b0 to a6337a4 Compare October 30, 2026 00:14
…tes under either runner

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@calvin-archastro
calvin-archastro force-pushed the fix/nextest-workspace-covers-members branch from a6337a4 to 89ac725 Compare October 30, 2026 00:48
@calvin-archastro
calvin-archastro merged commit 4fec347 into main Oct 30, 2026
13 checks passed
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.

1 participant