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

feat: add processinfo index, add externalId #1055

Merged
merged 6 commits into from Apr 6, 2019

Conversation

isaacs
Copy link
Collaborator

@isaacs isaacs commented Apr 4, 2019

THIS IS A WIP COMMIT FOR REVIEW ONLY, DO NOT MERGE

  • [ ] docs
  • tests

feat: add processinfo index, add externalId

If a NYC_PROCESSINFO_EXTERNAL_ID environment variable is set, then it is
saved in the processinfo as externalId.

BREAKING CHANGE: This adds a file named 'index.json' to the
.nyc_output/processinfo directory, which has a different format from the
other files in this dir.

Furthermore, when this file is generated, some additional helpful
metadata is memoized to the processinfo json files, to minimize the cost
of repeated generation. (This isn't necessarily a breaking change, but
it is an update to the de facto schema for those files.)

As soon as possible, index generation and process tree display should be
migrated out to a new 'istanbul-lib-processinfo' library.

This opens the door to add features in the v14 release family to improve
support for partial/resumed test runs and file watching.

  • When a process is run with --clean=false and a previously seen
    externalId, clear away all the coverage files in the set for that
    externalId.
  • When a file is changed, a test runner can use the index to determine
    which tests (by externalId) ought to be re-run.

@isaacs isaacs force-pushed the processinfo-index branch 3 times, most recently from e92d40e to d5a114c Compare April 5, 2019 04:29
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Show resolved Hide resolved
index.js Show resolved Hide resolved
lib/process.js Outdated Show resolved Hide resolved
@isaacs isaacs force-pushed the processinfo-index branch 2 times, most recently from e4bfd9f to 2ffe591 Compare April 6, 2019 01:53
@coveralls
Copy link

coveralls commented Apr 6, 2019

Coverage Status

Coverage decreased (-0.2%) to 96.154% when pulling 967bcbf on isaacs:processinfo-index into 32f75b0 on istanbuljs:master.

Docs and tests still TK.  Future commit message follows.

---

feat: add processinfo index, add externalId

If a NYC_PROCESSINFO_EXTERNAL_ID environment variable is set, then it is
saved in the processinfo as `externalId`.

BREAKING CHANGE: This adds a file named 'index.json' to the
.nyc_output/processinfo directory, which has a different format from the
other files in this dir.

Furthermore, when this file is generated, some additional helpful
metadata is memoized to the processinfo json files, to minimize the cost
of repeated generation.  (This isn't necessarily a breaking change, but
it is an update to the de facto schema for those files.)

As soon as possible, index generation and process tree display should be
migrated out to a new 'istanbul-lib-processinfo' library.

This opens the door to add features in the v14 release family to improve
support for partial/resumed test runs and file watching.

- When a process is run with --clean=false and a previously seen
  externalId, clear away all the coverage files in the set for that
  externalId.
- When a file is changed, a test runner can use the index to determine
  which tests (by externalId) ought to be re-run.
- Adds a NYC_PROCESS_ID to environment
- Adds `parent` to processInfo object, a uuid referring to parent.
- Rebase onto processinfo-numeric-pids branch
- Avoid re-writing the processinfo/{uuid}.json files

Next:

- Update process tree output to rely on process index instead of
  duplicating effort.
Also, remove some unnecessary fields from process infos
lib/process.js Show resolved Hide resolved
index.js Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
Copy link
Member

@coreyfarrell coreyfarrell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with what we have. I'm not sure I want us to document it yet, or if we do document that it is experimental. I think once we have istanbul-lib-processinfo we can document it from that module.

@isaacs
Copy link
Collaborator Author

isaacs commented Apr 6, 2019

I think keeping it out of the docs is sensible for now. I've been taking notes in my early sketch of istanbul-lib-processinfo anyway, but I'll probably put that off until tap v13 is finished, since I'll be able to test out some of the concepts ad hoc and see what works. There may be some additional tweaks necessary, but I don't think the data structure needs to change from what it is right now, so we can avoid any semver major changes in the near future.

Would you like to squash, or shall I do the honors?

@coreyfarrell
Copy link
Member

Would you like to squash, or shall I do the honors?

Lets give it a couple days to see if @addaleax has any comments since she originally implemented the processinfo functionality. If we don't get any objections I'll squash and merge. Probably do a second pre-release of nyc 14 by the middle of the week.

Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the ping! It’s been a while since I’ve worked on this, but as far as I am able to review it this is good to go :)

@coreyfarrell coreyfarrell merged commit 8dcf180 into istanbuljs:master Apr 6, 2019
@isaacs isaacs deleted the processinfo-index branch April 7, 2019 00:33
@coreyfarrell coreyfarrell mentioned this pull request Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants