chore: use pytest-rerunfailed (#2205)

I first thought about marking test as flaky one by one, but my
impression is mainly all playwright test can become flacky, and we
actually only see some as their appear in the list.
This commit is contained in:
Yohan Boniface 2024-10-10 19:48:54 +02:00 committed by GitHub
commit 8635ebf330
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 2 additions and 13 deletions

View file

@ -58,7 +58,7 @@ publish: ## Publish the Python package to Pypi
test: testpy testjs test: testpy testjs
testpy: testpy:
pytest -vv umap/tests/ --dist=loadgroup pytest -vv umap/tests/ --dist=loadgroup --reruns 1
test-integration: test-integration:
pytest -xv umap/tests/integration/ --dist=loadgroup pytest -xv umap/tests/integration/ --dist=loadgroup

View file

@ -61,6 +61,7 @@ test = [
"pytest==8.3.3", "pytest==8.3.3",
"pytest-django==4.9.0", "pytest-django==4.9.0",
"pytest-playwright==0.5.2", "pytest-playwright==0.5.2",
"pytest-rerunfailures==14.0",
"pytest-xdist>=3.5.0,<4", "pytest-xdist>=3.5.0,<4",
] ]
docker = [ docker = [

View file

@ -55,10 +55,6 @@ def test_should_honour_fromZoom(live_server, map, datalayer, page):
expect(markers).to_be_visible() expect(markers).to_be_visible()
@pytest.mark.skipif(
os.environ.get("CI", "false") == "true",
reason="Test is failing intermittently, skipping in the CI",
)
def test_should_honour_toZoom(live_server, map, datalayer, page): def test_should_honour_toZoom(live_server, map, datalayer, page):
set_options(datalayer, displayOnLoad=True, toZoom=6) set_options(datalayer, displayOnLoad=True, toZoom=6)
page.goto(f"{live_server.url}{map.get_absolute_url()}#7/48.55/14.68") page.goto(f"{live_server.url}{map.get_absolute_url()}#7/48.55/14.68")

View file

@ -71,10 +71,6 @@ def test_umap_import_from_file(live_server, tilelayer, page):
expect(nonloaded).to_have_count(1) expect(nonloaded).to_have_count(1)
@pytest.mark.skipif(
os.environ.get("CI", "false") == "true",
reason="Test is failing intermittently, skipping in the CI",
)
def test_umap_import_from_textarea(live_server, tilelayer, page, settings): def test_umap_import_from_textarea(live_server, tilelayer, page, settings):
settings.UMAP_ALLOW_ANONYMOUS = True settings.UMAP_ALLOW_ANONYMOUS = True
page.goto(f"{live_server.url}/map/new/") page.goto(f"{live_server.url}/map/new/")

View file

@ -148,10 +148,6 @@ def test_default_view_latest_with_polygon(map, live_server, page):
expect(layers).to_have_count(1) expect(layers).to_have_count(1)
@pytest.mark.skipif(
os.environ.get("CI", "false") == "true",
reason="Test is failing intermittently, skipping in the CI",
)
def test_default_view_locate(browser, live_server, map): def test_default_view_locate(browser, live_server, map):
context = browser.new_context( context = browser.new_context(
geolocation={"longitude": 8.52967, "latitude": 39.16267}, geolocation={"longitude": 8.52967, "latitude": 39.16267},