From 0d7726acd9fa5605e679148b4a65b92d20f3a926 Mon Sep 17 00:00:00 2001 From: HgO Date: Wed, 17 Apr 2024 16:30:09 +0200 Subject: [PATCH] fix code coverage report --- .gitignore | 1 + .gitlab-ci.yml | 5 +++-- pytest.ini | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index aa47cc9..a16caff 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ _version.py .coverage coverage.xml coverage.lcov +lcov.info diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 22c6637..9b50477 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -60,7 +60,7 @@ tests: stage: test script: - apk add --no-cache libstdc++ - - pytest + - pytest --junitxml report.xml cache: policy: pull artifacts: @@ -68,7 +68,8 @@ tests: coverage_report: coverage_format: cobertura path: coverage.xml - coverage: '/^TOTAL\s+\d+\s+\d+\s+(\d+(\.\d+)?\%)$/' + junit: report.xml + coverage: '/^TOTAL\s+\d+\s+\d+\s+([\d\.]+\%)$/' needs: - job: linting artifacts: false diff --git a/pytest.ini b/pytest.ini index 336a0d5..13c14e9 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,3 +1,3 @@ [pytest] asyncio_mode=strict -addopts=--cov=matrix_alertbot --cov-report=xml:coverage.xml --cov-report=term +addopts=--cov=matrix_alertbot --cov-report=lcov:lcov.info --cov-report=coverage.xml --cov-report=term