Skip to content

Commit 158b4ea

Browse files
committed
debug: add LLVM_PROFILE_FILE and diagnostic output for coverage
- Set LLVM_PROFILE_FILE env var to ensure profraw files are created - Add debug output to track profraw file generation and merge status - Show coverage.info contents to diagnose export issues
1 parent 7102377 commit 158b4ea

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,15 @@ jobs:
111111
chmod +x build/*_tests || true
112112
113113
- name: Run Unit Tests
114+
env:
115+
LLVM_PROFILE_FILE: "coverage-%p-%m.profraw"
114116
run: |
115117
cd build
116118
ctest --output-on-failure
117119
118120
- name: Run Distributed Tests
121+
env:
122+
LLVM_PROFILE_FILE: "coverage-%p-%m.profraw"
119123
run: |
120124
set +e
121125
./tests/run_dist_test.sh tests/logic/*.slt
@@ -125,10 +129,20 @@ jobs:
125129
if: matrix.sanitizer == 'address' && matrix.compiler == 'clang++'
126130
run: |
127131
cd build
128-
# Merge LLVM profile data
129-
llvm-profdata merge *.profraw -output=coverage.profdata 2>/dev/null || true
130-
# Export to lcov format (includes branch coverage with LLVM)
131-
llvm-cov export -instr-profile=coverage.profdata --format=lcov --object=sqlEngineCore > coverage.info 2>/dev/null || true
132+
# Debug: list all coverage files before merge
133+
echo "=== Files before merge ==="
134+
ls -la *.profraw *.profdata 2>/dev/null || echo "No profraw/profdata files found"
135+
echo "=== Profraw file count ==="
136+
ls -la *.profraw 2>/dev/null | wc -l
137+
echo "=== Merging LLVM profile data ==="
138+
llvm-profdata merge *.profraw -output=coverage.profdata 2>&1 || echo "Merge failed or no files"
139+
echo "=== Checking profdata ==="
140+
ls -la coverage.profdata 2>/dev/null || echo "No profdata created"
141+
echo "=== Exporting to lcov format ==="
142+
llvm-cov export -instr-profile=coverage.profdata --format=lcov --object=sqlEngineCore > coverage.info 2>&1 || echo "Export failed"
143+
echo "=== Coverage info size ==="
144+
wc -l coverage.info 2>/dev/null || echo "No coverage.info created"
145+
head -20 coverage.info 2>/dev/null || echo "Cannot read coverage.info"
132146
# Filter and generate HTML
133147
lcov --remove coverage.info '/usr/*' '*/tests/*' '*/CMakeFiles/*' '*/_deps/*' --output-file filtered_coverage.info --ignore-errors inconsistent,unused 2>/dev/null || true
134148
genhtml --branch-coverage filtered_coverage.info --output-directory out_coverage --ignore-errors inconsistent 2>/dev/null || true

0 commit comments

Comments
 (0)