Add nyc code coverage tool integration
Review Request #10195 — Created Oct. 4, 2018 and updated
Integration with ReviewBot has been added for the
nyc
code coverage
tool.This tool can be configured to run on most JavaScript setups by
providing a list of install steps and test command in the integration
configuration.It utilizes the 'json-summary' backend to provide basic per-file
thresholds and opens issues on files that do not meet these thresholds.Documentation has been added for this tool.
Tool has been tested with a basic JavaScript test repository with
multiple thresholds, usingnpm
andjasmine-node
. Other frameworks
have had basic testing done.
Description | From | Last Updated |
---|---|---|
In Description, there is a typo 'utalizes' and ReviewBot should be Review Bot |
ilaw | |
Typo in description: 'utalizes' |
brennie | |
F841 local variable 'fp' is assigned to but never used |
reviewbot | |
F821 undefined name 'f' |
reviewbot | |
E265 block comment should start with '# ' |
reviewbot | |
Nit: blank line between these. |
brennie | |
This doesn't need to be in the with block. |
brennie | |
Does nyc work on JSX (.jsx)? Does it work on TypeScript .ts/.tsx? |
brennie | |
a |
brennie | |
You will want to use the os.path module here. / is not guaranteed to be the path separator on every … |
brennie | |
Can we pass in cwd from the parent method? If there are lots of files, that is a lot of … |
brennie | |
You do not need to append the path sep. That is what os.path.join is for. |
brennie | |
os.path.join(t) is just t. You don't need it. |
brennie | |
In what case does f.get_patched_file_path() return None ? |
brennie | |
Comments should be full sentences, i.e., they should begin with a capital letter and end with a period. |
brennie | |
If you're using the first_line logic you added in your other patch, you'll want to mark this review request as … |
brennie | |
Missing a period. |
brennie | |
What if there are quoted substrings? This should use shlex.split(). |
brennie | |
Let's call this either i or index. |
brennie | |
Missing period. |
brennie | |
Remove this blank line. |
brennie | |
Needs a period. |
brennie | |
Blank line between these. |
brennie | |
Blank line between these. |
brennie | |
Missing a period. |
brennie | |
``istanbul`` |
brennie | |
``npm`` |
brennie | |
:file:`package.json` |
brennie | |
``nodejs`` |
brennie | |
:file:`package.json` ``test`` |
brennie | |
``nodejs`` |
brennie | |
This should be a rst link. It is missing a period. |
brennie | |
Should be listed alphabetically? |
ilaw | |
test suite instead of test-suite to be consistent |
ilaw | |
Parentheses are not needed here. |
ilaw | |
Parentheses are not needed here. |
ilaw | |
Should probably mention for what language(s) it does code coverage. Also since the actual name of the tool is Istanbul … |
brennie | |
Should probably mention for what language(s) it does code coverage. |
brennie | |
how about %s: %s%% coverage less than minimum threshold (%s%%) just to make it clear that its about coverage |
brennie | |
Same comments here about Istanbul vs nyc. |
brennie | |
Here too |
brennie |
- Commit:
-
7b4bd0eba22e059e65813fcd12c27696baf93d861454491dcee593a8b1c05393b7977fdd89488a2a
- Diff:
-
Revision 2 (+144)
Checks run (2 succeeded)
- Commit:
-
1454491dcee593a8b1c05393b7977fdd89488a2a22376009836b5673d918cc945ceaa24023589619
- Diff:
-
Revision 3 (+141)
Checks run (2 succeeded)
-
-
-
-
-
-
You will want to use the
os.path
module here./
is not guaranteed to be the path separator on every platform. Technically you could run the reviewbot worker on Windows if you needed to run a Windows-only tool.import os # ... file_coverage = coverage[os.path.join(os.getcwd(), path)]
-
Can we pass in
cwd
from the parent method? If there are lots of files, that is a lot of calls toos.getcwd()
, which isn't going to change.
- Change Summary:
-
Less spam by combining per-file messages. Code nitpick cleanup, only consider files that
nyc
actually tested. - Commit:
-
22376009836b5673d918cc945ceaa24023589619121a4f862aadd3d5ee257959ffe53686bab9b45d
- Diff:
-
Revision 4 (+25 -13)
Checks run (2 succeeded)
- Change Summary:
-
Depends on whole-file fix
- Change Summary:
-
Rebased on 10095 (Add ability for bots to make general comments)
- Depends On:
-
- Commit:
121a4f862aadd3d5ee257959ffe53686bab9b45dbf2de3b357ab2bd534159c6d94dbb5bf1e72fa58- Diff:
Revision 5 (+165)
Checks run (2 succeeded)
flake8 passed.JSHint passed.
- Change Summary:
-
Added documentation, only comment if there are issues and the file in question is modified, much nicer comments that explain issue, added config section to manually implant a .nycrc.
- Commit:
-
bf2de3b357ab2bd534159c6d94dbb5bf1e72fa584cbd43b1a5af4553cfc2d2e264d020aa1ec42fcf
Checks run (2 succeeded)
- Change Summary:
-
Big cleanup, removed dependency on being run in an
npm
environment, updated documentation. NOTE: some debug print statements, ignore those - Commit:
-
4cbd43b1a5af4553cfc2d2e264d020aa1ec42fcfd6d30e3b7b17fc49ebade6ac307526f1d63611c8
Checks run (2 succeeded)
- Commit:
-
d6d30e3b7b17fc49ebade6ac307526f1d63611c8d79b12c01896208be65cff84146434c123c59adc
Checks run (2 succeeded)
- Commit:
-
d79b12c01896208be65cff84146434c123c59adcd7d10622567613fdd59e23f6a480fab1b49fbd2d
Checks run (2 succeeded)
- Change Summary:
-
Removed WIP tag, updated description fields.
- Summary:
-
[WIP] Adding nyc tool to ReviewBotAdding nyc tool to ReviewBot
- Description:
-
~ [WIP] Adding nyc tool to ReviewBot
~ Integration with ReviewBot has been added for the
nyc
code coverage+ tool. + + This tool can be configured to run on most JavaScript setups by
+ providing a list of install steps and test command in the integration + configuration. + + It utalizes the 'json-summary' backend to provide basic per-file
+ thresholds and opens issues on files that do not meet these thresholds. + + Documentation has been added for this tool.
- Testing Done:
-
+ Tool has been tested with a basic JavaScript test repository with
+ multiple thresholds, using npm
andjasmine-node
. Other frameworks+ have had basic testing done.
- Commit:
-
d7d10622567613fdd59e23f6a480fab1b49fbd2db120855e9876bd5a2212f9f216bc48a8f2a4efe3
Checks run (2 succeeded)
-
-
-
Should probably mention for what language(s) it does code coverage.
Also since the actual name of the tool is Istanbul (whereas nyc is just the cli) should this be something like:
Istanbul (nyc)
-
-
how about
%s: %s%% coverage less than minimum threshold (%s%%)
just to make it clear that its about coverage -
-
- Description:
-
Integration with ReviewBot has been added for the
nyc
code coveragetool. This tool can be configured to run on most JavaScript setups by
providing a list of install steps and test command in the integration configuration. ~ It utalizes the 'json-summary' backend to provide basic per-file
~ It utilizes the 'json-summary' backend to provide basic per-file
thresholds and opens issues on files that do not meet these thresholds. Documentation has been added for this tool.
- Commit:
-
b120855e9876bd5a2212f9f216bc48a8f2a4efe373a2f5f66d71b3222edef64ca4900610b982a896