Skip to content

Commit

Permalink
ci: Add the ability to automatically rerun failed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaokang2022 committed Jan 9, 2025
1 parent 2e666d1 commit 578ca7c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
python-version: 3.13

- name: Install the GUI environment (ubuntu only)
- name: Install the GUI environment (Ubuntu only)
if: runner.os == 'Linux'
run: |
sudo apt-get update
Expand All @@ -30,6 +30,7 @@ jobs:
run: |
pip install pytest
pip install pytest-cov
pip install pytest-rerunfailures
pip install .[opt]
pytest --cov --cov-report=xml --junitxml=junit.xml
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install the GUI environment (ubuntu only)
- name: Install the GUI environment (Ubuntu only)
if: runner.os == 'Linux'
run: |
sudo apt-get update
Expand All @@ -36,10 +36,11 @@ jobs:
- name: Install dependencies
run: |
pip3 install --upgrade pip
pip3 install pylint
pip3 install pytest
pip3 install .[opt]
pip install --upgrade pip
pip install pylint
pip install pytest
pip install pytest-rerunfailures
pip install .[opt]
- name: Lint with pylint
run: pylint $(git ls-files "*.py")
Expand Down
18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ dependencies = ["typing_extensions"]

[project.optional-dependencies]
opt = [
"darkdetect==0.8.0; platform_system != 'Darwin'",
"darkdetect==0.8.0",
"darkdetect[macos-listener]==0.8.0; platform_system == 'Darwin'",
"pywinstyles==1.8; platform_system == 'Windows'",
"hPyT==1.3.7; platform_system == 'Windows'",
"win32material==1.0.6; platform_system == 'Windows'",
"pywinstyles==1.8; platform_system == 'Windows'",
"hPyT==1.3.7; platform_system == 'Windows'",
"win32material==1.0.6; platform_system == 'Windows'",
"pillow>=10.0.0",
]
ext = ["tkintertools-mpl", "tkintertools-3d", "tkintertools-media"]
all = [
"darkdetect==0.8.0; platform_system != 'Darwin'",
"darkdetect==0.8.0",
"darkdetect[macos-listener]==0.8.0; platform_system == 'Darwin'",
"pywinstyles==1.8; platform_system == 'Windows'",
"hPyT==1.3.7; platform_system == 'Windows'",
"win32material==1.0.6; platform_system == 'Windows'",
"pywinstyles==1.8; platform_system == 'Windows'",
"hPyT==1.3.7; platform_system == 'Windows'",
"win32material==1.0.6; platform_system == 'Windows'",
"pillow>=10.0.0",
"tkintertools-mpl",
"tkintertools-3d",
Expand Down Expand Up @@ -67,4 +67,4 @@ fail-under = 9
disable = 'line-too-long'

[tool.pytest.ini_options]
addopts = ["--color=yes"]
addopts = ["--color=yes", "--reruns=3"]

0 comments on commit 578ca7c

Please sign in to comment.