From 2028a8979349a7b7cf8c184f847851c102fe285c Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 3 Apr 2026 14:51:59 +0200 Subject: [PATCH] Ignore zpp in gcovr The ZPP macros materialize into optimized code with many error branches that aren't useful to test for every function. Ignore these lines completely by using the gcovr --exclude-lines-by-pattern flag. For codecov to pick up on this change, we generate the xml file manually and point to it in the codecov action. Also move the ignore paths from codecov.yml to Makefile.gcov. --- .github/workflows/test-suite.yml | 5 +++++ build/Makefile.gcov | 10 +++++++--- codecov.yml | 15 --------------- 3 files changed, 12 insertions(+), 18 deletions(-) delete mode 100644 codecov.yml diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 9eeff1455f8f..ef213a539937 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -413,10 +413,15 @@ jobs: with: enableOpcache: true jitType: tracing + - name: Generate coverage report + if: ${{ !cancelled() }} + run: make gcovr-xml - uses: codecov/codecov-action@v5 if: ${{ !cancelled() }} with: + disable_search: true fail_ci_if_error: true + files: gcovr.xml token: ${{ secrets.CODECOV_TOKEN }} verbose: true COMMUNITY: diff --git a/build/Makefile.gcov b/build/Makefile.gcov index de85893398cd..d389cecdd192 100644 --- a/build/Makefile.gcov +++ b/build/Makefile.gcov @@ -22,8 +22,12 @@ GCOVR_EXCLUDES = \ 'ext/fileinfo/libmagic/.*' \ 'ext/gd/libgd/.*' \ 'ext/hash/sha3/.*' \ + 'ext/lexbor/lexbor/.*' \ 'ext/mbstring/libmbfl/.*' \ - 'ext/pcre/pcre2lib/.*' + 'ext/pcre/pcre2lib/.*' \ + 'ext/uri/uriparser/.*' + +GCOVR_EXCLUDE_LINES_BY_PATTERN = '.*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).*' lcov: lcov-html @@ -49,14 +53,14 @@ gcovr-html: @rm -rf gcovr_html/ @mkdir gcovr_html gcovr -sr . -o gcovr_html/index.html --html --html-details \ - --exclude-directories 'ext/date/lib$$' \ + --exclude-lines-by-pattern $(GCOVR_EXCLUDE_LINES_BY_PATTERN) \ $(foreach lib, $(GCOVR_EXCLUDES), -e $(lib)) gcovr-xml: @echo "Generating gcovr XML" @rm -f gcovr.xml gcovr -sr . -o gcovr.xml --xml \ - --exclude-directories 'ext/date/lib$$' \ + --exclude-lines-by-pattern $(GCOVR_EXCLUDE_LINES_BY_PATTERN) \ $(foreach lib, $(GCOVR_EXCLUDES), -e $(lib)) .PHONY: gcovr-html lcov-html php_lcov.info diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index 4c7648e738cd..000000000000 --- a/codecov.yml +++ /dev/null @@ -1,15 +0,0 @@ -ignore: - # bundled libraries - - "ext/lexbor/lexbor/core" - - "ext/lexbor/lexbor/css" - - "ext/lexbor/lexbor/dom" - - "ext/lexbor/lexbor/encoding" - - "ext/lexbor/lexbor/html" - - "ext/lexbor/lexbor/ns" - - "ext/lexbor/lexbor/ports" - - "ext/lexbor/lexbor/punycode" - - "ext/lexbor/lexbor/tag" - - "ext/lexbor/lexbor/unicode" - - "ext/lexbor/lexbor/url" - - "ext/pcre/pcre2lib" - - "ext/uri/uriparser"