Skip to content

Commit 7468bee

Browse files
committed
ci(e2e): avoid FortCov bridge; generate .gcov via gcov and pass files explicitly to fortcov to prevent test-env guard interference
1 parent af0217d commit 7468bee

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

.github/workflows/e2e_pycobertura.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,22 @@ jobs:
4545
echo "FortCov binary not found in build tree" >&2
4646
exit 2
4747
fi
48-
# Ensure FortCov uses real gcov instead of synthesized .gcov files
49-
export FORTCOV_USE_REAL_GCOV=1
50-
# Enable auto-gcov generation to produce .gcov files in CI
51-
set +e
52-
"${FORTCOV_BIN}" --gcov --output=coverage.md
53-
rc=$?
54-
set -e
48+
# Generate .gcov from existing .gcda without invoking FortCov's bridge
49+
mapfile -t dirs < <(find . -type f -name '*.gcda' -printf '%h\n' 2>/dev/null | sort -u)
50+
for d in "${dirs[@]:-}"; do
51+
[ -n "$d" ] || continue
52+
( cd "$d" && gcov -b -c . >/dev/null 2>&1 || true ) || true
53+
done
54+
# Run FortCov directly on discovered .gcov files to produce coverage.md
55+
GCOV_LIST=$(find . -type f -name '*.gcov' | tr '\n' ' ')
56+
if [ -n "$GCOV_LIST" ]; then
57+
set +e
58+
${FORTCOV_BIN} --source=src $GCOV_LIST --output=coverage.md
59+
rc=$?
60+
set -e
61+
else
62+
rc=3
63+
fi
5564
# Fallback: if FortCov failed to produce coverage.md, synthesize a minimal
5665
# markdown with TOTAL row from Cobertura XML so comparison can proceed.
5766
if [ ! -f coverage.md ]; then

0 commit comments

Comments
 (0)