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

test: keep coverage reports after coverage-clean #15470

Closed

Conversation

apapirovski
Copy link
Member

@apapirovski apapirovski commented Sep 19, 2017

This PR adds the coverage folder to .gitignore and removes it from make coverage-clean. I feel like this is a useful change for anyone working on tests. It's nice to be able to keep the coverage reports to reference while writing tests without keeping the rest of the coverage instrumentation (which makes tests slow) and also without having to manually rename the coverage dir (and then avoid adding it to commits).

Checklist
Affected core subsystem(s)

test, build

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. meta Issues and PRs related to the general management of the project. labels Sep 19, 2017
@ssbrewster
Copy link
Contributor

ssbrewster commented Sep 19, 2017

That reminds me I need to raise a PR for this but i will take out the conditional on removing the coverage/ dir because it's covered by this PR. I'm also not sure about spinning up another make process.

I was waiting for input on #15214 but that's been long enough now.

@TimothyGu
Copy link
Member

Hmm, I'd rather have a separate target for "restore but doesn't actually clean". make clean removes the built binaries as well. So something like:

  • make coverage-restore: keeps coverage reports, keeps downloaded tools, restore lib_/
  • make coverage-clean: restore lib_/, deletes everything related to coverage (reports, tools, etc.)

@ssbrewster @apapirovski does that sound like something that would satisfy your use cases?

@ssbrewster
Copy link
Contributor

@TimothyGu yes that would work for my use cases i just wonder whether we should run coverage-restore as part of the make coverage target itself so it restores the lib directory after the coverage is generated. Is there any reason for not restoring that? If this is an edge case and the user wants to inspect those files then they could specify that by passing an environment variable to the make command (similar to option 2 in #15214). And we keep the make coverage-clean as a separate target for when the user wants to clean everything up.

@apapirovski
Copy link
Member Author

apapirovski commented Sep 20, 2017

I'm personally just not sure what the upside is of deleting the coverage reports, especially if they're in .gitignore. The folder is tiny and its useful info.

There are legitimate reasons to run make clean and then build fresh, whereas I don't see the same for coverage.

(I'm fine with any other changes proposed around this behaviour but I would still like to be able to somehow clean & keep just coverage and have it be in .gitignore.)

@BridgeAR
Copy link
Member

I personally do not have a strong opinion about either suggested way but I think it is a good thing to make sure we have the possibility of keeping the coverage.

@nodejs/tsc I think it would be good to weight in.

@BridgeAR BridgeAR requested a review from a team September 27, 2017 21:11
@apapirovski
Copy link
Member Author

apapirovski commented Oct 12, 2017

Could we get some movement on this by any chance? Thanks! If this change is not wanted, I'm happy to close but would like to resolve one way or the other.

@jasnell
Copy link
Member

jasnell commented Oct 13, 2017

@thefourtheye
Copy link
Contributor

I don't have a strong preference, but I am leaning towards the idea proposed by @TimothyGu.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM

Add coverage folder to .gitignore and remove it from the list
of files & folders delete by coverage-clean.
@apapirovski
Copy link
Member Author

@TimothyGu @thefourtheye would either of you like to make your objection official? Want to make sure since otherwise this can get merged.

@BridgeAR
Copy link
Member

Seems like there are no strong objections and this can land.

If someone objects later on we could change it again anyway.

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Nov 22, 2017
Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

@jasnell
Copy link
Member

jasnell commented Nov 22, 2017

@jasnell
Copy link
Member

jasnell commented Nov 22, 2017

there's some red in the CI that should be looked at.

@apapirovski
Copy link
Member Author

It's hard to imagine it's related given that it's this test: async-hooks/test-signalwrap on one specific environment that has been red all day.

@jasnell
Copy link
Member

jasnell commented Nov 22, 2017

There's also this failure on freebsd... that has not failed in any other test I've seen today. Also likely unrelated but just want to confirm

not ok 264 parallel/test-cluster-send-handle-large-payload
  ---
  duration_ms: 0.562
  severity: fail
  stack: |-
    undefined:1
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    
    SyntaxError: Unexpected token a in JSON at position 0
        at JSON.parse (<anonymous>)
        at Pipe.channel.onread (internal/child_process.js:487:28)

@jasnell
Copy link
Member

jasnell commented Nov 22, 2017

Ok, quick check through and there's really no way those could have been affected by this change. Will land as soon as CI finishes

jasnell pushed a commit that referenced this pull request Nov 22, 2017
Add coverage folder to .gitignore and remove it from the list
of files & folders delete by coverage-clean.

PR-URL: #15470
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@jasnell
Copy link
Member

jasnell commented Nov 22, 2017

Landed in c6b7052

@jasnell jasnell closed this Nov 22, 2017
@addaleax addaleax removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Nov 28, 2017
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
Add coverage folder to .gitignore and remove it from the list
of files & folders delete by coverage-clean.

PR-URL: #15470
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
Add coverage folder to .gitignore and remove it from the list
of files & folders delete by coverage-clean.

PR-URL: #15470
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@MylesBorins MylesBorins mentioned this pull request Dec 12, 2017
@MylesBorins
Copy link
Contributor

Should this be backported to v6.x-staging? If yes please follow the guide and raise a backport PR, if not let me know or add the dont-land-on label.

gibfahn pushed a commit that referenced this pull request Dec 19, 2017
Add coverage folder to .gitignore and remove it from the list
of files & folders delete by coverage-clean.

PR-URL: #15470
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@gibfahn gibfahn mentioned this pull request Dec 20, 2017
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
Add coverage folder to .gitignore and remove it from the list
of files & folders delete by coverage-clean.

PR-URL: #15470
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@gibfahn gibfahn mentioned this pull request Dec 20, 2017
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. meta Issues and PRs related to the general management of the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.