From 6c5c523a1addde8849eb0f1b1bb9a50aefcc0bcf Mon Sep 17 00:00:00 2001 From: "jabber.developer2" Date: Wed, 28 Jan 2026 22:51:46 +0300 Subject: [PATCH] ci: fix coverage to match Code Coverage job output Use --extract '*/src/src/*' instead of --remove to properly filter production code from tests. Coverage now shows 27.5% lines matching the dedicated Code Coverage job. --- ci-build.sh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ci-build.sh b/ci-build.sh index dcf3ccca..a971b3cd 100755 --- a/ci-build.sh +++ b/ci-build.sh @@ -259,16 +259,11 @@ build_and_test() { if [ "$run_coverage" = "yes" ]; then echo "--> Collecting coverage data..." if command -v lcov >/dev/null 2>&1; then - lcov --capture --directory . --output-file coverage.info \ + lcov --capture --directory . --output-file coverage-full.info \ --rc lcov_branch_coverage=1 --ignore-errors inconsistent 2>&1 || true - # Remove test files, stubs, system headers - only keep src/ production code - lcov --remove coverage.info \ - '/usr/*' \ - '*/tests/*' \ - '*test*.c' \ - '*stub*.c' \ - '*/functionaltests/*' \ - '*/unittests/*' \ + # Extract only production code from src/ directory, exclude tests + # Pattern matches both Docker (/src/src/*) and CI (/usr/src/profanity/src/*) + lcov --extract coverage-full.info '*/profanity/src/*' '*/src/src/*' \ --output-file coverage.info \ --rc lcov_branch_coverage=1 --ignore-errors inconsistent 2>&1 || true if [ -f coverage.info ] && [ -s coverage.info ]; then