Skip to content

Commit 1563f2a

Browse files
Merge pull request #526 from rstudio/kg-rsconnect-tests
Kg rsconnect tests
2 parents 71b5204 + 85b8e1f commit 1563f2a

File tree

4 files changed

+433
-7
lines changed

4 files changed

+433
-7
lines changed

.github/workflows/deploy_tests.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: rsconnect-python-tests-at-night
2+
on:
3+
schedule:
4+
- cron: "0 09 * * *" # Runs 11 AM UTC == 2 AM PDT
5+
workflow_dispatch:
6+
7+
jobs:
8+
distributions:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
17+
- uses: actions/setup-python@v4
18+
with:
19+
python-version: 3.8.x
20+
- run: pip install -e '.[test]'
21+
- run: pip freeze
22+
- run: make dist
23+
id: create_dist
24+
- uses: actions/upload-artifact@v3
25+
with:
26+
name: distributions
27+
path: dist/
28+
29+
test-connect:
30+
needs: distributions
31+
runs-on: ubuntu-latest
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
PY_VERSION:
36+
- 3.8.10
37+
- 3.9.5
38+
PYTHON_BUILD: [binary]
39+
steps:
40+
- uses: extractions/setup-just@v1
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
- uses: actions/checkout@v4
44+
with:
45+
fetch-depth: 0
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
49+
- uses: actions/checkout@v4
50+
with:
51+
repository: rstudio/connect
52+
path: 'test/connect-rsconnect-python'
53+
sparse-checkout: |
54+
test/rsconnect-python
55+
scripts
56+
examples
57+
sparse-checkout-cone-mode: false
58+
token: ${{ secrets.CONNECT_PAT }}
59+
60+
- name: Build docker container-image
61+
run: |
62+
cd test/connect-rsconnect-python/test/rsconnect-python/
63+
docker-compose --profile rsconnect build
64+
65+
- name: Restore dist
66+
uses: actions/download-artifact@v3
67+
with:
68+
name: distributions
69+
path: dist/
70+
71+
- name: Run rsconnect-python Tests
72+
env:
73+
CONNECT_LICENSE: "${{ secrets.RSC_LICENSE }}"
74+
PY_VERSION: ${{ matrix.PY_VERSION }}
75+
CONNECT_CONFIG: "test-rsconnect-python.gcfg"
76+
TEST_SUBSET: "ALL"
77+
RSC_AUTOMATION_PAT: "${{ secrets.CONNECT_PAT }}"
78+
ADMIN_API_KEY: "${{ secrets.ADMIN_API_KEY }}"
79+
PYTHON_BUILD: "${{ matrix.PYTHON_BUILD }}"
80+
QUARTO_VERSION: "1.3.340"
81+
82+
# This allows us to start Connect separately in our own docker container
83+
CONNECT_SERVER: "http://localhost:3939"
84+
remote: "yes"
85+
run: |
86+
cd integration-testing
87+
docker compose pull connect
88+
docker compose up -d connect
89+
just ../test/connect-rsconnect-python/test/rsconnect-python/test-rsconnect-python-repo-${PYTHON_BUILD}
90+
91+
# Videos are captured whether the suite fails or passes
92+
- name: Save videos
93+
uses: actions/upload-artifact@v3
94+
if: failure()
95+
with:
96+
name: cypress-videos_${{ matrix.PY_VERSION }}_native
97+
path: test/connect-rsconnect-python/cypress/videos
98+
if-no-files-found: ignore
99+
100+
# Screenshots are only captured on failure
101+
- name: Save screenshots
102+
uses: actions/upload-artifact@v3
103+
if: failure()
104+
with:
105+
name: cypress-screenshots_${{ matrix.PY_VERSION }}_native
106+
path: test/connect-rsconnect-python/cypress/screenshots
107+
if-no-files-found: ignore
108+

.github/workflows/main.yml

