Skip to content

Commit 7cfde6e

Browse files
authored
Ignore ZPP in gcovr (GH-21623)
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.
1 parent 50ad458 commit 7cfde6e

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

.github/workflows/test-suite.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,15 @@ jobs:
413413
with:
414414
enableOpcache: true
415415
jitType: tracing
416+
- name: Generate coverage report
417+
if: ${{ !cancelled() }}
418+
run: make gcovr-xml
416419
- uses: codecov/codecov-action@v5
417420
if: ${{ !cancelled() }}
418421
with:
422+
disable_search: true
419423
fail_ci_if_error: true
424+
files: gcovr.xml
420425
token: ${{ secrets.CODECOV_TOKEN }}
421426
verbose: true
422427
COMMUNITY:

build/Makefile.gcov

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ GCOVR_EXCLUDES = \
2222
'ext/fileinfo/libmagic/.*' \
2323
'ext/gd/libgd/.*' \
2424
'ext/hash/sha3/.*' \
25+
'ext/lexbor/lexbor/.*' \
2526
'ext/mbstring/libmbfl/.*' \
26-
'ext/pcre/pcre2lib/.*'
27+
'ext/pcre/pcre2lib/.*' \
28+
'ext/uri/uriparser/.*'
29+
30+
GCOVR_EXCLUDE_LINES_BY_PATTERN = '.*\b(ZEND_PARSE_PARAMETERS_(START|END|NONE)|Z_PARAM_).*'
2731

2832
lcov: lcov-html
2933

@@ -49,14 +53,14 @@ gcovr-html:
4953
@rm -rf gcovr_html/
5054
@mkdir gcovr_html
5155
gcovr -sr . -o gcovr_html/index.html --html --html-details \
52-
--exclude-directories 'ext/date/lib$$' \
56+
--exclude-lines-by-pattern $(GCOVR_EXCLUDE_LINES_BY_PATTERN) \
5357
$(foreach lib, $(GCOVR_EXCLUDES), -e $(lib))
5458

5559
gcovr-xml:
5660
@echo "Generating gcovr XML"
5761
@rm -f gcovr.xml
5862
gcovr -sr . -o gcovr.xml --xml \
59-
--exclude-directories 'ext/date/lib$$' \
63+
--exclude-lines-by-pattern $(GCOVR_EXCLUDE_LINES_BY_PATTERN) \
6064
$(foreach lib, $(GCOVR_EXCLUDES), -e $(lib))
6165

6266
.PHONY: gcovr-html lcov-html php_lcov.info

codecov.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)