Skip to content

Commit 20aff2b

Browse files
authoredJul 27, 2024
build: update gcovr to 7.2 and codecov config
PR-URL: nodejs#54019 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>

File tree

4 files changed

+16
-19
lines changed

4 files changed

+16
-19
lines changed
 

‎.github/workflows/coverage-linux-without-intl.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- name: Environment Information
6161
run: npx envinfo
6262
- name: Install gcovr
63-
run: pip install gcovr==4.2
63+
run: pip install gcovr==7.2
6464
- name: Build
6565
run: make build-ci -j4 V=1 CONFIG_FLAGS="--error-on-warn --coverage --without-intl"
6666
# TODO(bcoe): fix the couple tests that fail with the inspector enabled.
@@ -72,7 +72,7 @@ jobs:
7272
env:
7373
NODE_OPTIONS: --max-old-space-size=8192
7474
- name: Report C++
75-
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)
75+
run: gcovr --object-directory=out -v --filter src --xml -o ./coverage/coverage-cxx.xml --root=./ --gcov-executable="llvm-cov-18 gcov"
7676
# Clean temporary output from gcov and c8, so that it's not uploaded:
7777
- name: Clean tmp
7878
run: rm -rf coverage/tmp && rm -rf out

‎.github/workflows/coverage-linux.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- name: Environment Information
6161
run: npx envinfo
6262
- name: Install gcovr
63-
run: pip install gcovr==4.2
63+
run: pip install gcovr==7.2
6464
- name: Build
6565
run: make build-ci -j4 V=1 CONFIG_FLAGS="--error-on-warn --coverage"
6666
# TODO(bcoe): fix the couple tests that fail with the inspector enabled.
@@ -72,7 +72,7 @@ jobs:
7272
env:
7373
NODE_OPTIONS: --max-old-space-size=8192
7474
- name: Report C++
75-
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)
75+
run: gcovr --object-directory=out -v --filter src --xml -o ./coverage/coverage-cxx.xml --root=./ --gcov-executable="llvm-cov-18 gcov"
7676
# Clean temporary output from gcov and c8, so that it's not uploaded:
7777
- name: Clean tmp
7878
run: rm -rf coverage/tmp && rm -rf out

‎Makefile

+5-4
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ coverage: coverage-test ## Run the tests and generate a coverage report.
254254
.PHONY: coverage-build
255255
coverage-build: all
256256
-$(MAKE) coverage-build-js
257-
if [ ! -d gcovr ]; then $(PYTHON) -m pip install -t gcovr gcovr==4.2; fi
257+
if [ ! -d gcovr ]; then $(PYTHON) -m pip install -t gcovr gcovr==7.2; fi
258258
$(MAKE)
259259

260260
.PHONY: coverage-build-js
@@ -270,9 +270,10 @@ coverage-test: coverage-build
270270
-NODE_V8_COVERAGE=coverage/tmp \
271271
TEST_CI_ARGS="$(TEST_CI_ARGS) --type=coverage" $(MAKE) $(COVTESTS)
272272
$(MAKE) coverage-report-js
273-
-(cd out && PYTHONPATH=../gcovr $(PYTHON) -m gcovr \
274-
--gcov-exclude='.*\b(deps|usr|out|cctest|embedding)\b' -v \
275-
-r ../src/ --object-directory Release/obj.target \
273+
-(PYTHONPATH=./gcovr $(PYTHON) -m gcovr \
274+
--object-directory=out \
275+
--filter src -v \
276+
--root ./ \
276277
--html --html-details -o ../coverage/cxxcoverage.html \
277278
--gcov-executable="$(GCOV)")
278279
@printf "Javascript coverage %%: "

‎codecov.yml

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1-
# TODO(bcoe): re-enable coverage report comments, once we can figure out
2-
# how to make them more accurate for the Node.js project,
3-
# See: https://github.com/nodejs/node/issues/35759
4-
comment: false
5-
# # Only show diff and files changed:
6-
# layout: "diff, files"
7-
# # Don't post if no changes in coverage:
8-
# require_changes: true
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
96

107
codecov:
11-
branch: main
128
notify:
139
# Wait for all coverage builds:
1410
# - coverage-linux.yml
15-
# - coverage-windows.yml
11+
# - coverage-windows.yml [manually disabled see #50489]
1612
# - coverage-linux-without-intl.yml
17-
after_n_builds: 3
13+
after_n_builds: 2
1814

1915
coverage:
2016
# Useful for blocking Pull Requests that don't meet a particular coverage threshold.

0 commit comments

Comments
 (0)
Please sign in to comment.