From 535060c95b606f0c043e02a4688b4bda6f162996 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Thu, 1 Dec 2022 17:47:14 +0100 Subject: test: only rerun the failed tests in CI This patch simplifies attempting to execute the tests again on failures in CI. It also limits the scope of the tests being rerun to include only those that failed on the first try. Additionally, it enables the maximum verbosity so that the retry is more useful for troubleshooting. --- .github/workflows/testsuite.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index f343d383..30b83856 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -74,23 +74,14 @@ jobs: # python -c "import urllib.request as r; exec(r.urlopen('https://bit.ly/pydoctor').read())" - name: "Run tox for ${{ matrix.python-version }}" - continue-on-error: true - id: tox1 run: | python -m tox -- -rfsEX - name: "Retry tox for ${{ matrix.python-version }}" - id: tox2 - if: steps.tox1.outcome == 'failure' + if: failure() run: | - python -m tox -- -rfsEX - - - name: "Set status" - if: always() - run: | - if ${{ steps.tox1.outcome != 'success' && steps.tox2.outcome != 'success' }}; then - exit 1 - fi + # `exit 1` makes sure that the job remains red with flaky runs + python -m tox -- -rfsEX --lf -vvvvv && exit 1 # This job aggregates test results. It's the required check for branch protection. # https://github.com/marketplace/actions/alls-green#why -- cgit v1.2.1