ci: Add pytest-rerunfailures for improved test reliability (#6852)

* chore: Add pytest-rerunfailures plugin for test reliability

* ci: Update unit tests workflow with pytest-rerunfailures
This commit is contained in:
Gabriel Luiz Freitas Almeida 2025-02-26 16:34:55 -03:00 committed by GitHub
commit 85b2818ea0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 4 deletions

View file

@ -60,7 +60,7 @@ jobs:
with:
timeout_minutes: 12
max_attempts: 2
command: make unit_tests async=false args="-x -vv --splits ${{ matrix.splitCount }} --group ${{ matrix.group }}"
command: make unit_tests args="-x -vv --splits ${{ matrix.splitCount }} --group ${{ matrix.group }} --reruns 5"
- name: Minimize uv cache
run: uv cache prune --ci
integration-tests:

View file

@ -155,6 +155,7 @@ dev = [
"codeflash>=0.8.4",
"hypothesis>=6.123.17",
"locust>=2.32.9",
"pytest-rerunfailures>=15.0",
]
[tool.uv.sources]

18
uv.lock generated
View file

@ -1,5 +1,4 @@
version = 1
revision = 1
requires-python = ">=3.10, <3.14"
resolution-markers = [
"python_full_version >= '3.13'",
@ -4386,6 +4385,7 @@ dev = [
{ name = "pytest-instafail" },
{ name = "pytest-mock" },
{ name = "pytest-profiling" },
{ name = "pytest-rerunfailures" },
{ name = "pytest-split" },
{ name = "pytest-sugar" },
{ name = "pytest-xdist" },
@ -4514,7 +4514,6 @@ requires-dist = [
{ name = "youtube-transcript-api", specifier = "==0.6.3" },
{ name = "zep-python", specifier = "==2.0.2" },
]
provides-extras = ["deploy", "couchbase", "cassio", "local", "clickhouse-connect", "nv-ingest"]
[package.metadata.requires-dev]
dev = [
@ -4539,6 +4538,7 @@ dev = [
{ name = "pytest-instafail", specifier = ">=0.5.0" },
{ name = "pytest-mock", specifier = ">=3.14.0" },
{ name = "pytest-profiling", specifier = ">=1.7.0" },
{ name = "pytest-rerunfailures", specifier = ">=15.0" },
{ name = "pytest-split", specifier = ">=0.9.0" },
{ name = "pytest-sugar", specifier = ">=1.0.0" },
{ name = "pytest-xdist", specifier = ">=3.6.0" },
@ -4765,7 +4765,6 @@ requires-dist = [
{ name = "uvicorn", specifier = ">=0.30.0,<1.0.0" },
{ name = "validators", specifier = ">=0.34.0" },
]
provides-extras = ["deploy", "local", "all"]
[package.metadata.requires-dev]
dev = [
@ -7658,6 +7657,19 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/e3/ac/c428c66241a144617a8af7a28e2e055e1438d23b949b62ac4b401a69fb79/pytest_profiling-1.8.1-py3-none-any.whl", hash = "sha256:3dd8713a96298b42d83de8f5951df3ada3e61b3e5d2a06956684175529e17aea", size = 9929 },
]
[[package]]
name = "pytest-rerunfailures"
version = "15.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "packaging" },
{ name = "pytest" },
]
sdist = { url = "https://files.pythonhosted.org/packages/26/47/ec4e12f45f4b9fac027a41ccaabb353ed4f23695aae860258ba11a84ed9b/pytest-rerunfailures-15.0.tar.gz", hash = "sha256:2d9ac7baf59f4c13ac730b47f6fa80e755d1ba0581da45ce30b72fb3542b4474", size = 21816 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/89/37/54e5ffc7c0cebee7cf30a3ac5915faa7e7abf8bdfdf3228c277f7c192489/pytest_rerunfailures-15.0-py3-none-any.whl", hash = "sha256:dd150c4795c229ef44320adc9a0c0532c51b78bb7a6843a8c53556b9a611df1a", size = 13017 },
]
[[package]]
name = "pytest-socket"
version = "0.7.0"