E2E CI polishing: add sharding and fix coverage accuracy#351
E2E CI polishing: add sharding and fix coverage accuracy#351
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## trunk #351 +/- ##
=============================================
- Coverage 60.07% 49.51% -10.56%
Complexity 4410 4410
=============================================
Files 296 298 +2
Lines 24586 39424 +14838
=============================================
+ Hits 14769 19521 +4752
- Misses 9817 19903 +10086
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Move wait_for_ci under codecov.notify section where it's valid, and add require_ci_to_pass to ensure coverage status waits for all shards to complete before computing final coverage. This should fix the "indirect changes" showing reduced coverage when comparing base to head in PRs with sharded E2E tests.
Instead of each shard uploading coverage separately (causing timing issues with Codecov merging), now: 1. Each shard saves raw coverage data as GitHub artifacts 2. New 'coverage' job waits for all shards to complete 3. Downloads all artifacts and merges them locally using NYC 4. Uploads single combined report to Codecov This ensures complete coverage is always uploaded, fixing the "indirect changes" showing reduced coverage in PR comparisons.
Temporary debugging to diagnose why coverage files aren't being generated in CI despite instrumented code being present.
Coverage files are being saved but upload-artifact can't find them. Adding debug step to list directory contents and include-hidden-files option since .nyc_output starts with a dot.
The include-hidden-files option fixed the artifact upload issue. Coverage is now being collected and merged correctly.
PCOV only reports coverage for files that were loaded during test execution. This caused e2e-php to show ~99% coverage because it only counted files that were actually touched by tests, not all PHP files. Fix by scanning all PHP files in includes/ to build a baseline before merging PCOV data. Files not covered by PCOV are now included with 0% coverage, giving accurate totals. Before: 99.88% (only loaded files counted) After: ~36% (all 210 PHP files in includes/ counted)
1813224 to
934372c
Compare
Add disable_search: true to Codecov uploads to prevent auto-discovery of raw .php-coverage/*.json files. This ensures only the merged LCOV (which includes the PHP baseline) is uploaded. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Remove the separate merge job. Each shard now: 1. Generates LCOV reports (JS via NYC, PHP via baseline script) 2. Uploads directly to Codecov with disable_search: true Codecov will merge the per-shard uploads automatically. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
What
Follow-up to #343. Improves E2E test CI with sharding and accurate coverage reporting.
Why
E2E tests were slow, and PHP coverage was incorrectly reporting ~99% due to PCOV only tracking files loaded during execution and not including those not loaded.
How
includes/to create a baseline with all executable lines marked as uncovered, then merging actual PCOV data on top. This corrects the e2e-php coverage from an incorrect ~99% introduced in Testing: Add PHP code coverage collection for e2e tests #343 to a more realistic ~36%.disable_search: trueto prevent auto-discovery of raw coverage files, and addingcarryforwardflags to preserve coverage data across runs.Testing instructions