-
Notifications
You must be signed in to change notification settings - Fork 72
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
Fix empty coverage report #324
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## next #324 +/- ##
==========================================
+ Coverage 75.30% 76.63% +1.32%
==========================================
Files 8 11 +3
Lines 166 184 +18
Branches 35 39 +4
==========================================
+ Hits 125 141 +16
- Misses 41 43 +2 ☔ View full report in Codecov by Sentry. |
Thanks @bryanjtc ! Can you also check the following line test-runner/src/test-storybook.ts Line 74 in 2aa338d
|
Move the condition for collecting coverage to only allow it when the environment variable STORYBOOK_COLLECT_COVERAGE is true and JEST_SHARD is not true.
@yannbf Done |
Hey @bryanjtc thanks! Thinking more about it, it seems like the logic is not correct. The recipe you wrote tells people to:
And the logic in this PR doesn't run the coverage code when shard mode is on, so in the end you don't get the
let me know if that aligns with what you had in mind! |
@yannbf yeah, it's ok |
🚀 PR was released in |
Fixes: #313
This pull request introduces a code change aimed at resolving the issue of an empty coverage report in the project. The previous code checked whether the
STORYBOOK_COLLECT_COVERAGE
environment variable was not equal to'true'
before calling thereportCoverage()
function. However, this approach did not cover all necessary conditions to ensure an accurate coverage report.The new code includes an additional check to verify that both the
STORYBOOK_COLLECT_COVERAGE
environment variable is equal to 'true' and theJEST_SHARD
environment variable is not equal to 'true'. This ensures that coverage reporting occurs only when both conditions are met, providing a more accurate assessment of test coverage.By adding the
process.env.JEST_SHARD !== 'true'
condition, we prevent coverage reporting during Jest sharding, which helps prevent conflicts and inaccuracies in the coverage data.📦 Published PR as canary version:
0.11.1--canary.324.e7f9b28.0
✨ Test out this PR locally via:
Version
Published prerelease version:
v0.11.1-next.0
Changelog
🐛 Bug Fix
Authors: 3