diff options
author | isaacs <i@izs.me> | 2020-09-18 02:01:03 +0300 |
---|---|---|
committer | Ruy Adorno <ruyadorno@hotmail.com> | 2020-09-22 19:34:35 +0300 |
commit | 1909ae03ab36a62a00d3b63de80a8c15200095f7 (patch) | |
tree | 39c717ee8a8d0ac3d8f8a604fa38c9a71222b563 /.github | |
parent | a1d375f6b0ee358be41110a49acc1c9fdb775fbe (diff) |
Add a 'check-coverage' script so we can track towards completion
We are targetting 100% test coverage for npm v7 GA. Using a
coverage-map, we require that any of the newly created tests fully cover
the module that they are testing. However, this has the side effect of
_always_ hitting 100% coverage when running 'npm test', even though not
all modules are being tested.
This adds a new 'load-all' test which, in 'check-coverage' mode, tells
nyc to include every file in the project.
This also removes the double-run of our tests in CI, where we run once
and then immediately run the same exact thing again for Coveralls, and
sends the 'check-coverage' output to Coveralls instead.
PR-URL: https://github.com/npm/cli/pull/1820
Credit: @isaacs
Close: #1820
Reviewed-by: @ruyadorno
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/ci.yml | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7edd82e3..b79f775d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,16 +37,18 @@ jobs: - name: Install dependencies run: node . install - # Run the tests + # Run the tests, but not if we're just gonna do coveralls later anyway - name: Run Tap tests - run: node . test -- -t600 -Rclassic -c + if: matrix.platform.os != 'ubuntu-latest' || matrix.node-version != '12.x' + run: node . test -- -t600 -Rbase -c env: DEPLOY_VERSION: testing # Run coverage check - name: Run coverage report - if: matrix.os == 'ubuntu-latest' && matrix.node-version == '12.x' - run: node . test -- -t600 -Rclassic -c + if: matrix.platform.os == 'ubuntu-latest' && matrix.node-version == '12.x' + # turn off --check-coverage until 100%, so CI failure is relevant + run: node . run check-coverage -- -t600 --no-check-coverage -Rbase -c env: DEPLOY_VERSION: testing COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_OPTIONAL_TOKEN }} @@ -55,5 +57,7 @@ jobs: # if: matrix.os == 'ubuntu-latest' # run: sudo PATH=$PATH $(which node) . test -- --coverage --timeout 600 + # no need to check licenses everywhere, they don't change between versions - name: Validate licenses + if: matrix.os == 'ubuntu-latest' && matrix.node-version == '12.x' run: node . run licenses |