diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 1b08c60c..87080d72 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -131,6 +131,18 @@ jobs: RUST_LOG: ironclaw=info RUST_BACKTRACE: "1" + - name: Verify profraw files exist + if: always() + run: | + echo "LLVM_PROFILE_FILE=${LLVM_PROFILE_FILE}" + echo "CARGO_LLVM_COV_TARGET_DIR=${CARGO_LLVM_COV_TARGET_DIR}" + profraw_count=$(find target/ -name '*.profraw' 2>/dev/null | wc -l) + echo "Found ${profraw_count} .profraw files under target/" + find target/ -name '*.profraw' 2>/dev/null || true + if [ "$profraw_count" -eq 0 ]; then + echo "::warning::No .profraw files found — coverage report will fail" + fi + - name: Generate coverage report if: always() run: cargo llvm-cov report --lcov --output-path e2e-coverage.info diff --git a/tests/e2e/conftest.py b/tests/e2e/conftest.py index af885fb7..23a16657 100644 --- a/tests/e2e/conftest.py +++ b/tests/e2e/conftest.py @@ -133,9 +133,12 @@ async def ironclaw_server(ironclaw_binary, mock_llm_server): ) finally: if proc.returncode is None: - proc.send_signal(signal.SIGTERM) + # Use SIGINT (not SIGTERM) so tokio's ctrl_c handler triggers a + # graceful shutdown. This lets the LLVM coverage runtime run its + # atexit handler and flush .profraw files for cargo-llvm-cov. + proc.send_signal(signal.SIGINT) try: - await asyncio.wait_for(proc.wait(), timeout=5) + await asyncio.wait_for(proc.wait(), timeout=10) except asyncio.TimeoutError: proc.kill()