-
Notifications
You must be signed in to change notification settings - Fork 45
Code coverage: add support for e2e tests #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…rt and upload it to Codecov
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #244 +/- ##
==========================================
+ Coverage 3.40% 7.14% +3.74%
Complexity 4423 4423
==========================================
Files 261 329 +68
Lines 27027 33942 +6915
==========================================
+ Hits 919 2426 +1507
- Misses 26108 31516 +5408
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:
|
|
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. |
What
Implement e2e test coverage collection with Codecov integration.
Why
Including only Unit Tests in coverage reports can be misleading, especially when we focus more on e2e testing than unit testing.
How
This involves several steps and changes in the tooling chain:
babel-plugin-istanbulto webpack, activated viaCOVERAGE_ENABLED=trueenvironment variable and a custom package.json command..nycrcconfiguration and npm scripts to generate Codecov-compatible LCOV reports from the Istanbul output..codecov.ymlsettings with separate flags for e2e (assets/src/) and phpunit (includes/) coverage tracking withcarryforwardenabled. This is necessary because unit and e2e tests run asynchronously and upload coverage independently, and we need Codecov to merge both uploads, "carrying" the other instead of overwriting it.Testing Instructions
npm run test:e2e:coveragelocally to generate coverage./coverage/lcov.infois generated./coverage/index.html