Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

@joyeecheung
Copy link
Member

commented Jan 8, 2019

  • 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.
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
process: refactor coverage setup during bootstrap
- 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

This comment has been minimized.

@bcoe

This comment has been minimized.

Copy link
Member

commented Jan 8, 2019

@joyeecheung one comment, if we can prove out that #25157 is working, we should be able to get rid of write-coverage.js entirely.

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__) {

This comment has been minimized.

Copy link
@bcoe

bcoe Jan 8, 2019

Member

similarly, we should soon be in a position to drop this code. CC: @mhdawson

This comment has been minimized.

Copy link
@joyeecheung

joyeecheung Jan 9, 2019

Author Member

Until that actually happens, I guess a TODO would be enough?

lib/internal/bootstrap/node.js Outdated Show resolved Hide resolved
@joyeecheung

This comment has been minimized.

Copy link
Member Author

commented Jan 9, 2019

@bcoe @cjihrig Thanks for the reviews, updated.
CI: https://ci.nodejs.org/job/node-test-pull-request/20021/

Also a screenshot from a local run of make coverage (it's a bit lower than the one from the website because I didn't run the dns tests that require internet access)

screen shot 2019-01-09 at 10 29 32 pm

@bcoe bcoe referenced this pull request Jan 9, 2019
5 of 5 tasks complete
@joyeecheung

This comment has been minimized.

Copy link
Member Author

commented Jan 10, 2019

@bcoe
bcoe approved these changes Jan 12, 2019
Copy link
Member

left a comment

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.

@joyeecheung

This comment has been minimized.

Copy link
Member Author

commented Jan 16, 2019

Landed in b367ab2

joyeecheung added a commit that referenced this pull request Jan 16, 2019
process: refactor coverage setup during bootstrap
- 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>
BridgeAR added a commit that referenced this pull request Jan 16, 2019
process: refactor coverage setup during bootstrap
- 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>
@BridgeAR BridgeAR referenced this pull request Jan 16, 2019
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 16, 2019
process: refactor coverage setup during bootstrap
- 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>
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 17, 2019
process: refactor coverage setup during bootstrap
- 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>
@MylesBorins MylesBorins referenced this pull request Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.