Skip to content

[MOD-13858] Add branch-aware C and Rust coverage for unit and flow tests - #11543

Merged
oshadmi merged 10 commits into
masterfrom
mod-13858-branch-coverage
Oct 13, 2026
Merged

oshadmi merged 10 commits into
masterfrom
mod-13858-branch-coverage

Conversation

@oshadmi

@oshadmi oshadmi commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Describe the changes in the pull request

Coverage reporting was not consistently branch-aware across RediSearch C and Rust, and Rust code exercised through embedded flow tests was not included in the flow coverage uploads.

This PR:

  1. Enables branch-aware coverage for C and Rust unit tests.
  2. Instruments Rust embedded in redisearch.so during flow tests.
  3. Uploads C and Rust reports for standalone and coordinator flow tests.
  4. Publishes covered/total branch counts in each coverage CI job.
  5. Makes partially covered conditions visible instead of treating an executed source line as fully covered.

Measured outcome

The largest coverage-scope improvement is in the flow report, primarily because Rust flow coverage is now included:

Codecov flow metric Before After
Files measured 255 626
Lines measured 45,533 76,773
Fully covered lines 38,485 55,648
Partial lines 0 4,091
Codecov coverage 84.52% 72.48%

The project-wide Codecov result changed as follows:

Codecov project metric Before After
Files measured 660 680
Lines measured 86,911 87,952
Fully covered lines 73,120 73,420
Completely missed lines 13,417 10,894
Partial lines 374 3,638
Codecov coverage 84.13% 83.47%

The lower percentage is not evidence that fewer tests ran. The measured scope expanded, particularly for Rust flow coverage, and lines with untested conditional paths are now classified as partial rather than fully covered. Fully covered lines increased by 300, while completely missed lines decreased by 2,523.

This run established the first consistent branch-coverage baselines:

Suite Branch coverage
C unit 31.49%
Rust unit 79.63%
C standalone flow 54.72%
Rust standalone flow 61.40%
C coordinator flow, per shard 51.22–52.61%
Rust coordinator flow, per shard 44.27–51.10%

There are no equivalent pre-PR branch percentages because branch data was not generated consistently across these suites. This PR establishes measurement and visibility; it does not introduce a coverage threshold or require 100% coverage.

C coverage uses pinned LCOV 2.5 to capture and filter branch-aware unit and flow reports. Rust unit coverage uses cargo llvm-cov with nightly branch instrumentation, while Rust embedded in redisearch.so is instrumented during coverage builds, linked with LLVM's profiling runtime, and exported after flow tests. CI uploads all C and Rust reports to Codecov.

Coverage remains opt-in and keeps its existing Ubuntu x86_64 CI scope. Ordinary make bootstrap retains COV=0; make bootstrap COV=1 verifies LCOV >= 2 and uses the checksum-pinned LCOV 2.5 source fallback when the distribution version is insufficient. Rust coverage tooling follows the repository's existing eager bootstrap model until a dedicated bootstrap-tests path is available, and coverage CI installs its LCOV runtime prerequisites in the coverage-only setup. Coverage builds remain test-only, so the existing COV=1/LTO=1 incompatibility is rejected explicitly.

Related earlier branch-coverage work: #5747 by @nafraf.

Which additional issues this PR fixes

  1. MOD-13858

Main objects this PR modified

  1. Coverage build and test path — C and Rust branch instrumentation and report generation.
  2. Unit and flow CI workflows — pinned LCOV setup and complete Codecov uploads.
  3. Rust nextest coverage profile — execution settings for instrumented tests.

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

Release Notes

  • This PR requires release notes
  • This PR does not require release notes

Validation

  • Stable release build passes without coverage instrumentation.
  • Rust coverage archive execution passes all 3,466 tests and emits branch data.
  • C unit and standalone flow coverage runs emit branch-aware reports.
  • Bootstrap dry-run validation covers default and COV=1 plans; focused unit tests cover LCOV and Cobertura summary parsing.

@oshadmi
oshadmi marked this pull request as ready for review September 24, 2026 08:38
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T08:26:41.729514Z a5bc7bc New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@oshadmi
oshadmi marked this pull request as draft September 24, 2026 08:38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 025b21dd30

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread build.sh Resolved
@codecov

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.47%. Comparing base (af1e576) to head (a5bc7bc).
⚠️ Report is 26 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11543      +/-   ##
==========================================
- Coverage   84.13%   83.47%   -0.66%     
==========================================
  Files         660      680      +20     
  Lines       86911    87952    +1041     
  Branches    41378    11449   -29929     
==========================================
+ Hits        73120    73420     +300     
+ Misses      13417    10894    -2523     
- Partials      374     3638    +3264     
Flag Coverage Δ
flow 72.48% <ø> (-12.04%) ⬇️
unit 57.13% <ø> (-2.96%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ed49aab6ed

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .install/install_lcov.sh Resolved
@oshadmi
oshadmi force-pushed the mod-13858-branch-coverage branch from 34cbd76 to f89532b Compare October 8, 2026 13:11
@github-actions github-actions Bot added size:L and removed size:M labels Oct 8, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f89532b392

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/scripts/coverage_summary.py Resolved
@oshadmi
oshadmi requested a review from nafraf October 9, 2026 10:29
nafraf
nafraf previously approved these changes Oct 9, 2026
Comment thread build.sh Resolved
nafraf
nafraf previously approved these changes Oct 11, 2026
@oshadmi
oshadmi added this pull request to the merge queue Oct 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 12, 2026
@sonarqubecloud

Copy link
Copy Markdown

@oshadmi
oshadmi requested a review from nafraf October 13, 2026 09:39
@oshadmi
oshadmi added this pull request to the merge queue Oct 13, 2026
Merged via the queue into master with commit 542ec98 Oct 13, 2026
62 checks passed
@oshadmi
oshadmi deleted the mod-13858-branch-coverage branch October 13, 2026 15:19
@oshadmi oshadmi changed the title [MOD-13858] Add C and Rust branch coverage [MOD-13858] Add branch-aware C and Rust coverage for unit and flow tests Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants