diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 29a632c949f3753b0ea1f7c6ef31c5a9dfbb9307..dba8308fb6c924dbd1176545600cbfa28bd0d5a7 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 fbbd6c7d61b145c3ec46b3d8d69920a4cc97e207..d3cb4033412bfe9d7bc7005f6222c1baafb904f5 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__":