test: exclude write-coverage from coverage report#15194
test: exclude write-coverage from coverage report#15194bcoe wants to merge 1 commit intonodejs:masterfrom
Conversation
TimothyGu
left a comment
There was a problem hiding this comment.
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
.nycrc
Outdated
There was a problem hiding this comment.
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.
@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.
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.
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.
@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.
Yes, that sounds right to me :)
|
@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.jsis 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:
.nycrcconfiguration file, which can be used to configure the nyc test coverage tool.write-coverage.jsfrom coverage reports..nycrcconfig file (I also added the additionaltextreporter, 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