Skip to content
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: nyc command with shard option #257

Merged
merged 6 commits into from
Jun 17, 2023
Merged

fix: nyc command with shard option #257

merged 6 commits into from
Jun 17, 2023

Conversation

bryanjtc
Copy link
Member

@bryanjtc bryanjtc commented Feb 1, 2023

Fixes: #256
Added a new environment variable to check if the shard cli option is used to run the nyc command conditionally.

📦 Published PR as canary version: 0.10.1--canary.257.aa7a0c9.0

✨ Test out this PR locally via:

npm install @storybook/test-runner@0.10.1--canary.257.aa7a0c9.0
# or 
yarn add @storybook/test-runner@0.10.1--canary.257.aa7a0c9.0

Version

Published prerelease version: v0.11.0-future.4

Changelog

🚀 Enhancement

🐛 Bug Fix

Authors: 5

@codecov-commenter
Copy link

codecov-commenter commented Feb 1, 2023

Codecov Report

Patch coverage has no change and project coverage change: -1.33 ⚠️

Comparison is base (63fd8ae) 76.63% compared to head (aa7a0c9) 75.30%.

Additional details and impacted files
@@            Coverage Diff             @@
##           future     #257      +/-   ##
==========================================
- Coverage   76.63%   75.30%   -1.33%     
==========================================
  Files          11        8       -3     
  Lines         184      166      -18     
  Branches       39       35       -4     
==========================================
- Hits          141      125      -16     
+ Misses         43       41       -2     

see 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@bryanjtc bryanjtc requested a review from yannbf February 1, 2023 15:09
@yannbf
Copy link
Member

yannbf commented Feb 1, 2023

Hey @bryanjtc thank you so much for this contribution (and the many others)!

Does this mean that for developers using shard option, they should figure out how to do the reporting themselves?

@bryanjtc
Copy link
Member Author

bryanjtc commented Feb 1, 2023

Hey @bryanjtc thank you so much for this contribution (and the many others)!

Does this mean that for developers using shard option, they should figure out how to do the reporting themselves?

Yes. Especifically the coverage.json file for each ci job should be renamed using the shardIndex value.
Then a new ci job has to merge this coverage.json files using the nyc merge command to output the complete report.

@yannbf
Copy link
Member

yannbf commented Feb 1, 2023

Could you assist in writing some sort of recipe? Also there should be extra changes in reportCoverage I assume? To have the renaming bit right

@bryanjtc
Copy link
Member Author

bryanjtc commented Feb 1, 2023

Could you assist in writing some sort of recipe? Also there should be extra changes in reportCoverage I assume? To have the renaming bit right

yeah

@bryanjtc
Copy link
Member Author

bryanjtc commented Feb 1, 2023

@yannbf Done. The renaming part should be done in the yml ci file. I added a recipe for github, gitlab and circle ci.

README.md Outdated Show resolved Hide resolved
Co-authored-by: Hirotaka Miyagi <31152321+MH4GF@users.noreply.github.com>
@yannbf yannbf changed the base branch from next to future June 17, 2023 08:57
@yannbf yannbf added the patch Increment the patch version when merged label Jun 17, 2023
@yannbf
Copy link
Member

yannbf commented Jun 17, 2023

You're the best @bryanjtc, thanks a lot for this contribution! There were some small issues regarding watch mode so I added a few fixes as well.

@yannbf yannbf added the pick This should be cherry-picked to the main branch label Jun 17, 2023
@yannbf yannbf merged commit 014df0c into future Jun 17, 2023
@yannbf yannbf deleted the shard-coverage branch June 17, 2023 19:12
@yannbf yannbf mentioned this pull request Jun 20, 2023
@github-actions
Copy link

🚀 PR was released in v0.11.0 🚀

MH4GF added a commit to MH4GF/test-runner that referenced this pull request Jun 21, 2023
Corrected because the content of this comment was not reflected in other parts of the usage.

storybookjs#257 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged pick This should be cherry-picked to the main branch released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Using the shard and coverage cli options together shouldn't output instanbul report
4 participants