ci: Rerun pytest tests on `main` in case of failures (#3769)

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Johan Mabille <johan.mabille@gmail.com>
Co-authored-by: Hind Montassif <hind.montassif@gmail.com>
This commit is contained in:
Julien Jerphanion 2025-02-04 09:16:30 +02:00 committed by GitHub
parent 9b6be1ce60
commit 8781dcc82e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 5 deletions

View File

@ -107,7 +107,10 @@ jobs:
python -m pip install --no-deps --no-build-isolation ./libmambapy
- name: Run libmamba Python bindings tests
run: |
python -m pytest libmambapy/tests/ ${{ runner.debug == 'true' && '-v' || '--exitfirst' }}
# Only rerun flaky tests on the `main` branch
python -m pytest libmambapy/tests/ \
${{ runner.debug == 'true' && '-v --capture=tee-sys' || '--exitfirst' }} \
${{ github.ref == 'refs/heads/main' && '--reruns 3' || '' }}
mamba_integration_tests_unix:
name: mamba integration tests
@ -162,8 +165,10 @@ jobs:
run: |
export TEST_MAMBA_EXE=$(pwd)/build/micromamba/mamba
unset CONDARC # Interferes with tests
# Only rerun flaky tests on the `main` branch
python -m pytest micromamba/tests/ \
${{ runner.debug == 'true' && '-v --capture=tee-sys' || '--exitfirst' }}
${{ runner.debug == 'true' && '-v --capture=tee-sys' || '--exitfirst' }} \
${{ github.ref == 'refs/heads/main' && '--reruns 3' || '' }}
verify_pkg_tests:
name: mamba-content-trust tests

View File

@ -116,7 +116,10 @@ jobs:
python -m pip install --no-deps --no-build-isolation ./libmambapy
- name: Run libmamba Python bindings tests
run: |
python -m pytest libmambapy/tests/ ${{ runner.debug == 'true' && '-v' || '--exitfirst' }}
# Only rerun flaky tests on the `main` branch
python -m pytest libmambapy/tests/ \
${{ runner.debug == 'true' && '-v --capture=tee-sys' || '--exitfirst' }} \
${{ github.ref == 'refs/heads/main' && '--reruns 3' || '' }}
mamba_integration_tests_win:
name: mamba integration tests
@ -149,5 +152,7 @@ jobs:
$env:TEST_MAMBA_EXE = Join-Path -Path $pwd -ChildPath 'local\bin\mamba.exe'
$env:MAMBA_TEST_SHELL_TYPE='powershell'
Remove-Item -Path "env:CONDARC"
python -m pytest micromamba/tests/ `
${{ runner.debug == 'true' && '-v --capture=tee-sys' || '--exitfirst' }}
# Only rerun flaky tests on the `main` branch
python -m pytest micromamba/tests/ \
${{ runner.debug == 'true' && '-v --capture=tee-sys' || '--exitfirst' }} \
${{ github.ref == 'refs/heads/main' && '--reruns 3' || '' }}

View File

@ -31,6 +31,7 @@ dependencies:
- pytest-asyncio
- pytest-timeout
- pytest-xprocess
- pytest-rerunfailures
- memory_profiler
- requests
- sel(win): pywin32