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

@joyeecheung joyeecheung 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

- 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.
@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. process Issues and PRs related to the process subsystem. labels Jan 8, 2019
@joyeecheung
Copy link
Member Author

@bcoe
Copy link
Contributor

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 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__) {
Copy link
Contributor

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

Copy link
Member Author

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?

lib/internal/bootstrap/node.js Outdated Show resolved Hide resolved
@joyeecheung
Copy link
Member Author

@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 mentioned this pull request Jan 9, 2019
5 tasks
@joyeecheung
Copy link
Member Author

Copy link
Contributor

@bcoe bcoe left a 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.

@joyeecheung
Copy link
Member Author

Landed in b367ab2

joyeecheung added a commit that referenced this pull request Jan 16, 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.

PR-URL: #25398
Reviewed-By: Ben Coe <bencoe@gmail.com>
BridgeAR pushed a commit that referenced this pull request Jan 16, 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.

PR-URL: #25398
Reviewed-By: Ben Coe <bencoe@gmail.com>
@BridgeAR BridgeAR mentioned this pull request Jan 16, 2019
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Jan 16, 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.

PR-URL: nodejs#25398
Reviewed-By: Ben Coe <bencoe@gmail.com>
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Jan 17, 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.

PR-URL: nodejs#25398
Reviewed-By: Ben Coe <bencoe@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. process Issues and PRs related to the process subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants