Skip to content

Report Rust test coverage to Codecov - #2636

Open
somewhatabstract wants to merge 6 commits into
claude/jolly-galileo-72zesp-rust-checksumfrom
claude/jolly-galileo-72zesp-rust-coverage
Open

somewhatabstract wants to merge 6 commits into
claude/jolly-galileo-72zesp-rust-checksumfrom
claude/jolly-galileo-72zesp-rust-coverage

Conversation

@somewhatabstract

Copy link
Copy Markdown
Owner

Summary
Measures Rust test coverage in CI and uploads it to Codecov, reported separately from TypeScript so neither language's numbers can hide the other's.

Stack

Issues
Closes #2627. Part of #2614 (Phase 1), which is under #2524.

Details

  • .github/workflows/rust.yml: new coverage job on Ubuntu:
    • adds the llvm-tools-preview component, which only this job needs
    • installs a prebuilt cargo-llvm-cov with taiki-e/install-action, which is much faster than cargo install
    • runs cargo llvm-cov --workspace --locked --codecov --output-path codecov.json
    • uploads with flags: rust
    • each step has a comment, like the rest of the workflow
  • .github/workflows/nodejs.yml: the Jest upload now sets flags: typescript.
  • .codecov.yml:
    • The single project: default status is replaced by one status per flag (typescript, rust). Each keeps the previous default target of auto, which fails if coverage goes down.
    • flags maps typescript to src/ and rust to rust/, both with carryforward: true. The Rust workflow only runs when Rust code changes, so on a TypeScript-only PR the rust flag reuses its last report instead of showing as missing, and the same in reverse.
  • An empty changeset, since the published package doesn't change.

Checked locally
cargo llvm-cov with the checksum code in place:

  • calc_checksum.rs: 100% lines, functions and regions.
  • checksync-cli/src/main.rs: 0%. That's accurate, since it's the empty fn main() {} until Phase 5.

Review notes

  • I couldn't validate .codecov.yml with Codecov's validator, because this container's network proxy blocks it. The first CI run is the real test. Look for separate typescript and rust flags in the Codecov comment.
  • Correction to Rust: report test coverage to Codecov #2627: it said TypeScript would keep "the current 100% target". The existing config actually used default: true, which is an auto target, not a fixed 100%. I kept that behavior. If you want a fixed target: 100% for TypeScript, or later for Rust, it's a one-line change.
  • This is a CI change, so its own run is what proves it works.

Generated by Claude Code

Adds a coverage job to the Rust CI workflow that runs the tests under
cargo-llvm-cov and uploads Codecov JSON with the `rust` flag. The Jest
upload gets the `typescript` flag, and .codecov.yml gives each flag its
own project status plus carryforward, so pull requests that only run one
workflow keep the other language's last report.

Closes #2627.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjLhVH1NnUc7MzCSYLd8Yn
@changeset-bot

changeset-bot Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9119459

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.89%. Comparing base (5252210) to head (9119459).

Additional details and impacted files

Impacted file tree graph

@@                              Coverage Diff                              @@
##           claude/jolly-galileo-72zesp-rust-checksum    #2636      +/-   ##
=============================================================================
- Coverage                                     100.00%   99.89%   -0.11%     
=============================================================================
  Files                                             51       53       +2     
  Lines                                            959      988      +29     
  Branches                                         231      260      +29     
=============================================================================
+ Hits                                             959      987      +28     
- Misses                                             0        1       +1     
Flag Coverage Δ
rust 96.55% <ø> (?)
typescript 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 2 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5252210...9119459. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@somewhatabstract somewhatabstract left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

LGTM

Uses the same SHAs as the repository-wide pinning in #2643, so this
merges cleanly whichever lands first, and covers the coverage job's
taiki-e/install-action and codecov-action, which aren't on main yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjLhVH1NnUc7MzCSYLd8Yn
…jolly-galileo-72zesp-rust-coverage

# Conflicts:
#	.github/workflows/nodejs.yml
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.

Rust: report test coverage to Codecov

2 participants