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
chore: update how we track coverage during unit tests #5779
Conversation
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.
LGTM % comments
68347e1
to
54ad4cc
Compare
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) ℹ️ Googlers: Go here for more info. |
Added the CLA label as the two commiters are myself + Mathias :). I think the rebase I did against master threw the googlebot off. |
The old method of tracking coverage was causing issues. If a test failed on CI, that test's failure would be lost because the test failing would in turn cause the coverage to fail, but the `process.exit(1)` in the coverage code caused Mocha to not output anything useful. Instead the coverage checker now: * tracks the coverage in memory in a Map (this hasn't changed) * after all tests, writes that to disk in test/coverage.json (which is gitignored) * we then run a single Mocha test that asserts every method was called. This means if the test run fails, the build will fail and give the error about that test run, and that output won't be lost when the coverage then fails too.
Co-Authored-By: Mathias Bynens <mathias@qiwi.be>
54ad4cc
to
dda3439
Compare
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) ℹ️ Googlers: Go here for more info. |
The test command referenced the task `npm run coverage`, which was renamed to `unit-with-coverage` in puppeteer#5779
The `test` command referenced the task `npm run coverage`, which was renamed to `unit-with-coverage` in #5779.
The old method of tracking coverage was causing issues. If a test failed
on CI, that test's failure would be lost because the test failing would
in turn cause the coverage to fail, but the
process.exit(1)
in thecoverage code caused Mocha to not output anything useful.
Instead the coverage checker now:
gitignored)
This means if the test run fails, the build will fail and give the error
about that test run, and that output won't be lost when the coverage
then fails too.