From e6b2993984a0cda982c3ac40e4c3bf622fce105c Mon Sep 17 00:00:00 2001 From: Hubert Kario Date: Mon, 8 Apr 2024 19:42:52 +0200 Subject: [PATCH] don't check rate if no tests executed --- .github/workflows/ci.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8636078..0477f75a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -268,7 +268,8 @@ jobs: - name: Install mutation testing dependencies if: ${{ matrix.mutation == 'true' }} run: | - pip install https://github.com/sixty-north/cosmic-ray/archive/master.zip + #pip install https://github.com/sixty-north/cosmic-ray/archive/master.zip + pip install https://github.com/tomato42/cosmic-ray/archive/no-executed.zip pip install pytest-timeout - name: Display installed python package versions run: pip list @@ -329,8 +330,12 @@ jobs: - name: Check test coverage for PR if: ${{ matrix.mutation == 'true' && github.event.pull_request }} run: | - # check if executed have at most 50% survival rate - cr-rate --estimate --confidence 99.9 --fail-over 50 session-vs-master.sqlite + # only check if we have executed tests (if no code changes, the + # cr-rate will fail) + if ! $( cr-report session-vs-master.sqlite | tail -n 3 | grep -q 'complete.*100.00%' ); then + # check if executed have at most 50% survival rate + cr-rate --estimate --confidence 99.9 --fail-over 50 session-vs-master.sqlite + fi - name: instrumental test coverage on PR if: ${{ contains(matrix.opt-deps, 'instrumental') && github.event.pull_request }} env: @@ -417,7 +422,8 @@ jobs: key: sessions-${{ github.sha }} - name: Install cosmic-ray run: | - pip3 install https://github.com/sixty-north/cosmic-ray/archive/master.zip + #pip3 install https://github.com/sixty-north/cosmic-ray/archive/master.zip + pip3 install https://github.com/tomato42/cosmic-ray/archive/no-executed.zip pip install pytest-timeout - name: Install dependencies run: | @@ -493,7 +499,8 @@ jobs: - name: Install build dependencies run: | pip install -r build-requirements.txt - pip install https://github.com/sixty-north/cosmic-ray/archive/master.zip + #pip install https://github.com/sixty-north/cosmic-ray/archive/master.zip + pip install https://github.com/tomato42/cosmic-ray/archive/no-executed.zip pip install pytest-timeout - name: Run mutation testing run: | @@ -641,7 +648,8 @@ jobs: key: sessions-${{ github.sha }}-19-done - name: Install cosmic-ray run: | - pip3 install https://github.com/sixty-north/cosmic-ray/archive/master.zip + #pip3 install https://github.com/sixty-north/cosmic-ray/archive/master.zip + pip3 install https://github.com/tomato42/cosmic-ray/archive/no-executed.zip pip install pytest-timeout - name: Install dependencies run: |