Lines changed: 88 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
fetch-depth: 0
3232
env:
3333
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
- uses: actions/setup-python@v2
34+
- uses: actions/setup-python@v4
3535
with:
3636
python-version: ${{ matrix.python-version }}
3737
- run: pip install '.[test]'
@@ -55,7 +55,7 @@ jobs:
5555
fetch-depth: 0
5656
env:
5757
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58-
- uses: actions/setup-python@v2
58+
- uses: actions/setup-python@v4
5959
with:
6060
python-version: 3.8.x
6161
- run: pip install --pre '.[test]'
@@ -74,14 +74,14 @@ jobs:
7474
fetch-depth: 0
7575
env:
7676
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77-
- uses: actions/setup-python@v2
77+
- uses: actions/setup-python@v4
7878
with:
7979
python-version: 3.8.x
8080
- run: pip install -e '.[test]'
8181
- run: pip freeze
8282
- run: make dist
8383
id: create_dist
84-
- uses: actions/upload-artifact@v2
84+
- uses: actions/upload-artifact@v3
8585
with:
8686
name: distributions
8787
path: dist/
@@ -131,12 +131,12 @@ jobs:
131131
fetch-depth: 0
132132
env:
133133
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
134-
- uses: actions/setup-python@v2
134+
- uses: actions/setup-python@v4
135135
with:
136136
python-version: 3.8.x
137137
- run: pip freeze
138138
- run: make docs
139-
- uses: actions/upload-artifact@v2
139+
- uses: actions/upload-artifact@v3
140140
with:
141141
name: docs
142142
path: docs/site/
@@ -175,7 +175,7 @@ jobs:
175175
runs-on: ubuntu-latest
176176
steps:
177177
- uses: actions/checkout@v4
178-
- uses: actions/setup-python@v2
178+
- uses: actions/setup-python@v4
179179
with:
180180
python-version: 3.8
181181
- name: Install dependencies
@@ -247,3 +247,84 @@ jobs:
247247
path: integration-testing/cypress/screenshots
248248
if-no-files-found: ignore
249249
retention-days: 1
250+
251+
test-connect:
252+
needs: distributions
253+
runs-on: ubuntu-latest
254+
strategy:
255+
fail-fast: false
256+
matrix:
257+
PY_VERSION:
258+
- 3.8.10
259+
- 3.9.5
260+
PYTHON_BUILD: [binary]
261+
steps:
262+
- uses: extractions/setup-just@v1
263+
env:
264+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
265+
- uses: actions/checkout@v4
266+
with:
267+
fetch-depth: 0
268+
env:
269+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
270+
# Checkout the rsconnect-python tests from Connect
271+
- uses: actions/checkout@v4
272+
with:
273+
repository: rstudio/connect
274+
path: 'test/connect-rsconnect-python'
275+
sparse-checkout: |
276+
test/rsconnect-python
277+
scripts
278+
examples
279+
sparse-checkout-cone-mode: false
280+
token: ${{ secrets.CONNECT_PAT }}
281+
282+
- name: Build docker container-image
283+
run: |
284+
cd test/connect-rsconnect-python/test/rsconnect-python/
285+
docker-compose --profile rsconnect build
286+
287+
- name: Restore dist
288+
uses: actions/download-artifact@v3
289+
with:
290+
name: distributions
291+
path: dist/
292+
293+
- name: Run rsconnect-python Tests
294+
env:
295+
CONNECT_LICENSE: "${{ secrets.RSC_LICENSE }}"
296+
PY_VERSION: ${{ matrix.PY_VERSION }}
297+
TEST_SUBSET: "CI"
298+
RSC_AUTOMATION_PAT: "${{ secrets.CONNECT_PAT }}"
299+
ADMIN_API_KEY: "${{ secrets.ADMIN_API_KEY }}"
300+
PYTHON_BUILD: "${{ matrix.PYTHON_BUILD }}"
301+
QUARTO_VERSION: "1.3.340"
302+
303+
# This allows us to start Connect separately in our own docker container
304+
CONNECT_SERVER: "http://localhost:3939"
305+
remote: "yes"
306+
run: |
307+
cd integration-testing
308+
docker compose pull connect
309+
docker compose up -d connect
310+
just ../test/connect-rsconnect-python/test/rsconnect-python/test-rsconnect-python-repo-${PYTHON_BUILD}
311+
312+
# Videos are captured whether the suite fails or passes
313+
- name: Save videos
314+
uses: actions/upload-artifact@v3
315+
if: failure()
316+
with:
317+
name: cypress-videos_${{ matrix.PY_VERSION }}_native
318+
path: test/connect-rsconnect-python/cypress/videos
319+
if-no-files-found: ignore
320+
321+
# Screenshots are only captured on failure
322+
- name: Save screenshots
323+
uses: actions/upload-artifact@v3
324+
if: failure()
325+
with:
326+
name: cypress-screenshots_${{ matrix.PY_VERSION }}_native
327+
path: test/connect-rsconnect-python/cypress/screenshots
328+
if-no-files-found: ignore
329+
330+

0 commit comments

Comments
 (0)