@@ -84,24 +84,54 @@ jobs:
8484 - name : Unpack build
8585 run : tar -xaf testpack.tar.bz2
8686
87+ - name : Verify coverage instrumentation
88+ run : |
89+ echo "Checking if binaries are instrumented for coverage..."
90+ if nm lightningd/lightningd | grep -q '__llvm_profile'; then
91+ echo "✓ Binaries appear to be instrumented for coverage"
92+ else
93+ echo "⚠ WARNING: Binaries may not be properly instrumented"
94+ echo "Checking build flags in config.vars:"
95+ grep -E "COVERAGE|CFLAGS" config.vars || echo "No coverage flags found"
96+ fi
97+
8798 - name : Run tests with coverage
8899 env :
89- CLN_COVERAGE_DIR : ${{ github.workspace }}/coverage-raw
90100 TEST_DB_PROVIDER : ${{ matrix.db }}
91101 PYTEST_PAR : ${{ matrix.pytest_par }}
92102 SLOW_MACHINE : 1
93103 TIMEOUT : 900
104+ VALGRIND : 0
94105 run : |
106+ export CLN_COVERAGE_DIR="${{ github.workspace }}/coverage-raw"
95107 mkdir -p "$CLN_COVERAGE_DIR"
96- uv run eatmydata pytest tests/ -n ${PYTEST_PAR} -vvv
108+ echo "CLN_COVERAGE_DIR=$CLN_COVERAGE_DIR"
109+ echo "Current directory: $(pwd)"
110+ ls -la
111+ VALGRIND=0 uv run eatmydata pytest tests/ -n ${PYTEST_PAR} -vvv
112+
113+ - name : Check coverage files generated
114+ if : always()
115+ run : |
116+ echo "Checking for profraw files in coverage-raw"
117+ find "${{ github.workspace }}/coverage-raw" -name "*.profraw" -ls || echo "No profraw files found"
118+ COUNT=$(find "${{ github.workspace }}/coverage-raw" -name "*.profraw" 2>/dev/null | wc -l)
119+ echo "Total profraw files: $COUNT"
120+ if [ "$COUNT" -eq 0 ]; then
121+ echo "WARNING: No coverage data was generated!"
122+ echo "This might indicate:"
123+ echo " 1. Tests didn't run successfully"
124+ echo " 2. Binaries aren't instrumented"
125+ echo " 3. LLVM_PROFILE_FILE environment variable not set correctly"
126+ fi
97127
98128 - name : Upload coverage data
99129 uses : actions/upload-artifact@v4
100130 if : always()
101131 with :
102132 name : coverage-raw-${{ matrix.name }}
103133 path : coverage-raw/*.profraw
104- if-no-files-found : error
134+ if-no-files-found : warn
105135
106136 report :
107137 name : Generate Coverage Report
0 commit comments