-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
process: refactor coverage setup during bootstrap #25398
Conversation
- Renamed `internal/process/write-coverage.js` to `internal/coverage-gen/with_instrumentation.js`, `internal/process/coverage.js` to `internal/coverage-gen/with_profiler.js` to distinguish the two better and added comments. - Separate the coverage directory setup and the connection setup, moves the directory setup into `node.js` and closer to the exit hooks because that's where it's used. - Moves the `process.reallyExit` overwrite and `process.on('exit')` hooks setup into bootstrap/node.js for clarity, and move them to a later stage of bootstrap since they do not have to happen that early.
@joyeecheung one comment, if we can prove out that #25157 is working, we should be able to get rid of I'd also love to make sure that we run a full coverage report with this refactor before we land, to make sure coverage continues to be enabled early enough to collect data for key internal libraries. |
// Core coverage generation using nyc instrumented lib/ files: | ||
// see `make coverage-build`. | ||
// This does not affect user land. | ||
if (global.__coverage__) { |
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.
similarly, we should soon be in a position to drop this code. CC: @mhdawson
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.
Until that actually happens, I guess a TODO would be enough?
@bcoe @cjihrig Thanks for the reviews, updated. Also a screenshot from a local run of |
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.
this is looking good to me, we'll definitely want to re-run the native test suite (demonstrated in #25157) if this lands ahead of time.
I'm excite that we'll probably soon be able to get rid of write-coverage.js
.
Landed in b367ab2 |
- Renamed `internal/process/write-coverage.js` to `internal/coverage-gen/with_instrumentation.js`, `internal/process/coverage.js` to `internal/coverage-gen/with_profiler.js` to distinguish the two better and added comments. - Separate the coverage directory setup and the connection setup, moves the directory setup into `node.js` and closer to the exit hooks because that's where it's used. - Moves the `process.reallyExit` overwrite and `process.on('exit')` hooks setup into bootstrap/node.js for clarity, and move them to a later stage of bootstrap since they do not have to happen that early. PR-URL: #25398 Reviewed-By: Ben Coe <[email protected]>
- Renamed `internal/process/write-coverage.js` to `internal/coverage-gen/with_instrumentation.js`, `internal/process/coverage.js` to `internal/coverage-gen/with_profiler.js` to distinguish the two better and added comments. - Separate the coverage directory setup and the connection setup, moves the directory setup into `node.js` and closer to the exit hooks because that's where it's used. - Moves the `process.reallyExit` overwrite and `process.on('exit')` hooks setup into bootstrap/node.js for clarity, and move them to a later stage of bootstrap since they do not have to happen that early. PR-URL: #25398 Reviewed-By: Ben Coe <[email protected]>
- Renamed `internal/process/write-coverage.js` to `internal/coverage-gen/with_instrumentation.js`, `internal/process/coverage.js` to `internal/coverage-gen/with_profiler.js` to distinguish the two better and added comments. - Separate the coverage directory setup and the connection setup, moves the directory setup into `node.js` and closer to the exit hooks because that's where it's used. - Moves the `process.reallyExit` overwrite and `process.on('exit')` hooks setup into bootstrap/node.js for clarity, and move them to a later stage of bootstrap since they do not have to happen that early. PR-URL: nodejs#25398 Reviewed-By: Ben Coe <[email protected]>
- Renamed `internal/process/write-coverage.js` to `internal/coverage-gen/with_instrumentation.js`, `internal/process/coverage.js` to `internal/coverage-gen/with_profiler.js` to distinguish the two better and added comments. - Separate the coverage directory setup and the connection setup, moves the directory setup into `node.js` and closer to the exit hooks because that's where it's used. - Moves the `process.reallyExit` overwrite and `process.on('exit')` hooks setup into bootstrap/node.js for clarity, and move them to a later stage of bootstrap since they do not have to happen that early. PR-URL: nodejs#25398 Reviewed-By: Ben Coe <[email protected]>
internal/process/write-coverage.js
tointernal/coverage-gen/with_instrumentation.js
,internal/process/coverage.js
tointernal/coverage-gen/with_profiler.js
to distinguishthe two better and added comments.
setup, moves the directory setup into
node.js
andcloser to the exit hooks because that's where it's used.
process.reallyExit
overwrite andprocess.on('exit')
hooks setup into bootstrap/node.jsfor clarity, and move them to a later stage of
bootstrap since they do not have to happen that early.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes