diff options
| author | Ermoshkin Artem <[email protected]> | 2026-06-22 15:41:48 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-06-22 15:41:48 +0300 |
| commit | 3861cad593aff334ab64cb90d3ee87c4cf2dbf1b (patch) | |
| tree | 41e116362b7731ea0ce3c87aa6964dff95f8b0bd /.github/scripts/tests | |
| parent | 60a0ebeccb383a7d0417a5dc16590dee7521a67c (diff) | |
final coverage issue fix (#44164)
Co-authored-by: Artem Ermoshkin <[email protected]>
Diffstat (limited to '.github/scripts/tests')
| -rwxr-xr-x | .github/scripts/tests/compare_cpp_sdk_coverage.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/.github/scripts/tests/compare_cpp_sdk_coverage.py b/.github/scripts/tests/compare_cpp_sdk_coverage.py index 99dc6aa6693..a47428a65ca 100755 --- a/.github/scripts/tests/compare_cpp_sdk_coverage.py +++ b/.github/scripts/tests/compare_cpp_sdk_coverage.py @@ -9,7 +9,11 @@ TOLERANCE = 0.1 # percentage points def line_pct(report_dir: str) -> float: html = (Path(report_dir) / "index.html").read_text(encoding="utf-8", errors="replace") - match = re.search(r"Lines:</td>\s*<td[^>]*>([\d.]+)\s*%", html, re.I) + # New ya/llvm-cov HTML: "Overall coverage" table, project row, "Lines, %" column. + match = re.search(r"<div>project</div></td><td[^>]*>.*?>([\d.]+)%", html, re.S) + if not match: + # Legacy llvm-cov HTML summary row. + match = re.search(r"Lines:</td>\s*<td[^>]*>([\d.]+)\s*%", html, re.I) if not match: raise SystemExit(f"line coverage not found in {report_dir}/index.html") return float(match.group(1)) |
