Skip to content

Conversation

@anonrig
Copy link
Member

@anonrig anonrig commented Jan 14, 2026

This pull-request ensures that Rust tests, wd_test and kj_test are generating proper test coverage (and with correct line coverages).

Current state of the test coverage on main branch can be accessed from https://app.codecov.io/gh/cloudflare/workerd

Improvements

Tests done to improve the speed of the test coverage runner:

  • Tested different optimization levels for both deps and actual project.
  • Enabled experimental_split_coverage_postprocessing which had the highest impact on reducing the coverage duration.
  • Experiment with different v8-codegen-opt targets/options.
  • Experiment with different optimization levels

Current Issues

Some ongoing issues with test coverage:

@anonrig anonrig requested review from a team as code owners January 14, 2026 13:50
@codspeed-hq

This comment was marked as off-topic.

@anonrig anonrig force-pushed the yagiz/fix-wd-test-test-coverage branch 2 times, most recently from da41935 to d4b324c Compare January 14, 2026 14:52
@anonrig anonrig requested a review from a team as a code owner January 14, 2026 14:52
@anonrig anonrig force-pushed the yagiz/fix-wd-test-test-coverage branch 22 times, most recently from 3597eca to 9c70d73 Compare January 15, 2026 20:37
@codecov-commenter
Copy link

codecov-commenter commented Jan 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.86%. Comparing base (d19e973) to head (8d45d41).

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5881       +/-   ##
===========================================
- Coverage   68.10%   48.86%   -19.24%     
===========================================
  Files          29      397      +368     
  Lines        2593   105997   +103404     
  Branches       15    17965    +17950     
===========================================
+ Hits         1766    51797    +50031     
- Misses        827    45671    +44844     
- Partials        0     8529     +8529     

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@anonrig anonrig force-pushed the yagiz/fix-wd-test-test-coverage branch from 07c8316 to bc27dfb Compare January 20, 2026 20:51
@anonrig anonrig changed the title fix wd-test test coverage reporting fix kj-test & wd-test test coverage reporting Jan 20, 2026
@anonrig anonrig force-pushed the yagiz/fix-wd-test-test-coverage branch from bc27dfb to 1d9a143 Compare January 20, 2026 20:57
@anonrig anonrig requested a review from mikea January 20, 2026 21:03
@anonrig anonrig marked this pull request as ready for review January 20, 2026 21:03
@anonrig anonrig force-pushed the yagiz/fix-wd-test-test-coverage branch from 85a4d0a to c69da44 Compare January 20, 2026 22:04
Copy link
Contributor

@fhanau fhanau left a comment

Choose a reason for hiding this comment

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

Added a couple of suggestions – it's a lot but I hope they'll help with some of the issues you've encountered with coverage.

build:coverage --copt=-fno-lto
build:coverage --linkopt=-fno-lto
# Disable test result caching to ensure fresh coverage data is generated
coverage --nocache_test_results
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I'm not convinced this is needed – with remote_download_minimal you'd expect that coverage data is not downloaded, try using remote_download_toplevel (which is already the default so just ensuring that remote_download_minimal isn't being set anywhere should help). See https://blog.bazel.build/2023/10/06/bwob-in-bazel-7.html for more info on bazel caching modes.

Copy link
Member Author

Choose a reason for hiding this comment

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

Under remote execution (which we don't use, but might still apply), it states that:

Bazel will fail to create coverage information if tests have been cached previously. To work around this, --nocache_test_results can be set specifically for coverage runs, although this of course incurs a heavy cost in terms of test times.


I'm not sure if this still holds or not.

Copy link
Member Author

Choose a reason for hiding this comment

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

@mikea
Copy link
Contributor

mikea commented Jan 21, 2026

+1 on extracting v8 (and pretty much every other external library) from coverage to get speed under control.

I am also quite surprised by the amount of tests excluded. They seem to be incredibly useful? We should try to have the build fast enough to include as much as possible.

@anonrig anonrig force-pushed the yagiz/fix-wd-test-test-coverage branch from 17f504e to eeca57f Compare January 21, 2026 18:34
@anonrig
Copy link
Member Author

anonrig commented Jan 21, 2026

Rebased and force pushed.

@anonrig
Copy link
Member Author

anonrig commented Jan 21, 2026

Temporarily removed main branch requirement of coverage CI.

@anonrig anonrig force-pushed the yagiz/fix-wd-test-test-coverage branch from eeca57f to ef22439 Compare January 21, 2026 19:44
@anonrig anonrig requested review from fhanau and mikea January 21, 2026 19:47
@anonrig anonrig force-pushed the yagiz/fix-wd-test-test-coverage branch 6 times, most recently from 43fbbf4 to fc00be3 Compare January 21, 2026 22:07
@anonrig
Copy link
Member Author

anonrig commented Jan 21, 2026

Marking it as draft for now. While reverting the wd_test changes the coverage started failing again. Unfortunately, custom rule doesn't play well with coverage and we need sh_test in order to generate coverage reports correctly. I'll try to find a common ground.

@anonrig anonrig marked this pull request as draft January 21, 2026 22:29
@anonrig anonrig force-pushed the yagiz/fix-wd-test-test-coverage branch from fc00be3 to 3229340 Compare January 21, 2026 22:33
@anonrig anonrig force-pushed the yagiz/fix-wd-test-test-coverage branch from 3229340 to 8d45d41 Compare January 21, 2026 22:35
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.

4 participants