GeezerVison is showing github.com — test: add windows and C++ coverage · nodejs/node@11eca36
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/coverage-linux.yml +19-8Lines changed: 19 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -# TODO(bcoe): add similar job for Windows coverage. |
2 | 1 | name: coverage-linux |
3 | 2 |
|
4 | 3 | on: |
5 | 4 | pull_request: |
| 5 | + paths-ignore: |
| 6 | + - 'doc/**' |
| 7 | + - 'deps/**' |
| 8 | + - 'benchmark/**' |
| 9 | + - 'tools/**' |
6 | 10 | push: |
7 | 11 | branches: |
8 | 12 | - master |
| 13 | + paths-ignore: |
| 14 | + - 'doc/**' |
| 15 | + - 'deps/**' |
| 16 | + - 'benchmark/**' |
| 17 | + - 'tools/**' |
9 | 18 |
|
10 | 19 | env: |
11 | 20 | PYTHON_VERSION: 3.9 |
12 | 21 | FLAKY_TESTS: dontcare |
13 | 22 |
|
14 | 23 | jobs: |
15 | | - # TODO(bcoe): add support for C++ coverage. |
16 | 24 | coverage-linux: |
17 | 25 | runs-on: ubuntu-latest |
18 | 26 | steps: |
@@ -23,18 +31,21 @@ jobs: |
23 | 31 | python-version: ${{ env.PYTHON_VERSION }} |
24 | 32 | - name: Environment Information |
25 | 33 | run: npx envinfo |
| 34 | + - name: Install gcovr |
| 35 | + run: pip install gcovr==4.2 |
26 | 36 | - name: Build |
27 | | - run: make build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn" |
| 37 | + run: make build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn --coverage" |
28 | 38 | # TODO(bcoe): fix the couple tests that fail with the inspector enabled. |
29 | 39 | # The cause is most likely coverage's use of the inspector. |
30 | 40 | - name: Test |
31 | | - run: NODE_V8_COVERAGE=coverage/tmp make run-ci -j2 V=1 TEST_CI_ARGS="-p dots" || exit 0 |
32 | | - - name: Report |
| 41 | + run: NODE_V8_COVERAGE=coverage/tmp make test-cov -j2 V=1 TEST_CI_ARGS="-p dots" || exit 0 |
| 42 | + - name: Report JS |
33 | 43 | run: npx c8 report --check-coverage |
34 | | - - name: Output file count |
35 | | - run: ls -l coverage/tmp/ | wc -l |
| 44 | + - name: Report C++ |
| 45 | + run: cd out && gcovr --gcov-exclude='.*\b(deps|usr|out|obj|cctest|embedding)\b' -v -r Release/obj.target --xml -o ../coverage/coverage-cxx.xml --root=$(cd ../ && pwd) |
| 46 | + # Clean temporary output from gcov and c8, so that it's not uploaded: |
36 | 47 | - name: Clean tmp |
37 | | - run: rm -rf coverage/tmp |
| 48 | + run: rm -rf coverage/tmp && rm -rf out |
38 | 49 | - name: Upload |
39 | 50 | uses: codecov/codecov-action@v1 |
40 | 51 | with: |
|
Collapse file
Copy file name to clipboard +51Lines changed: 51 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +name: coverage-windows |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths-ignore: |
| 6 | + - 'doc/**' |
| 7 | + - 'deps/**' |
| 8 | + - 'benchmark/**' |
| 9 | + - 'tools/**' |
| 10 | + push: |
| 11 | + branches: |
| 12 | + - master |
| 13 | + paths-ignore: |
| 14 | + - 'doc/**' |
| 15 | + - 'deps/**' |
| 16 | + - 'benchmark/**' |
| 17 | + - 'tools/**' |
| 18 | + |
| 19 | +env: |
| 20 | + PYTHON_VERSION: 3.9 |
| 21 | + FLAKY_TESTS: dontcare |
| 22 | + |
| 23 | +jobs: |
| 24 | + coverage-windows: |
| 25 | + runs-on: windows-latest |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v2 |
| 28 | + - name: Set up Python ${{ env.PYTHON_VERSION }} |
| 29 | + uses: actions/setup-python@v2 |
| 30 | + with: |
| 31 | + python-version: ${{ env.PYTHON_VERSION }} |
| 32 | + - name: Install deps |
| 33 | + run: choco install nasm |
| 34 | + - name: Environment Information |
| 35 | + run: npx envinfo |
| 36 | + - name: Build |
| 37 | + run: ./vcbuild.bat |
| 38 | + # TODO(bcoe): investigate tests that fail with coverage enabled |
| 39 | + # on Windows. |
| 40 | + - name: Test |
| 41 | + run: ./vcbuild.bat test-ci-js; node -e 'process.exit(0)' |
| 42 | + env: |
| 43 | + NODE_V8_COVERAGE: ./coverage/tmp |
| 44 | + - name: Report |
| 45 | + run: npx c8 report |
| 46 | + - name: Clean tmp |
| 47 | + run: npx rimraf ./coverage/tmp |
| 48 | + - name: Upload |
| 49 | + uses: codecov/codecov-action@v1 |
| 50 | + with: |
| 51 | + directory: ./coverage |
Collapse file
Copy file name to clipboardExpand all lines: .nycrc +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
9 | 9 | "reporter": [ |
10 | 10 | "html", |
11 | 11 | "text", |
12 | | - "lcov" |
| 12 | + "cobertura" |
13 | 13 | ], |
14 | 14 | "lines": 95, |
15 | 15 | "branches": "93", |
|
Collapse file
Copy file name to clipboardExpand all lines: Makefile +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
294 | 294 | .PHONY: jstest |
295 | 295 | jstest: build-addons build-js-native-api-tests build-node-api-tests ## Runs addon tests and JS tests |
296 | 296 | $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) \ |
| 297 | + $(TEST_CI_ARGS) \ |
297 | 298 | --skip-tests=$(CI_SKIP_TESTS) \ |
298 | 299 | $(JS_SUITES) \ |
299 | 300 | $(NATIVE_SUITES) |
|
Collapse file
Copy file name to clipboard +10Lines changed: 10 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +comment: |
| 2 | + # Only show diff and files changed: |
| 3 | + layout: "diff, files" |
| 4 | + # Don't post if no changes in coverage: |
| 5 | + require_changes: true |
| 6 | + |
| 7 | +codecov: |
| 8 | + notify: |
| 9 | + # Wait for all coverage builds: |
| 10 | + after_n_builds: 2 |