Skip to content

generate-coverage: support crate exclusions / extra cargo args (workspace subsets cannot adopt the ratchet) #351

Description

@leynos

Problem

generate-coverage hard-codes cargo llvm-cov --workspace (see
get_cargo_coverage_cmd in run_rust.py) with no way to exclude
crates or pass extra cargo arguments. Workspaces whose test suite
cannot run as a bare --workspace build cannot adopt the action —
and therefore cannot use with-ratchet, which lives inside it.

Observed live during the CodeScene coverage rollout on
leynos/whitaker (whitaker#274): make test excludes eleven crates
(seven rustc_* proxy shims, the root crate, and three lint crates
whose dylint UI tests need per-target
-C prefer-dynamic -Z force-unstable-if-unmarked RUSTFLAGS). The
workaround is a Makefile coverage target that reuses the test
recipe with a TEST_RUNNER swap to llvm-cov nextest --lcov, plus
the standalone upload-codescene-coverage action — with the ratchet
left off.

Proposal

Add an extra-cargo-args (or exclude) input to generate-coverage
that is appended to the cargo llvm-cov invocation, so
exclusion-heavy workspaces can adopt the action and its ratchet.
Default behaviour unchanged.

Affected consumers

  • leynos/whitaker (confirmed; see whitaker#274 for the workaround)
  • any workspace whose CI-tested crate subset differs from
    --workspace (the mutation-testing rollout catalogued several:
    CI-excluded crates, path-dep fixtures, vendored patch crates).

Related: #335 (language-detection override) — same theme of
detect/command inflexibility blocking adoption.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requestmedium

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions