Skip to content

Commit

Permalink
Set up deploys tests to use a matrix with multiple configurations. Us…
Browse files Browse the repository at this point in the history
…e custom app name to avoid app clashes on same server
  • Loading branch information
schloerke committed Aug 28, 2024
1 parent c6700b1 commit 402546f
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 7 deletions.
58 changes: 52 additions & 6 deletions .github/workflows/deploy-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,40 @@ jobs:
# Matches deploy server python version
python-version: ["3.10"]
os: [ubuntu-latest]
config:
# Released server, shiny, and rsconnect
- released_connect_server: true
pypi_shiny: true
pypi_rsconnect: true
base_test_dir: "./tests/playwright/deploys/express-page_sidebar"
test_shinyappsio: false
app_name: "pypi-shiny-rsconnect"

# Released shiny and rsconnect
# Dev server
- released_connect_server: false
pypi_shiny: true
pypi_rsconnect: true
base_test_dir: "./tests/playwright/deploys/express-page_sidebar"
test_shinyappsio: false
app_name: "pypi-shiny-rsconnect"

# Released shiny
# Dogfood server and rsconnect
- released_connect_server: false
pypi_shiny: true
pypi_rsconnect: false
base_test_dir: "./tests/playwright/deploys/express-page_sidebar"
test_shinyappsio: false
app_name: "pypi-shiny-dev-rsconnect"

# Dev server, shiny, and rsconnect
- released_connect_server: false
pypi_shiny: false
pypi_rsconnect: false
base_test_dir: "./tests/playwright/deploys"
test_shinyappsio: true

fail-fast: false

steps:
Expand All @@ -27,7 +61,18 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install rsconnect
- name: Install pypi shiny and htmltools (uninstall GitHub versions)
if: ${{ matrix.config.pypi_shiny }}
run: |
uv pip uninstall -y shiny htmltools
uv pip install shiny htmltools
- name: Install rsconnect (PyPI)
if: ${{ matrix.config.pypi_rsconnect }}
run: |
uv pip install rsconnect
- name: Install rsconnect (GitHub)
if: ${{ ! matrix.config.pypi_rsconnect }}
run: |
make ci-install-rsconnect
Expand All @@ -41,11 +86,12 @@ jobs:
- name: Deploy apps and run tests (on `push` or `deploy**` branches)
env:
DEPLOY_APPS: "true"
DEPLOY_CONNECT_SERVER_URL: "https://rsc.radixu.com/"
DEPLOY_CONNECT_SERVER_API_KEY: "${{ secrets.DEPLOY_CONNECT_SERVER_API_KEY }}"
DEPLOY_SHINYAPPS_NAME: "${{ secrets.DEPLOY_SHINYAPPS_NAME }}"
DEPLOY_SHINYAPPS_TOKEN: "${{ secrets.DEPLOY_SHINYAPPS_TOKEN }}"
DEPLOY_SHINYAPPS_SECRET: "${{ secrets.DEPLOY_SHINYAPPS_SECRET }}"
DEPLOY_CONNECT_SERVER_URL: "${{ (matrix.config.released_connect_server && 'https://connect.posit.it/') || 'https://rsc.radixu.com/' }}"
DEPLOY_CONNECT_SERVER_API_KEY: "${{ (matrix.config.released_connect_server && secrets.DEPLOY_CONNECT_POSIT_SERVER_API_KEY) || secrets.DEPLOY_CONNECT_SERVER_API_KEY }}"
DEPLOY_SHINYAPPS_NAME: "${{ matrix.config.test_shinyappsio && matrix.config.shinyapps_name }}"
DEPLOY_SHINYAPPS_TOKEN: "${{ matrix.config.test_shinyappsio && matrix.config.shinyapps_token }}"
DEPLOY_SHINYAPPS_SECRET: "${{ matrix.config.test_shinyappsio && matrix.config.shinyapps_secret }}"
EXPRESS_PAGE_SIDEBAR_NAME: "${{ matrix.config.app_name }}"
timeout-minutes: 30
# Given we are waiting for external servers to finish,
# we can have many local processes waiting for deployment to finish
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

import pytest
from playwright.sync_api import Page
from utils.deploy_utils import (
Expand All @@ -9,7 +11,10 @@

from shiny.playwright import controller

app_url = create_deploys_app_url_fixture("express_page_sidebar")
app_url = create_deploys_app_url_fixture(
# Possibly use a different app name given by an GHA env var
os.getenv("EXPRESS_PAGE_SIDEBAR_NAME", "express_page_sidebar")
)


@skip_if_not_chrome
Expand Down

0 comments on commit 402546f

Please sign in to comment.