From 60572d03fa3668f85f88dbe1292047861f43fee2 Mon Sep 17 00:00:00 2001 From: HgO Date: Wed, 17 Apr 2024 16:41:46 +0200 Subject: [PATCH] make pipeline fail if code coverage < 75% --- .gitlab-ci.yml | 2 +- pytest.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9b50477..4062a10 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -69,7 +69,7 @@ tests: coverage_format: cobertura path: coverage.xml junit: report.xml - coverage: '/^TOTAL\s+\d+\s+\d+\s+([\d\.]+\%)$/' + coverage: '/Total coverage: ([\d\.]+\%)$/' needs: - job: linting artifacts: false diff --git a/pytest.ini b/pytest.ini index d8ec868..28ff9b3 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,3 +1,3 @@ [pytest] asyncio_mode=strict -addopts=--cov=matrix_alertbot --cov-report=lcov:lcov.info --cov-report=xml:coverage.xml --cov-report=term +addopts=--cov=matrix_alertbot --cov-report=lcov:lcov.info --cov-report=xml:coverage.xml --cov-report=term --cov-fail-under=75