From d57e489bb3cef84060e8ce4d4119e94dccdbf34e Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Fri, 19 Dec 2025 13:55:32 +0100 Subject: [PATCH] chore: Fix regexp so that badge can read the value --- .gitlab-ci.yml | 2 +- scripts/print_instruction_coverage.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 29a632c94..dba8308fb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,7 +47,7 @@ test: script: - ./gradlew test jacocoDebugReport -PtestAccountName="$testAccountName" -PtestAccountPwd="$testAccountPwd" -PtestServerUrl="$testServerUrl" - python3 scripts/print_instruction_coverage.py app/build/reports/jacoco/jacocoDebugReport/jacocoDebugReport.xml - coverage: '/INSTRUCTION_COVERAGE\\s+([0-9]{1,3}\\.?[0-9]*)%/' + coverage: '/Total.*?([0-9]{1,3})%/' artifacts: when: always paths: diff --git a/scripts/print_instruction_coverage.py b/scripts/print_instruction_coverage.py index fbbd6c7d6..d3cb40334 100644 --- a/scripts/print_instruction_coverage.py +++ b/scripts/print_instruction_coverage.py @@ -12,7 +12,8 @@ def main() -> None: covered_count = int(instruction_counter.attrib["covered"]) total_instructions = covered_count + missed_count coverage_pct = covered_count / total_instructions * 100 if total_instructions else 0 - print(f"INSTRUCTION_COVERAGE {coverage_pct:.2f}%") + coverage_pct_rounded = round(coverage_pct) + print(f"Total {coverage_pct_rounded}%") if __name__ == "__main__": -- GitLab