From 3f061fda56d5b5542ffc0d6a36de2475d3345dfa Mon Sep 17 00:00:00 2001 From: Walter Pinto Date: Sun, 4 Oct 2026 13:53:27 +0100 Subject: [PATCH] ci(rust): assert coverage with lcovcheck instead of grep The smoke steps grepped Please's console coverage table and the raw .lcov text. Use lcovcheck: Please's coverage.json for the per-file coverage, and the shared lcov parser for line statuses and function hits of the exported report. Item 4 of #66. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/ci-rust.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-rust.yml b/.github/workflows/ci-rust.yml index 957f66d..871c469 100644 --- a/.github/workflows/ci-rust.yml +++ b/.github/workflows/ci-rust.yml @@ -69,18 +69,20 @@ jobs: - name: Coverage smoke test (lib_test) run: | - ./pleasew --plain_output cover //test/rust/lib:lib_test 2>&1 | tee cover.log - grep -Eq '^\s+lib\.rs [1-9][0-9]*/' cover.log + ./pleasew --plain_output build //tools/common/lcovcheck + ./pleasew --plain_output cover //test/rust/lib:lib_test + plz-out/bin/tools/common/lcovcheck/lcovcheck -coverage-json plz-out/log/coverage.json -covered test/rust/lib/lib.rs env: VERITAS_NO_HOOK: "1" - name: Raw lcov export smoke test (functions and branches) run: | - ./pleasew --plain_output cover --rerun //test/rust/branches:branches_test 2>&1 | tee cover.log - f="plz-out/bin/test/rust/branches/branches_test.lcov" - grep -q '^SF:test/rust/branches/branches\.rs$' "$f" - grep -Eq '^FNDA:0,.*unused$' "$f" - grep -q '^BRDA:12,0,0,0$' "$f" - grep -Eq '^FNDA:2,.*classify$' "$f" + ./pleasew --plain_output build //tools/common/lcovcheck + ./pleasew --plain_output cover --rerun //test/rust/branches:branches_test + plz-out/bin/tools/common/lcovcheck/lcovcheck \ + -lcov plz-out/bin/test/rust/branches/branches_test.lcov \ + -path test/rust/branches/branches.rs \ + -line 12=partial -line 5=uncovered \ + -function unused=missed -function classify=2 env: VERITAS_NO_HOOK: "1"