Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
here's my take on fixing coverage :)
This seems to be the minimal fix for what appears to be two separate problems:
--hook-run-in-context
appears to be the key here, so I assume something changed between howjest
and/oryarn
create subprocesses and/or hownyc
hooks into themyarn coverage
andyarn unit:ci
fromyarn
tonpm run
.I also got rid of
unit-cli:ci
andunit-core:ci
, since these were only called within npm scripts, and we can simplify by havingyarn unit:ci
pass in those extra arguments instead.(my original approach was to stop using
nyc
to generate coverage and just usejest
for that directly. We could still do this, but it turns out merging multiplejest
coverage reports with existing lcov tools is a pain, so I vote leaving that for another day since we still neednyc
for smoke coverage anyways)(comment from below)
added another commit
renamed
unit:silentcoverage
tounit:cicoverage
(andsmoke:cicoverage
) as that's what it really means (making an lcov file for uploading to coveralls/codecov). Removed the--silent
which was really just for silencing the"text"
reporter...but we don't need to run the"text"
reporter, so just removed that :) Replaced with the three line"text-summary"
reporter, which seems fine in the CI outputunit:coverage
can now just callunit:cicoverage
(same withcoverage:smoke
) so we don't need thenyc
logic duplicated, and just add an html output for local devadded
--all
tonyc
for a slightly more honest code coverage number by covering all files (excluding the obvious tests, etc) inlighthouse-core/
,lighthouse-cli/
, andlighthouse-viewer/
. If a file had no tests, it wouldn't show up in the coverage and bring the number down, which seems like a bad policy :)This does bring our coverage just below 90%, but it's not too bad. Majority of the change is in
connections
(extension.js
andraw.js
have no coverage...it's possible we just want to ignore these) andlighthouse-viewer/
(which has basically no unit tests).