Uh oh!
There was an error while loading. Please reload this page.
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
commented
Jan 8, 2019
bcoe
commented
Jan 8, 2019
@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.
similarly, we should soon be in a position to drop this code. CC: @mhdawson
There was a problem hiding this comment.
Until that actually happens, I guess a TODO would be enough?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
joyeecheung
commented
Jan 9, 2019
@bcoe@cjihrig Thanks for the reviews, updated. Also a screenshot from a local run of |
joyeecheung
commented
Jan 10, 2019
joyeecheung
commented
Jan 16, 2019
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 <bencoe@gmail.com>- 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 <bencoe@gmail.com>- 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 <bencoe@gmail.com>- 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 <bencoe@gmail.com>
internal/process/write-coverage.jstointernal/coverage-gen/with_instrumentation.js,internal/process/coverage.jstointernal/coverage-gen/with_profiler.jsto distinguishthe two better and added comments.
setup, moves the directory setup into
node.jsandcloser to the exit hooks because that's where it's used.
process.reallyExitoverwrite 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