Skip to content

Commit 3e7f1d2

Browse files
authored
bug(test-deploy): Add retries for deploy tests (#1392)
1 parent f9f29e7 commit 3e7f1d2

File tree

10 files changed

+77
-9
lines changed

10 files changed

+77
-9
lines changed

tests/playwright/deploys/express-accordion/test_deploys_express_accordion.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
import pytest
12
from controls import Accordion
23
from playwright.sync_api import Page
3-
from utils.deploy_utils import create_deploys_app_url_fixture, skip_if_not_chrome
4+
from utils.deploy_utils import (
5+
create_deploys_app_url_fixture,
6+
reruns,
7+
reruns_delay,
8+
skip_if_not_chrome,
9+
)
410

511
app_url = create_deploys_app_url_fixture("shiny_express_accordion")
612

713

814
@skip_if_not_chrome
15+
@pytest.mark.flaky(reruns=reruns, reruns_delay=reruns_delay)
916
def test_express_accordion(page: Page, app_url: str) -> None:
1017
page.goto(app_url)
1118

tests/playwright/deploys/express-dataframe/test_deploys_express_dataframe.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
import pytest
12
from controls import OutputDataFrame
23
from playwright.sync_api import Page
3-
from utils.deploy_utils import create_deploys_app_url_fixture, skip_if_not_chrome
4+
from utils.deploy_utils import (
5+
create_deploys_app_url_fixture,
6+
reruns,
7+
reruns_delay,
8+
skip_if_not_chrome,
9+
)
410

511
app_url = create_deploys_app_url_fixture("shiny-express-dataframe")
612

713

814
@skip_if_not_chrome
15+
@pytest.mark.flaky(reruns=reruns, reruns_delay=reruns_delay)
916
def test_express_dataframe_deploys(page: Page, app_url: str) -> None:
1017
page.goto(app_url)
1118

tests/playwright/deploys/express-folium/test_deploys_express_folium.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
import pytest
12
from playwright.sync_api import Page, expect
2-
from utils.deploy_utils import create_deploys_app_url_fixture, skip_if_not_chrome
3+
from utils.deploy_utils import (
4+
create_deploys_app_url_fixture,
5+
reruns,
6+
reruns_delay,
7+
skip_if_not_chrome,
8+
)
39

410
app_url = create_deploys_app_url_fixture("shiny-express-folium")
511

612

713
@skip_if_not_chrome
14+
@pytest.mark.flaky(reruns=reruns, reruns_delay=reruns_delay)
815
def test_folium_map(page: Page, app_url: str) -> None:
916
page.goto(app_url)
1017

tests/playwright/deploys/express-page_default/test_deploys_express_page_default.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1+
import pytest
12
from controls import LayoutNavsetTab
23
from playwright.sync_api import Page, expect
3-
from utils.deploy_utils import create_deploys_app_url_fixture, skip_if_not_chrome
4+
from utils.deploy_utils import (
5+
create_deploys_app_url_fixture,
6+
reruns,
7+
reruns_delay,
8+
skip_if_not_chrome,
9+
)
410

511
TIMEOUT = 2 * 60 * 1000
612

713
app_url = create_deploys_app_url_fixture("shiny_express_page_default")
814

915

1016
@skip_if_not_chrome
17+
@pytest.mark.flaky(reruns=reruns, reruns_delay=reruns_delay)
1118
def test_page_default(page: Page, app_url: str) -> None:
1219
page.goto(app_url)
1320

tests/playwright/deploys/express-page_fillable/test_deploys_express_page_fillable.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
import pytest
12
from controls import Card, OutputTextVerbatim
23
from playwright.sync_api import Page
3-
from utils.deploy_utils import create_deploys_app_url_fixture, skip_if_not_chrome
4+
from utils.deploy_utils import (
5+
create_deploys_app_url_fixture,
6+
reruns,
7+
reruns_delay,
8+
skip_if_not_chrome,
9+
)
410

511
app_url = create_deploys_app_url_fixture("express_page_fillable")
612

713

814
@skip_if_not_chrome
15+
@pytest.mark.flaky(reruns=reruns, reruns_delay=reruns_delay)
916
def test_express_page_fillable(page: Page, app_url: str) -> None:
1017
page.goto(app_url)
1118

tests/playwright/deploys/express-page_fluid/test_deploys_express_page_fluid.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
import pytest
12
from controls import Card, OutputTextVerbatim
23
from playwright.sync_api import Page
3-
from utils.deploy_utils import create_deploys_app_url_fixture, skip_if_not_chrome
4+
from utils.deploy_utils import (
5+
create_deploys_app_url_fixture,
6+
reruns,
7+
reruns_delay,
8+
skip_if_not_chrome,
9+
)
410

511
app_url = create_deploys_app_url_fixture("express_page_fluid")
612

713

814
@skip_if_not_chrome
15+
@pytest.mark.flaky(reruns=reruns, reruns_delay=reruns_delay)
916
def test_express_page_fluid(page: Page, app_url: str) -> None:
1017
page.goto(app_url)
1118

tests/playwright/deploys/express-page_sidebar/test_deploys_express_page_sidebar.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
import pytest
12
from controls import OutputTextVerbatim, Sidebar
23
from playwright.sync_api import Page
3-
from utils.deploy_utils import create_deploys_app_url_fixture, skip_if_not_chrome
4+
from utils.deploy_utils import (
5+
create_deploys_app_url_fixture,
6+
reruns,
7+
reruns_delay,
8+
skip_if_not_chrome,
9+
)
410

511
app_url = create_deploys_app_url_fixture("express_page_sidebar")
612

713

814
@skip_if_not_chrome
15+
@pytest.mark.flaky(reruns=reruns, reruns_delay=reruns_delay)
916
def test_express_page_sidebar(page: Page, app_url: str) -> None:
1017
page.goto(app_url)
1118

tests/playwright/deploys/plotly/test_plotly_app.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
import pytest
12
from playwright.sync_api import Page, expect
2-
from utils.deploy_utils import create_deploys_app_url_fixture, skip_if_not_chrome
3+
from utils.deploy_utils import (
4+
create_deploys_app_url_fixture,
5+
reruns,
6+
reruns_delay,
7+
skip_if_not_chrome,
8+
)
39

410
TIMEOUT = 2 * 60 * 1000
511
app_url = create_deploys_app_url_fixture("example_deploy_app_A")
612

713

814
@skip_if_not_chrome
15+
@pytest.mark.flaky(reruns=reruns, reruns_delay=reruns_delay)
916
def test_deploys(page: Page, app_url: str) -> None:
1017
page.goto(app_url)
1118

tests/playwright/deploys/shiny-client-console-error/test_shiny_client_error.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
import pytest
12
from playwright.sync_api import Page, expect
2-
from utils.deploy_utils import create_deploys_app_url_fixture, skip_if_not_chrome
3+
from utils.deploy_utils import (
4+
create_deploys_app_url_fixture,
5+
reruns,
6+
reruns_delay,
7+
skip_if_not_chrome,
8+
)
39

410
app_url = create_deploys_app_url_fixture("shiny_client_console_error")
511

612

713
@skip_if_not_chrome
14+
@pytest.mark.flaky(reruns=reruns, reruns_delay=reruns_delay)
815
def test_shiny_client_console_error(page: Page, app_url: str) -> None:
916
page.goto(app_url)
1017

tests/playwright/utils/deploy_utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55
import shutil
66
import subprocess
7+
import sys
78
import tempfile
89
import time
910
from typing import Any, Callable, TypeVar
@@ -12,6 +13,10 @@
1213
import requests
1314
from conftest import ScopeName, local_app_fixture_gen
1415

16+
is_interactive = hasattr(sys, "ps1")
17+
reruns = 1 if is_interactive else 3
18+
reruns_delay = 1
19+
1520
LOCAL_LOCATION = "local"
1621

1722
__all__ = (

0 commit comments

Comments
 (0)