-
Notifications
You must be signed in to change notification settings - Fork 82
252 lines (209 loc) · 8.06 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
248
249
250
251
252
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: 80
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
id: electron-smoke-tests
run: DISPLAY=:10 yarn smoketest-all --tracing --skip-cleanup
- name: Convert XUnit to JUnit
id: xunit-to-junit
if: success() || failure()
run: |
sudo apt-get update
sudo apt-get install -y libxml2-utils
yarn xunit-to-junit smoke-tests-electron
- name: Publish Electron Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
report_paths: "**/.build/logs/smoke-tests-electron/test-results/xunit-results.xml"
check_name: "Electron Test Results"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set TestRail Run Title
id: set-testrail-run-title
if: steps.xunit-to-junit == 'success'
run: echo "TESTRAIL_TITLE=$(date +'%Y-%m-%d') Nightly Smoke Tests - $GITHUB_REF_NAME" >> $GITHUB_ENV
- name: Upload Test Results to TestRail (Electron ONLY)
id: testrail-upload
if: steps.xunit-to-junit == 'success'
run: trcli --host "https://posit.testrail.io/" --project Positron --username testrailautomation@posit.co --key ${{ secrets.TESTRAIL_API_KEY}} parse_junit --file ".build/logs/smoke-tests-electron/test-results/xunit-results.xml" --case-matcher name --title "$TESTRAIL_TITLE" --close-run
- name: Upload Artifacts - Electron
if: always()
uses: actions/upload-artifact@v4
with:
name: run-artifacts-electron
path: .build/logs/smoke-tests-electron/
e2e-browser-tests:
runs-on: ubuntu-latest-4x
timeout-minutes: 40
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 Web Smoke Tests
env:
POSITRON_PY_VER_SEL: 3.10.12
POSITRON_R_VER_SEL: 4.4.0
id: electron-web-smoke-tests
run: DISPLAY=:10 yarn smoketest-web --tracing
- name: Convert XUnit to JUnit
id: xunit-to-junit
if: success() || failure()
run: |
sudo apt-get update
sudo apt-get install -y libxml2-utils
yarn xunit-to-junit smoke-tests-browser
- name: Publish Web Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
report_paths: "**/.build/logs/smoke-tests-browser/test-results/xunit-results.xml"
check_name: "Web Test Results"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Artifacts - Browser
if: always()
uses: actions/upload-artifact@v4
with:
name: run-artifacts-browser
path: .build/logs/smoke-tests-browser/
- name: Clean up license files
if: always()
run: cd .. && rm -rf positron-license
slack-notification:
name: "slack-notification"
runs-on: ubuntu-latest
needs:
[
"unit-tests",
"integration-tests",
"e2e-electron-tests",
"e2e-browser-tests",
]
if: failure()
steps:
- name: "Send Slack notification"
uses: testlabauto/action-test-results-to-slack@v0.0.6
with:
github_token: ${{ secrets.POSITRON_GITHUB_PAT }}
slack_token: ${{ secrets.SMOKE_TESTS_SLACK_TOKEN }}
slack_channel: C07FR1JNZNJ #positron-test-results channel
suite_name: Positron Full Test Suite