-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: exclude write-coverage from coverage report #15194
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for stopping by!
While these changes mostly LGTM, I would encourage you to look at our commit message guidelines, and it would be awesome if you could modify the commit messages to conform to those guidelines. If not, we'll fix them upon landing.
.gitignore
Outdated
@@ -13,6 +13,7 @@ | |||
!.gitkeep | |||
!.mailmap | |||
!.remarkrc | |||
!.nycrc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alphabetical order
@@ -0,0 +1,6 @@ | |||
{ | |||
"exclude": [ | |||
"**/internal/process/write-coverage.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the wildcard necessary? It'll always be in lib/internal/process, unless the absolute path is used for comparison?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TimothyGu because the Makefile passes an absolute path for the test coverage's working directory:
--temp-directory "/Users/benjamincoe/bcoe/node/.cov_tmp"
nyc ends up working with the path:
/Users/benjamincoe/bcoe/node/lib_/internal/process/write-coverage.js
when the file is processed by the exclude glob.
tldr; we definitely don't want to bake /Users/benjamincoe/bcoe
into the exclude rule, and it seemed like prefixing with the **
was the easiest solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bcoe Makes sense 👍
3a1e6fe
to
13f6400
Compare
Added a .nyrc configuration file that can be used to configure test coverage. Added an exclude rule that removes write-coverage.js from coverage reports. Pulled reporter configuration into .nycrc and added an additional text reporter.
@TimothyGu I think I've amended my commits appropriately; Is the |
@bcoe Either |
"exclude": [ | ||
"**/internal/process/write-coverage.js" | ||
], | ||
"reporter": ["html", "text"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does adding the "text" reporter here affect the default output ? Just wondering if results on https://coverage.nodejs.org/ will be affected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhdawson I don't think it should; text
will result in a nice summary being written to the terminal, for the user who just ran tests. html
results in an index.html
(etc) being written to the ./coverage
folder, which I believe is what is in turn used on coverage.nodejs.org
.
@addaleax I think I'm correct on this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that sounds right to me :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@bcoe thanks for improving the coverage output :) |
Added a .nyrc configuration file that can be used to configure test coverage. Added an exclude rule that removes write-coverage.js from coverage reports. Pulled reporter configuration into .nycrc and added an additional text reporter. PR-URL: #15194 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Added a .nyrc configuration file that can be used to configure test coverage. Added an exclude rule that removes write-coverage.js from coverage reports. Pulled reporter configuration into .nycrc and added an additional text reporter. PR-URL: #15194 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Added a .nyrc configuration file that can be used to configure test coverage. Added an exclude rule that removes write-coverage.js from coverage reports. Pulled reporter configuration into .nycrc and added an additional text reporter. PR-URL: #15194 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Added a .nyrc configuration file that can be used to configure test coverage. Added an exclude rule that removes write-coverage.js from coverage reports. Pulled reporter configuration into .nycrc and added an additional text reporter. PR-URL: #15194 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Added a .nyrc configuration file that can be used to configure test coverage. Added an exclude rule that removes write-coverage.js from coverage reports. Pulled reporter configuration into .nycrc and added an additional text reporter. PR-URL: nodejs#15194 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Should this be backported to |
@MylesBorins my plan was to continue working on a few coverage related issues in my spare time; the answer to your question depends; are we comfortable with moving the main branch towards higher coverage, without inching up the coverage on I don't yet have the commit bit on Node, so I think I might need to lean on the kindness of strangers to add that additional label 😛 |
@bcoe backporting the minor changes are not a huge hassel as long as we maintain a small delta. |
ping re: backport |
With a goal of pitching in/familiarizing myself with the Node.js codebase, I wanted to help inch test coverage towards 100%.
With this in mind, I noticed that
write-coverage.js
is not tested. Since this is a utility used for outputting test coverage reports it seemed appropriate to add this to a list of excluded files (this just became possible).In this pull request:
.nycrc
configuration file, which can be used to configure the nyc test coverage tool.write-coverage.js
from coverage reports..nycrc
config file (I also added the additionaltext
reporter, which I find provides useful high-level information for folks playing the test-coverage MMORPG).Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test, coverage