Skip to content

Commit 23a3514

Browse files
committed
move ai generated apps to separate job and directory
1 parent 8a0efdf commit 23a3514

File tree

74 files changed

+49
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+49
-1
lines changed

.github/workflows/pytest.yaml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ jobs:
187187
- name: Install node.js
188188
uses: actions/setup-node@v4
189189
with:
190-
node-version: "18"
190+
node-version: "22"
191191
cache: npm
192192
cache-dependency-path: examples/brownian/shinymediapipe/package-lock.json
193193
- name: Install node.js package
@@ -206,6 +206,49 @@ jobs:
206206
path: test-results/
207207
retention-days: 5
208208

209+
playwright-ai:
210+
if: github.event_name != 'release'
211+
runs-on: ubuntu-latest
212+
strategy:
213+
matrix:
214+
python-version: ["3.12", "3.11", "3.10", "3.9"]
215+
browser: ["chromium", "firefox", "webkit"]
216+
exclude:
217+
- python-version: ${{ github.event.pull_request.draft && '3.11' }}
218+
- python-version: ${{ github.event.pull_request.draft && '3.10' }}
219+
- python-version: ${{ github.event.pull_request.draft && '3.9' }}
220+
- browser: ${{ github.event.pull_request.draft && 'firefox' }}
221+
- browser: ${{ github.event.pull_request.draft && 'webkit' }}
222+
fail-fast: false
223+
224+
steps:
225+
- uses: actions/checkout@v4
226+
with:
227+
fetch-depth: 0
228+
- name: Setup py-shiny
229+
uses: ./.github/py-shiny/setup
230+
with:
231+
python-version: ${{ matrix.python-version }}
232+
- name: Determine browsers for testing
233+
uses: ./.github/py-shiny/pytest-browsers
234+
id: browsers
235+
with:
236+
browser: ${{ matrix.browser }}
237+
# If anything other than `true`, it will heavily reduce webkit performance
238+
# Related: https://github.com/microsoft/playwright/issues/18119
239+
disable-playwright-diagnostics: ${{ matrix.browser == 'webkit' || matrix.browser == 'firefox' }}
240+
241+
- name: Run playwright tests for AI generated apps
242+
timeout-minutes: 60
243+
run: |
244+
make playwright-ai SUB_FILE=". --numprocesses 3 ${{ steps.browsers.outputs.playwright-diagnostic-args }}" ${{ steps.browsers.outputs.browsers }}
245+
- uses: actions/upload-artifact@v4
246+
if: failure() && steps.browsers.outputs.has-playwright-diagnostics
247+
with:
248+
name: "playright-examples-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.browser }}-results"
249+
path: test-results/
250+
retention-days: 5
251+
209252
playwright-deploys-precheck:
210253
if: github.event_name != 'release'
211254
runs-on: ubuntu-latest

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ TEST_FILE:=tests/playwright/$(SUB_FILE)
157157
DEPLOYS_TEST_FILE:=tests/playwright/deploys$(SUB_FILE)
158158
SHINY_TEST_FILE:=tests/playwright/shiny/$(SUB_FILE)
159159
EXAMPLES_TEST_FILE:=tests/playwright/examples/$(SUB_FILE)
160+
AI_TEST_FILE:=tests/playwright/ai_generated_apps/$(SUB_FILE)
160161

161162
install-playwright: FORCE
162163
playwright install --with-deps
@@ -187,6 +188,10 @@ playwright-deploys: FORCE
187188
playwright-examples: FORCE
188189
$(MAKE) playwright TEST_FILE="$(EXAMPLES_TEST_FILE)"
189190

191+
# end-to-end tests for all AI generated apps
192+
playwright-ai: FORCE
193+
$(MAKE) playwright TEST_FILE="$(AI_TEST_FILE)"
194+
190195
coverage: FORCE ## check combined code coverage (must run e2e last)
191196
pytest --cov-report term-missing --cov=shiny tests/pytest/ $(SHINY_TEST_FILE) $(PYTEST_BROWSERS)
192197
coverage html

0 commit comments

Comments
 (0)