-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Support different coverage options in projects #9633
Conversation
Hi @royra! Thank you for your pull request and welcome to our community.We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Codecov Report
@@ Coverage Diff @@
## master #9633 +/- ##
==========================================
+ Coverage 65.09% 65.29% +0.20%
==========================================
Files 287 312 +25
Lines 12144 12226 +82
Branches 3009 3008 -1
==========================================
+ Hits 7905 7983 +78
- Misses 3604 3606 +2
- Partials 635 637 +2
Continue to review full report at Codecov.
|
765ba3c
to
e5b4db1
Compare
Codecov Report
@@ Coverage Diff @@
## master #9633 +/- ##
==========================================
+ Coverage 64.92% 65.13% +0.20%
==========================================
Files 288 313 +25
Lines 12184 12266 +82
Branches 3022 3019 -3
==========================================
+ Hits 7911 7989 +78
- Misses 3635 3637 +2
- Partials 638 640 +2
Continue to review full report at Codecov.
|
Hi, at some point it surely will be, it's just that all maintainers currently have very little time, sorry about that 😐 |
36c1817
to
e30321d
Compare
Moved the following config props from globalConfig to projectConfig: collectCoverageFrom, collectCoverageOnlyFrom, coverageThreshold You can now specify those properties per project. As a side effect, they were removed from the whitelist of watch-able properties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -12,12 +12,9 @@ const DEFAULT_GLOBAL_CONFIG: Config.GlobalConfig = { | |||
changedFilesWithAncestor: false, | |||
changedSince: '', | |||
collectCoverage: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not all the coverage*
options?
@@ -157,8 +157,6 @@ For stability and safety reasons, only part of the global configuration keys can | |||
- [`bail`](configuration.html#bail-number--boolean) | |||
- [`changedSince`](cli.html#--changedsince) | |||
- [`collectCoverage`](configuration.html#collectcoverage-boolean) | |||
- [`collectCoverageFrom`](configuration.html#collectcoveragefrom-array) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think watch plugins should still be able to set these, somehow... Might have to solve watchplugins setting project options before we can land this
@@ -61,6 +61,7 @@ module.exports = { | |||
'/packages/jest-worker/src/__performance_tests__', | |||
'/packages/pretty-format/perf/test.js', | |||
'/e2e/__tests__/iterator-to-null-test.ts', | |||
'/.history', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this directory?
Codecov Report
@@ Coverage Diff @@
## master #9633 +/- ##
==========================================
+ Coverage 64.88% 65.08% +0.20%
==========================================
Files 289 314 +25
Lines 12229 12311 +82
Branches 3030 3027 -3
==========================================
+ Hits 7935 8013 +78
- Misses 3654 3656 +2
- Partials 640 642 +2
Continue to review full report at Codecov.
|
Got pretty far in switching a monorepo to use Jest's multi-project feature and had to stop when I hit these coverage issues. Would love to see this landed 💯 |
Well, any updates on this? We are facing the same issue and will be glad to have this feature. |
This PR needs some love, my coverage report only shows the covered files and nothing about the uncovered files. |
this is a workaround until this PR gets merged: jestjs/jest#9633
this is a workaround until this PR gets merged: jestjs/jest#9633
Can this PR get merged? I'm getting the same issues than @starikcetin. |
How can we get this to move forward and get it merged? |
Nothing has changed since my review in 2020 (and I've honestly lost all context here, so once those comments are resolved (mainly we need to figure out how this interacts with watch plugins)) I'll need to take a new look at this |
This PR is stale because it has been open 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
This PR was closed because it has been stalled for 30 days with no activity. Please open a new PR if the issue is still relevant, linking to this one. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Having the coverage configuration at the global config is not consistent with the way it runs. The globs and paths specified at
collectCoverageFrom
,collectCoverageOnlyFrom
,coverageThreshold
are relative to the projects'<rootDir>
(i.e, do not include the project path), but there is no way to specify options for a specific project.You can create a union of the configuration for all projects and put it in the global config, but this has the side effect of creating ambiguities. For example, consider the following configuration:
This PR moves the following config props from globalConfig to projectConfig:
collectCoverageFrom
,collectCoverageOnlyFrom
,coverageThreshold
Those properties can now be specified per project.
(Of course, you can still specify them at the global config if projects are not used)
As a side effect, they were removed from the whitelist of watch-able properties.
Fixes the following issues:
#9628 (opened by me)
#6998
#7733 (partial solution)
#8722
#8793
#6483
#6143
#5457
#4255
Test plan
Added an e2e test from the case described at #9628.