Skip to content

Commit

Permalink
ci: Rerun pytest tests on main in case of failures (mamba-org#3769)
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Jerphanion <[email protected]>
Co-authored-by: Johan Mabille <[email protected]>
Co-authored-by: Hind Montassif <[email protected]>
  • Loading branch information
3 people authored and SandrineP committed Feb 6, 2025
1 parent fd4116d commit 109b47f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/unix_impl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/windows_impl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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' || '' }}
1 change: 1 addition & 0 deletions dev/environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dependencies:
- pytest-asyncio
- pytest-timeout
- pytest-xprocess
- pytest-rerunfailures
- memory_profiler
- requests
- sel(win): pywin32
Expand Down

0 comments on commit 109b47f

Please sign in to comment.