-
Notifications
You must be signed in to change notification settings - Fork 92
247 lines (205 loc) · 7.72 KB
/
positron-full-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
name: "Positron: Full Test Suite"
# Run tests daily at 4am UTC (11p EST) on weekdays for now, or manually
on:
schedule:
- cron: "0 4 * * 1-5"
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
unit-tests:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
POSITRON_BUILD_NUMBER: 0 # CI skips building releases
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Cache node_modules, build, extensions, and remote
uses: ./.github/actions/cache-multi-paths
- name: Setup Build and Compile
uses: ./.github/actions/setup-build-env
- name: Run Unit Tests (Electron)
id: electron-unit-tests
run: DISPLAY=:10 ./scripts/test.sh
- name: Run Unit Tests (node.js)
id: nodejs-unit-tests
run: yarn test-node
- name: Run Unit Tests (Browser, Chromium)
id: browser-unit-tests
run: DISPLAY=:10 yarn test-browser-no-install --browser chromium
integration-tests:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
POSITRON_BUILD_NUMBER: 0 # CI skips building releases
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Cache node_modules, build, extensions, and remote
uses: ./.github/actions/cache-multi-paths
- name: Setup Build and Compile
uses: ./.github/actions/setup-build-env
- name: Install Positron License
uses: ./.github/actions/install-license
with:
github-token: ${{ secrets.POSITRON_GITHUB_PAT }}
license-key: ${{ secrets.POSITRON_DEV_LICENSE }}
- name: Setup R
uses: ./.github/actions/install-r
with:
version: "4.4.0"
- name: Compile Integration Tests
run: yarn --cwd test/integration/browser compile
- name: Run Integration Tests (Electron)
id: electron-integration-tests
run: DISPLAY=:10 ./scripts/test-integration.sh
- name: Run Integration Tests (Remote)
if: ${{ job.status != 'cancelled' && (success() || failure()) }}
id: electron-remote-integration-tests
run: DISPLAY=:10 ./scripts/test-remote-integration.sh
- name: Run Integration Tests (Browser, Chromium)
if: ${{ job.status != 'cancelled' && (success() || failure()) }}
id: browser-integration-tests
run: DISPLAY=:10 ./scripts/test-web-integration.sh --browser chromium
- name: Clean up license files
if: always()
run: cd .. && rm -rf positron-license
e2e-electron-tests:
runs-on: ubuntu-latest-8x
timeout-minutes: 60
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
POSITRON_BUILD_NUMBER: 0 # CI skips building releases
_R_CHECK_FUTURE_FILE_TIMESTAMPS_: false # this check can be flaky in the R pkg tests
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_SYSTEM_CLOCK_: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Cache node_modules, build, extensions, and remote
uses: ./.github/actions/cache-multi-paths
- name: Setup Build and Compile
uses: ./.github/actions/setup-build-env
- name: Setup E2E Test Environment
uses: ./.github/actions/setup-test-env
with:
aws-role-to-assume: ${{ secrets.QA_AWS_RO_ROLE }}
aws-region: ${{ secrets.QA_AWS_REGION }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Tests (Electron)
env:
POSITRON_PY_VER_SEL: 3.10.12
POSITRON_R_VER_SEL: 4.4.0
CURRENTS_PROJECT_ID: ZOs5z2
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
CURRENTS_CI_BUILD_ID: ${{ github.run_id }}-${{ github.run_attempt }}
COMMIT_INFO_MESSAGE: ${{ github.event.head_commit.message }} # only works on push events
PWTEST_BLOB_DO_NOT_REMOVE: 1
CURRENTS_TAG: "electron"
id: electron-tests
run: DISPLAY=:10 npx playwright test --project e2e-electron --workers 3
- name: Upload blob report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: blob-report-electron
path: blob-report
retention-days: 14
- name: Upload junit report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: junit-report-electron
path: test-results/junit.xml
e2e-browser-tests:
runs-on: ubuntu-latest-8x
timeout-minutes: 50
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
POSITRON_BUILD_NUMBER: 0 # CI skips building releases
_R_CHECK_FUTURE_FILE_TIMESTAMPS_: false # this check can be flaky in the R pkg tests
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_SYSTEM_CLOCK_: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Cache node_modules, build, extensions, and remote
uses: ./.github/actions/cache-multi-paths
- name: Setup Build and Compile
uses: ./.github/actions/setup-build-env
- name: Install Positron License
uses: ./.github/actions/install-license
with:
github-token: ${{ secrets.POSITRON_GITHUB_PAT }}
license-key: ${{ secrets.POSITRON_DEV_LICENSE }}
- name: Setup E2E Test Environment
uses: ./.github/actions/setup-test-env
with:
aws-role-to-assume: ${{ secrets.QA_AWS_RO_ROLE }}
aws-region: ${{ secrets.QA_AWS_REGION }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Tests (Browser)
env:
POSITRON_PY_VER_SEL: 3.10.12
POSITRON_R_VER_SEL: 4.4.0
CURRENTS_PROJECT_ID: ZOs5z2
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
CURRENTS_CI_BUILD_ID: ${{ github.run_id }}-${{ github.run_attempt }}
COMMIT_INFO_MESSAGE: ${{ github.event.head_commit.message }}
PWTEST_BLOB_DO_NOT_REMOVE: 1
CURRENTS_TAG: "chromium"
id: browser-tests
run: DISPLAY=:10 npx playwright test --project e2e-browser --workers 2
- name: Upload blob report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: blob-report-browser
path: blob-report
retention-days: 14
- name: Upload logs
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: logs-browser
path: test-logs
- name: Clean up license files
if: always()
run: cd .. && rm -rf positron-license
e2e-report:
if: always()
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.48.0-jammy
needs: [e2e-electron-tests, e2e-browser-tests, unit-tests, integration-tests]
env:
REPORT_DIR: playwright-report-${{ github.run_id }}
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Run E2E Report
uses: ./.github/actions/e2e-report
with:
aws-s3-bucket: positron-test-reports
aws-role: ${{ secrets.AWS_TEST_REPORTS_ROLE }}
slack-token: ${{ secrets.SMOKE_TESTS_SLACK_TOKEN }}
slack-channel: C07FR1JNZNJ
slack-title: "Full Test Suite (Electron)"
testrail-api-key: ${{ secrets.TESTRAIL_API_KEY }}
testrail-title: "E2E Electron Test Run"
github-token: ${{ secrets.POSITRON_GITHUB_PAT }}