-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Repo: add a test-coverage script to simplify test flags #10607
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
Comments
At that point wouldn't we be just as well off keeping one |
Also - this assumes that we'd simply replace
so, personally, my instinct is to let it be for now, until we know for certain what are needs are regarding #7112 (at which point we can certainly do this!). I'm not the expert on our repo tooling though so maybe another @typescript-eslint/triage-team member has an opinion? |
The whole point before this change was so packages could opt in to coverage if they want to. Rather than ci enforcing it across all of them So where would you do that if you're passing a flag? It has to go in each individual script unless you're prepared to turn it on for all of them, or have two matrices in the workflow Whether you run one test runner or two doesn't really matter, you still need a way to opt in to coverage per package (re your other point) The script is passing a duplicate flag right now and gets away with it by chance because jest reads the last one I disagree that we should leave it be because of this. It's prep for moving to vitest and will inevitably have to happen if we do such a move (whichever approach we go with, it isn't what's there now). Nobody wants a monolithic "move to vitest" pr either, so here we are with a standalone change |
Sounds good! I'd also invite @aryaemami59 to chime in here and on the PR (#10582) since it seems they've given this thought as well (coming from #7112) |
@kirkwaiblinger Honestly I think a test-coverage script would be better and will probably cause less issues as it's more explicit and can be used more reliably locally. |
Agreed, let's go with scripts. Env vars tend to get convoluted. |
Suggestion
This is explained already in #10582 but the summary is as follows:
We currently enable coverage in our
test
scripts and passcoverage=false
when we want to disable itThis results in
jest --coverage --coverage=false
once everything is expandedThe duplicate flag works in jest but doesn't seem right. More importantly, it does not work with vitest (which we may soon want to move to).
We can solve this by having two scripts in each package:
test
with coverage disabledtest-coverage
with coverage enabled (if the package supports coverage)CI can then call
test-coverage
instead of manually passing flag overridesAdditional Info
No response
The text was updated successfully, but these errors were encountered: