From 61b90e7c5e2330e25345e4b96866dbea95da9a4a Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Sat, 27 Jul 2024 17:52:23 -0400 Subject: [PATCH] build: update gcovr to 7.2 and codecov config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/54019 Reviewed-By: Yagiz Nizipli Reviewed-By: James M Snell Reviewed-By: Michaƫl Zasso --- .../workflows/coverage-linux-without-intl.yml | 4 ++-- .github/workflows/coverage-linux.yml | 4 ++-- Makefile | 9 +++++---- codecov.yml | 18 +++++++----------- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/coverage-linux-without-intl.yml b/.github/workflows/coverage-linux-without-intl.yml index e26d7a99533898..66c192c95d605b 100644 --- a/.github/workflows/coverage-linux-without-intl.yml +++ b/.github/workflows/coverage-linux-without-intl.yml @@ -60,7 +60,7 @@ jobs: - name: Environment Information run: npx envinfo - name: Install gcovr - run: pip install gcovr==4.2 + run: pip install gcovr==7.2 - name: Build run: make build-ci -j4 V=1 CONFIG_FLAGS="--error-on-warn --coverage --without-intl" # TODO(bcoe): fix the couple tests that fail with the inspector enabled. @@ -72,7 +72,7 @@ jobs: env: NODE_OPTIONS: --max-old-space-size=8192 - name: Report C++ - 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) + run: gcovr --object-directory=out -v --filter src --xml -o ./coverage/coverage-cxx.xml --root=./ --gcov-executable="llvm-cov-18 gcov" # Clean temporary output from gcov and c8, so that it's not uploaded: - name: Clean tmp run: rm -rf coverage/tmp && rm -rf out diff --git a/.github/workflows/coverage-linux.yml b/.github/workflows/coverage-linux.yml index 63b523638b126b..030eaabbe25efa 100644 --- a/.github/workflows/coverage-linux.yml +++ b/.github/workflows/coverage-linux.yml @@ -60,7 +60,7 @@ jobs: - name: Environment Information run: npx envinfo - name: Install gcovr - run: pip install gcovr==4.2 + run: pip install gcovr==7.2 - name: Build run: make build-ci -j4 V=1 CONFIG_FLAGS="--error-on-warn --coverage" # TODO(bcoe): fix the couple tests that fail with the inspector enabled. @@ -72,7 +72,7 @@ jobs: env: NODE_OPTIONS: --max-old-space-size=8192 - name: Report C++ - 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) + run: gcovr --object-directory=out -v --filter src --xml -o ./coverage/coverage-cxx.xml --root=./ --gcov-executable="llvm-cov-18 gcov" # Clean temporary output from gcov and c8, so that it's not uploaded: - name: Clean tmp run: rm -rf coverage/tmp && rm -rf out diff --git a/Makefile b/Makefile index 547a1f6e7f44d9..fa917055d1a807 100644 --- a/Makefile +++ b/Makefile @@ -253,7 +253,7 @@ coverage: coverage-test ## Run the tests and generate a coverage report. .PHONY: coverage-build coverage-build: all -$(MAKE) coverage-build-js - if [ ! -d gcovr ]; then $(PYTHON) -m pip install -t gcovr gcovr==4.2; fi + if [ ! -d gcovr ]; then $(PYTHON) -m pip install -t gcovr gcovr==7.2; fi $(MAKE) .PHONY: coverage-build-js @@ -269,9 +269,10 @@ coverage-test: coverage-build -NODE_V8_COVERAGE=coverage/tmp \ TEST_CI_ARGS="$(TEST_CI_ARGS) --type=coverage" $(MAKE) $(COVTESTS) $(MAKE) coverage-report-js - -(cd out && PYTHONPATH=../gcovr $(PYTHON) -m gcovr \ - --gcov-exclude='.*\b(deps|usr|out|cctest|embedding)\b' -v \ - -r ../src/ --object-directory Release/obj.target \ + -(PYTHONPATH=./gcovr $(PYTHON) -m gcovr \ + --object-directory=out \ + --filter src -v \ + --root ./ \ --html --html-details -o ../coverage/cxxcoverage.html \ --gcov-executable="$(GCOV)") @printf "Javascript coverage %%: " diff --git a/codecov.yml b/codecov.yml index 910f4b32192146..05410f5c18957b 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,20 +1,16 @@ -# TODO(bcoe): re-enable coverage report comments, once we can figure out -# how to make them more accurate for the Node.js project, -# See: https://github.com/nodejs/node/issues/35759 -comment: false -# # Only show diff and files changed: -# layout: "diff, files" -# # Don't post if no changes in coverage: -# require_changes: true +comment: + # Only show diff and files changed: + layout: diff, files + # Don't post if no changes in coverage: + require_changes: true codecov: - branch: main notify: # Wait for all coverage builds: # - coverage-linux.yml - # - coverage-windows.yml + # - coverage-windows.yml [manually disabled see #50489] # - coverage-linux-without-intl.yml - after_n_builds: 3 + after_n_builds: 2 coverage: # Useful for blocking Pull Requests that don't meet a particular coverage threshold.