Skip to content

Commit 24013f4

Browse files
authored
CI(deploy): Add more installation configs to surface failure cause (posit-dev#1658)
1 parent ed56097 commit 24013f4

File tree

12 files changed

+170
-48
lines changed

12 files changed

+170
-48
lines changed

.github/workflows/deploy-tests.yaml

Lines changed: 84 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,63 @@ jobs:
99
playwright-deploys:
1010
# Only allow one `playwright-deploys` job to run at a time. (Independent of branch / PR)
1111
# Only one is allowed to run at a time because it is deploying to the same server location.
12-
concurrency: playwright-deploys
12+
concurrency: playwright-deploys-${{ matrix.config.name }}
1313
runs-on: ${{ matrix.os }}
14+
name: ${{ matrix.config.name }}
1415
strategy:
1516
matrix:
1617
# Matches deploy server python version
1718
python-version: ["3.10"]
1819
os: [ubuntu-latest]
20+
config:
21+
# Released server, shiny, and rsconnect
22+
- name: "pypi-shiny-rsconnect-connect"
23+
released_connect_server: true
24+
pypi_shiny: true
25+
pypi_rsconnect: true
26+
base_test_dir: "./tests/playwright/deploys/express-page_sidebar"
27+
app_name: "pypi-shiny-rsconnect"
28+
test_shinyappsio: false
29+
30+
# Released shiny and rsconnect
31+
# Dev server
32+
- name: "pypi-shiny-rsconnect-dogfood"
33+
released_connect_server: false
34+
pypi_shiny: true
35+
pypi_rsconnect: true
36+
base_test_dir: "./tests/playwright/deploys/express-page_sidebar"
37+
app_name: "pypi-shiny-rsconnect"
38+
test_shinyappsio: false
39+
40+
# Released shiny
41+
# Dogfood server and rsconnect
42+
- name: "pypi-shiny-dev-rsconnect-dogfood"
43+
released_connect_server: false
44+
pypi_shiny: true
45+
pypi_rsconnect: false
46+
base_test_dir: "./tests/playwright/deploys/express-page_sidebar"
47+
app_name: "pypi-shiny-dev-rsconnect"
48+
test_shinyappsio: false
49+
50+
# GitHub shiny v1.0.0 - test if github packages can be installed
51+
# Dogfood server and rsconnect
52+
- name: "github-shiny-dev-rsconnect-dogfood"
53+
released_connect_server: false
54+
github_shiny: true
55+
pypi_shiny: false
56+
pypi_rsconnect: false
57+
base_test_dir: "./tests/playwright/deploys/express-page_sidebar"
58+
app_name: "pypi-shiny-dev-rsconnect"
59+
test_shinyappsio: false
60+
61+
# Dev server, shiny, and rsconnect
62+
- name: "dev-shiny-rsconnect-dogfood"
63+
released_connect_server: false
64+
pypi_shiny: false
65+
pypi_rsconnect: false
66+
base_test_dir: "./tests/playwright/deploys"
67+
test_shinyappsio: true
68+
1969
fail-fast: false
2070

2171
steps:
@@ -27,7 +77,24 @@ jobs:
2777
with:
2878
python-version: ${{ matrix.python-version }}
2979

30-
- name: Install rsconnect
80+
- name: Install pypi shiny and htmltools (uninstall GitHub versions)
81+
if: ${{ matrix.config.pypi_shiny }}
82+
run: |
83+
uv pip uninstall shiny htmltools
84+
uv pip install shiny htmltools
85+
86+
- name: Install GitHub shiny@v1.0.0 and htmltools@v0.5.3 (uninstall PyPI versions)
87+
if: ${{ matrix.config.github_shiny }}
88+
run: |
89+
uv pip uninstall shiny htmltools
90+
uv pip install "htmltools @ git+https://github.com/posit-dev/py-htmltools.git@v0.5.3" "shiny @ git+https://github.com/posit-dev/py-shiny.git@v1.0.0"
91+
92+
- name: Install rsconnect (PyPI)
93+
if: ${{ matrix.config.pypi_rsconnect }}
94+
run: |
95+
uv pip install rsconnect
96+
- name: Install rsconnect (GitHub)
97+
if: ${{ ! matrix.config.pypi_rsconnect }}
3198
run: |
3299
make ci-install-rsconnect
33100
@@ -36,25 +103,27 @@ jobs:
36103
env:
37104
DEPLOY_APPS: "false"
38105
run: |
39-
make playwright-deploys SUB_FILE=". -vv"
106+
make playwright-deploys TEST_FILE="${{ matrix.config.base_test_dir }} -vv"
40107
41108
- name: Deploy apps and run tests (on `push` or `deploy**` branches)
42109
env:
43110
DEPLOY_APPS: "true"
44-
DEPLOY_CONNECT_SERVER_URL: "https://rsc.radixu.com/"
45-
DEPLOY_CONNECT_SERVER_API_KEY: "${{ secrets.DEPLOY_CONNECT_SERVER_API_KEY }}"
46-
DEPLOY_SHINYAPPS_NAME: "${{ secrets.DEPLOY_SHINYAPPS_NAME }}"
47-
DEPLOY_SHINYAPPS_TOKEN: "${{ secrets.DEPLOY_SHINYAPPS_TOKEN }}"
48-
DEPLOY_SHINYAPPS_SECRET: "${{ secrets.DEPLOY_SHINYAPPS_SECRET }}"
111+
DEPLOY_CONNECT_SERVER_URL: "${{ (matrix.config.released_connect_server && 'https://connect.posit.it/') || 'https://rsc.radixu.com/' }}"
112+
DEPLOY_CONNECT_SERVER_API_KEY: "${{ (matrix.config.released_connect_server && secrets.DEPLOY_CONNECT_POSIT_SERVER_API_KEY) || secrets.DEPLOY_CONNECT_SERVER_API_KEY }}"
113+
DEPLOY_SHINYAPPS_NAME: "${{ matrix.config.test_shinyappsio && matrix.config.shinyapps_name }}"
114+
DEPLOY_SHINYAPPS_TOKEN: "${{ matrix.config.test_shinyappsio && matrix.config.shinyapps_token }}"
115+
DEPLOY_SHINYAPPS_SECRET: "${{ matrix.config.test_shinyappsio && matrix.config.shinyapps_secret }}"
116+
EXPRESS_PAGE_SIDEBAR_NAME: "${{ matrix.config.app_name }}"
117+
DEPLOY_GITHUB_REQUIREMENTS_TXT: "${{ !matrix.config.pypi_shiny }}"
49118
timeout-minutes: 30
50119
# Given we are waiting for external servers to finish,
51120
# we can have many local processes waiting for deployment to finish
52121
run: |
53-
make playwright-deploys SUB_FILE=". -vv --numprocesses 12"
122+
make playwright-deploys TEST_FILE="${{ matrix.config.base_test_dir }} -vv --numprocesses 12"
54123
55-
- uses: actions/upload-artifact@v4
56-
if: failure()
57-
with:
58-
name: "playright-deploys-${{ matrix.os }}-${{ matrix.python-version }}-results"
59-
path: test-results/
60-
retention-days: 5
124+
# - uses: actions/upload-artifact@v4
125+
# if: failure()
126+
# with:
127+
# name: "playright-deploys-${{ matrix.os }}-${{ matrix.python-version }}-results"
128+
# path: test-results/
129+
# retention-days: 5

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ playwright-shiny: FORCE
173173

174174
# end-to-end tests on deployed apps with playwright; (SUB_FILE="" within tests/playwright/deploys/)
175175
playwright-deploys: FORCE
176+
$(MAKE) playwright PYTEST_BROWSERS="$(PYTEST_DEPLOYS_BROWSERS)" TEST_FILE="$(TEST_FILE)"
177+
playwright-deploys-legacy: FORCE
176178
$(MAKE) playwright TEST_FILE="tests/playwright/deploys/$(SUB_FILE)" PYTEST_BROWSERS="$(PYTEST_DEPLOYS_BROWSERS)"
177179

178180
# end-to-end tests on all py-shiny examples with playwright; (SUB_FILE="" within tests/playwright/examples/)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import pytest
22
from playwright.sync_api import Page
33
from utils.deploy_utils import (
4-
create_deploys_app_url_fixture,
4+
local_deploys_app_url_fixture,
55
reruns,
66
reruns_delay,
77
skip_if_not_chrome,
88
)
99

1010
from shiny.playwright import controller
1111

12-
app_url = create_deploys_app_url_fixture("shiny_express_accordion")
12+
app_url = local_deploys_app_url_fixture("shiny_express_accordion")
1313

1414

1515
@skip_if_not_chrome

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import pytest
22
from playwright.sync_api import Page
33
from utils.deploy_utils import (
4-
create_deploys_app_url_fixture,
4+
local_deploys_app_url_fixture,
55
reruns,
66
reruns_delay,
77
skip_if_not_chrome,
88
)
99

1010
from shiny.playwright import controller
1111

12-
app_url = create_deploys_app_url_fixture("shiny-express-dataframe")
12+
app_url = local_deploys_app_url_fixture("shiny-express-dataframe")
1313

1414

1515
@skip_if_not_chrome

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import pytest
22
from playwright.sync_api import Page, expect
33
from utils.deploy_utils import (
4-
create_deploys_app_url_fixture,
4+
local_deploys_app_url_fixture,
55
reruns,
66
reruns_delay,
77
skip_if_not_chrome,
88
)
99

10-
app_url = create_deploys_app_url_fixture("shiny-express-folium")
10+
app_url = local_deploys_app_url_fixture("shiny-express-folium")
1111

1212

1313
@skip_if_not_chrome

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pytest
22
from playwright.sync_api import Page, expect
33
from utils.deploy_utils import (
4-
create_deploys_app_url_fixture,
4+
local_deploys_app_url_fixture,
55
reruns,
66
reruns_delay,
77
skip_if_not_chrome,
@@ -11,7 +11,7 @@
1111

1212
TIMEOUT = 2 * 60 * 1000
1313

14-
app_url = create_deploys_app_url_fixture("shiny_express_page_default")
14+
app_url = local_deploys_app_url_fixture("shiny_express_page_default")
1515

1616

1717
@skip_if_not_chrome

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import pytest
22
from playwright.sync_api import Page
33
from utils.deploy_utils import (
4-
create_deploys_app_url_fixture,
4+
local_deploys_app_url_fixture,
55
reruns,
66
reruns_delay,
77
skip_if_not_chrome,
88
)
99

1010
from shiny.playwright import controller
1111

12-
app_url = create_deploys_app_url_fixture("express_page_fillable")
12+
app_url = local_deploys_app_url_fixture("express_page_fillable")
1313

1414

1515
@skip_if_not_chrome

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import pytest
22
from playwright.sync_api import Page
33
from utils.deploy_utils import (
4-
create_deploys_app_url_fixture,
4+
local_deploys_app_url_fixture,
55
reruns,
66
reruns_delay,
77
skip_if_not_chrome,
88
)
99

1010
from shiny.playwright import controller
1111

12-
app_url = create_deploys_app_url_fixture("express_page_fluid")
12+
app_url = local_deploys_app_url_fixture("express_page_fluid")
1313

1414

1515
@skip_if_not_chrome

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1+
import os
2+
13
import pytest
24
from playwright.sync_api import Page
35
from utils.deploy_utils import (
4-
create_deploys_app_url_fixture,
6+
local_deploys_app_url_fixture,
57
reruns,
68
reruns_delay,
79
skip_if_not_chrome,
810
)
911

1012
from shiny.playwright import controller
1113

12-
app_url = create_deploys_app_url_fixture("express_page_sidebar")
14+
app_url = local_deploys_app_url_fixture(
15+
# Possibly use a different app name given by an GHA env var
16+
os.getenv("EXPRESS_PAGE_SIDEBAR_NAME", "express_page_sidebar")
17+
)
1318

1419

1520
@skip_if_not_chrome

tests/playwright/deploys/plotly/test_plotly_app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import pytest
22
from playwright.sync_api import Page, expect
33
from utils.deploy_utils import (
4-
create_deploys_app_url_fixture,
4+
local_deploys_app_url_fixture,
55
reruns,
66
reruns_delay,
77
skip_if_not_chrome,
88
)
99

1010
TIMEOUT = 2 * 60 * 1000
11-
app_url = create_deploys_app_url_fixture("example_deploy_app_a1")
11+
app_url = local_deploys_app_url_fixture("example_deploy_app_a1")
1212

1313

1414
@skip_if_not_chrome

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import pytest
22
from playwright.sync_api import Page, expect
33
from utils.deploy_utils import (
4-
create_deploys_app_url_fixture,
4+
local_deploys_app_url_fixture,
55
reruns,
66
reruns_delay,
77
skip_if_not_chrome,
88
)
99

10-
app_url = create_deploys_app_url_fixture("shiny_client_console_error")
10+
app_url = local_deploys_app_url_fixture("shiny_client_console_error")
1111

1212

1313
@skip_if_not_chrome

0 commit comments

Comments
 (0)