-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
report all files in CI test coverage (#10560)
refs: #10559 ## Description #10556 made coverage reports include all files, but only in package reports. This makes CI's report across all packages also use `--all`. While working on this I wanted to be able to document all the kinks I ran into so I also consolidated this capability in a single script with explanatory comments. ### Security Considerations none ### Scaling Considerations none ### Documentation Considerations includes docs now ### Testing Considerations The `coverage` job runs in the after-merge workflow but only on `push` so I can't trigger it in CI. Instead I've run the script locally. When it reaches cosmic-swingset it dies on `./bin/rosetta-cli` but I just skipped that package and confirmed the generated report is as expected. ### Upgrade Considerations n/a
- Loading branch information
Showing
4 changed files
with
20 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
# CI artifact export expects the files to be under `coverage` (same for /html below) | ||
export NODE_V8_COVERAGE="$PWD/coverage/tmp" | ||
|
||
# clear out old coverage. c8 usually does this but we have to clean=false below so it accumulates across packages | ||
rm -rf "$NODE_V8_COVERAGE" | ||
mkdir -p "$NODE_V8_COVERAGE" | ||
|
||
# the package test:c8 commands will include this | ||
export C8_OPTIONS="--clean=false" | ||
|
||
# XXX uses lerna when `yarn workspaces run` should work, but in v1 it always bails on missing script | ||
yarn lerna run test:c8 | ||
|
||
# report over all src and tools files, not just the ones that were loaded during tests | ||
yarn c8 report --all --include 'packages/*/{src,tools}' --reporter=html-spa --reports-dir=coverage/html |