Skip to content

[build] Make xtask coverage repeatable by cleaning llvm-cov artifacts; add opt-out flags#389

Open
Copilot wants to merge 11 commits into
mainfrom
copilot/fix-coverage-xtask-repeatability
Open

[build] Make xtask coverage repeatable by cleaning llvm-cov artifacts; add opt-out flags#389
Copilot wants to merge 11 commits into
mainfrom
copilot/fix-coverage-xtask-repeatability

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

cargo xtask coverage (and precheck --coverage) could fail on reruns due to stale *.profraw data under target/llvm-cov-target. This change makes coverage runs repeatable by default and adds explicit CLI opt-outs where needed.

  • Coverage command behavior

    • xtask coverage now executes cargo llvm-cov clean --workspace before running coverage jobs/reports.
    • This removes stale llvm-cov artifacts that caused subsequent report generation to fail.
  • New CLI opt-out on coverage

    • Added --skip-clean to cargo xtask coverage to bypass the pre-run clean step when desired.
  • Precheck integration

    • Added --skip-clean to cargo xtask precheck.
    • When precheck invokes coverage, it now forwards this flag to the coverage task.
if !self.skip_clean {
    cmd!(sh, "cargo llvm-cov clean --workspace").run()?;
}

Copilot AI requested review from Copilot and removed request for Copilot May 19, 2026 22:04
Copilot AI linked an issue May 19, 2026 that may be closed by this pull request
Copilot AI requested review from Copilot and removed request for Copilot May 19, 2026 22:09
Copilot AI requested review from Copilot and removed request for Copilot May 19, 2026 22:09
Copilot AI changed the title [WIP] Fix coverage xtask to clean artifacts before execution Make xtask coverage repeatable by cleaning llvm-cov artifacts; add opt-out flags May 19, 2026
Copilot AI requested a review from zimmy87 May 19, 2026 22:10
Copilot AI review requested due to automatic review settings May 21, 2026 18:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes cargo xtask coverage (and cargo xtask precheck --coverage) repeatable across reruns by default by cleaning stale cargo-llvm-cov artifacts up front, while adding explicit opt-out flags for cases where preserving artifacts is desired.

Changes:

  • Added a default pre-run cargo llvm-cov clean --workspace step to xtask coverage, gated by a new --skip-clean flag.
  • Added --skip-coverage-clean to xtask precheck and forwarded it to xtask coverage.
  • Added focused unit tests validating the new Coverage clap flag default and opt-out behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
xtask/src/precheck.rs Adds --skip-coverage-clean and forwards it when invoking the coverage xtask.
xtask/src/coverage.rs Adds --skip-clean, runs cargo llvm-cov clean --workspace by default, and includes clap parsing unit tests.

Copilot AI review requested due to automatic review settings May 22, 2026 23:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread xtask/src/precheck.rs
Comment thread xtask/src/coverage.rs
@zimmy87 zimmy87 marked this pull request as ready for review June 3, 2026 00:26
Copilot AI review requested due to automatic review settings June 3, 2026 00:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread xtask/src/precheck.rs
Copy link
Copy Markdown
Contributor

@zimmy87 zimmy87 left a comment

Choose a reason for hiding this comment

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

lgtm

@zimmy87 zimmy87 changed the title Make xtask coverage repeatable by cleaning llvm-cov artifacts; add opt-out flags [build] Make xtask coverage repeatable by cleaning llvm-cov artifacts; add opt-out flags Jun 3, 2026
@zimmy87 zimmy87 requested review from jaygmsft and rajesh-gali June 3, 2026 17:15
Copilot AI review requested due to automatic review settings June 6, 2026 00:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

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.

[bug] coverage xtask isn't repeatable locally

3 participants