Skip to content

Commit

Permalink
Use pytest-rerunfailures to rerun flaky tests
Browse files Browse the repository at this point in the history
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
  • Loading branch information
hakonanes committed Nov 1, 2023
1 parent 69b644a commit 542da6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ on:
workflow_dispatch:
workflow: '*'

env:
MPLBACKEND: agg

jobs:
code:
name: code style
Expand Down Expand Up @@ -53,6 +50,9 @@ jobs:
name: ${{ matrix.os }}-py${{ matrix.python-version }}${{ matrix.LABEL }}
runs-on: ${{ matrix.os }}
timeout-minutes: 15
env:
MPLBACKEND: agg
PYTEST_ARGS: --pyargs kikuchipy --reruns 2 -n 2 --cov=kikuchipy
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -120,12 +120,12 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install xvfb
xvfb-run pytest -n 2 --cov=kikuchipy --pyargs kikuchipy
xvfb-run pytest ${{ env.PYTEST_ARGS }}
- name: Run tests on Windows or macOS
if: ${{ matrix.os != 'ubuntu-latest' }}
run: |
pytest -n 2 --cov=kikuchipy --pyargs kikuchipy
pytest ${{ env.PYTEST_ARGS }}
- name: Generate line coverage
run: |
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"pytest >= 5.4",
"pytest-benchmark",
"pytest-cov >= 2.8.1",
"pytest-rerunfailures",
"pytest-xdist",
],
"all": [
Expand Down

0 comments on commit 542da6c

Please sign in to comment.