-
Notifications
You must be signed in to change notification settings - Fork 5
310 lines (289 loc) · 12.6 KB
/
e2e-tests-linux-split.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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
name: E2E Tests Linux split
on:
schedule:
- cron: '0 0 * * *'
push:
branches:
- 'release/**'
workflow_dispatch:
inputs:
browser:
description: 'Browser to use'
required: true
default: 'chrome'
type: choice
options:
- chrome
- edge
network:
description: 'network to use'
required: true
default: 'preprod'
type: choice
options:
- preprod
- mainnet
runner:
type: choice
required: true
default: 'ubuntu-22.04'
description: runner to use
options:
- self-hosted
- ubuntu-22.04
- ubuntu-20.04
- ubuntu-latest
smoke_only:
type: boolean
description: 'Run only smoke tests'
required: true
default: false
service_worker_logs:
type: boolean
description: 'Collect service worker logs'
required: true
default: false
tags:
type: string
description: 'Tags(optional)'
required: false
default: ''
cardano_mainnet_url:
type: choice
required: true
default: dev-mainnet.lw.iog.io
description: 'cardano mainnet url to use'
options:
- dev-mainnet.lw.iog.io
- dev-mainnet.eu-central-1.lw.iog.io
- dev-mainnet.eu-west-1.lw.iog.io
- dev-mainnet.us-east-1.lw.iog.io
- dev-mainnet.us-east-2.lw.iog.io
- live-mainnet.lw.iog.io
- live-mainnet.eu-central-1.lw.iog.io
- live-mainnet.eu-west-1.lw.iog.io
- live-mainnet.us-east-1.lw.iog.io
- live-mainnet.us-east-2.lw.iog.io
- staging-mainnet.lw.iog.io
- staging-mainnet.eu-central-1.lw.iog.io
- staging-mainnet.eu-west-1.lw.iog.io
- staging-mainnet.us-east-1.lw.iog.io
- staging-mainnet.us-east-2.lw.iog.io
cardano_preprod_url:
type: choice
required: true
default: dev-preprod.lw.iog.io
description: 'cardano preprod url to use'
options:
- dev-preprod.lw.iog.io
- dev-preprod.eu-central-1.lw.iog.io
- dev-preprod.eu-west-1.lw.iog.io
- dev-preprod.us-east-1.lw.iog.io
- dev-preprod.us-east-2.lw.iog.io
- live-preprod.lw.iog.io
- live-preprod.eu-central-1.lw.iog.io
- live-preprod.eu-west-1.lw.iog.io
- live-preprod.us-east-1.lw.iog.io
- live-preprod.us-east-2.lw.iog.io
- staging-preprod.lw.iog.io
- staging-preprod.eu-central-1.lw.iog.io
- staging-preprod.eu-west-1.lw.iog.io
- staging-preprod.us-east-1.lw.iog.io
- staging-preprod.us-east-2.lw.iog.io
cardano_preview_url:
type: choice
required: true
default: dev-preview.lw.iog.io
description: 'cardano preview url to use'
options:
- dev-preview.lw.iog.io
- dev-preview.eu-central-1.lw.iog.io
- dev-preview.eu-west-1.lw.iog.io
- dev-preview.us-east-1.lw.iog.io
- dev-preview.us-east-2.lw.iog.io
- live-preview.lw.iog.io
- live-preview.eu-central-1.lw.iog.io
- live-preview.eu-west-1.lw.iog.io
- live-preview.us-east-1.lw.iog.io
- live-preview.us-east-2.lw.iog.io
run-name: "E2E | os: Linux | browser: ${{ github.event.inputs.browser || 'chrome' }} | network: ${{ github.event.inputs.network || 'preprod' }} | #${{ github.run_number }} | tags: ${{ github.event.inputs.tags || '' }} | smoke only: ${{ github.event.inputs.smoke_only || 'false' }}"
env:
BROWSER: ${{ github.event.inputs.browser || 'chrome' }}
NETWORK: ${{ github.event.inputs.network || 'preprod' }}
RUN: ${{ github.run_number }}
DISPLAY: ':99.0'
NODE_OPTIONS: --max-old-space-size=16384
BRANCH: ${{ github.ref_name }}
CARDANO_MAINNET_URL: ${{ startsWith(github.ref_name, 'release/') && 'live-mainnet.lw.iog.io' || (github.event.inputs.cardano_mainnet_url || 'dev-mainnet.lw.iog.io') }}
CARDANO_PREPROD_URL: ${{ startsWith(github.ref_name, 'release/') && 'live-preprod.lw.iog.io' || (github.event.inputs.cardano_preprod_url || 'dev-preprod.lw.iog.io') }}
CARDANO_PREVIEW_URL: ${{ startsWith(github.ref_name, 'release/') && 'live-preview.lw.iog.io' || (github.event.inputs.cardano_preview_url || 'dev-preview.lw.iog.io') }}
BUILD_ARTIFACT_NAME: lace-${{ startsWith(github.ref_name, 'release/') && 'live-preprod.lw.iog.io' || (github.event.inputs.cardano_preprod_url || 'dev-preprod.lw.iog.io') }}-${{ github.sha }}
jobs:
setup:
name: Setup
runs-on: ubuntu-latest
steps:
- name: Provision step
run: |
echo "Provisioning ${{ github.event.inputs.runner }}"
- name: Check if build exists
shell: bash
id: check-build-exists
run: |
ART_ID=$(curl "https://api.github.com/repos/input-output-hk/lace/actions/artifacts?name=${{ env.BUILD_ARTIFACT_NAME }}" | jq -r .artifacts[0].id)
if ([ "$ART_ID" == "null" ]) then
echo "Lace build artifact not found"
echo "build_exists=false" >> $GITHUB_OUTPUT
else
echo "Build artifact found"
echo "build_exists=true" >> $GITHUB_OUTPUT
fi
- name: Print run parameters
run: |
echo "Branch: ${{ github.ref_name }}"
echo "Browser: ${{ github.event.inputs.browser || 'chrome' }}"
echo "Network: ${{ github.event.inputs.network || 'preprod' }}"
echo "Runner: ${{ github.event.inputs.runner || 'ubuntu-22.04' }}"
echo "Smoke only: ${{ github.event.inputs.smoke_only || 'false' }}"
echo "Tags(optional): ${{ github.event.inputs.tags || '' }}"
echo "Cardano mainnet url: ${{ env.CARDANO_MAINNET_URL }}"
echo "Cardano preprod url: ${{ env.CARDANO_PREPROD_URL }}"
echo "Cardano preview url: ${{ env.CARDANO_PREVIEW_URL }}"
echo "Build artifact name: ${{ env.BUILD_ARTIFACT_NAME }}"
outputs:
runner: ${{ github.event.inputs.runner || 'ubuntu-22.04' }}
smoke_only: ${{ github.event.inputs.smoke_only || false }}
tags: ${{ github.event.inputs.tags || '' }}
build_exists: ${{ steps.check-build-exists.outputs.build_exists }}
build:
name: Build Lace
runs-on: ${{ needs.setup.outputs.runner }}
needs: setup
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Lace artifact
if: needs.setup.outputs.build_exists == 'false'
uses: ./.github/shared/build
with:
CARDANO_SERVICES_URL_MAINNET: 'https://${{ env.CARDANO_MAINNET_URL }}'
CARDANO_SERVICES_URL_PREPROD: 'https://${{ env.CARDANO_PREPROD_URL }}'
CARDANO_SERVICES_URL_PREVIEW: 'https://${{ env.CARDANO_PREVIEW_URL }}'
CARDANO_WS_SERVER_URL_MAINNET: 'wss://${{ env.CARDANO_MAINNET_URL }}'
CARDANO_WS_SERVER_URL_PREPROD: 'wss://${{ env.CARDANO_PREPROD_URL }}'
CARDANO_WS_SERVER_URL_PREVIEW: 'wss://${{ env.CARDANO_PREVIEW_URL }}'
BLOCKFROST_PROJECT_ID_MAINNET: ${{ secrets.BLOCKFROST_PROJECT_ID_MAINNET }}
BLOCKFROST_PROJECT_ID_PREPROD: ${{ secrets.BLOCKFROST_PROJECT_ID_PREPROD }}
BLOCKFROST_PROJECT_ID_PREVIEW: ${{ secrets.BLOCKFROST_PROJECT_ID_PREVIEW }}
BLOCKFROST_PROJECT_ID_SANCHONET: ${{ secrets.BLOCKFROST_PROJECT_ID_SANCHONET }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
LACE_EXTENSION_KEY: ${{ secrets.MANIFEST_PUBLIC_KEY }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_ENVIRONMENT: 'e2e-tests'
WALLET_POLLING_INTERVAL_IN_SEC: 5
- name: Upload build artifact
if: needs.setup.outputs.build_exists == 'false'
uses: actions/upload-artifact@v4
with:
name: '${{ env.BUILD_ARTIFACT_NAME }}'
path: ./apps/browser-extension-wallet/dist
tests:
name: E2E tests
strategy:
fail-fast: false
matrix:
batch: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
runs-on: ${{ needs.setup.outputs.runner }}
needs: [setup, build]
permissions:
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js and install dependencies
uses: ./.github/actions/install
with:
WALLET_PASSWORD: ${{ secrets.WALLET_PASSWORD_TESTNET }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Download Lace build artifact
shell: bash
id: download-lace-build-artifact
run: |
ART_ID=$(curl "https://api.github.com/repos/input-output-hk/lace/actions/artifacts?name=${{ env.BUILD_ARTIFACT_NAME }}" | jq -r .artifacts[0].id)
curl -o build_artifact.zip --location "https://api.github.com/repos/input-output-hk/lace/actions/artifacts/${ART_ID}/zip" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"
unzip build_artifact.zip -d ./apps/browser-extension-wallet/dist
echo "Build artifact found and downloaded"
- name: Execute E2E tests
uses: ./.github/actions/test/e2e
with:
BATCH: ${{ matrix.batch }}
SMOKE_ONLY: ${{ needs.setup.outputs.smoke_only }}
TAGS: ${{ needs.setup.outputs.tags }}
TEST_DAPP_URL: ${{ secrets.TEST_DAPP_URL }}
WALLET_PASSWORD: ${{ secrets.WALLET_PASSWORD_TESTNET }}
SERVICE_WORKER_LOGS: ${{ needs.setup.outputs.service_worker_logs }}
processReports:
name: Process e2e test reports
needs: [setup, tests]
runs-on: ${{ needs.setup.outputs.runner }}
# when cancelling job always() will prevent step from being cancelled and we don't want process results in this case
if: ${{ success() || failure() }}
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
pattern: 'runner-artifacts-*'
merge-multiple: true
- name: Create allure properties
working-directory: './artifacts/reports/allure/results'
run: |
echo "
branch=${BRANCH}
env=${NETWORK}
browser=${BROWSER}
platform=Linux
smoke_only=${{ needs.setup.outputs.smoke_only }}
tags=${{ needs.setup.outputs.tags }}
cardano_mainnet_url=${CARDANO_MAINNET_URL}
cardano_preprod_url=${CARDANO_PREPROD_URL}
cardano_preview_url=${CARDANO_PREVIEW_URL}
" > environment.properties
- name: Publish allure report to S3
uses: andrcuns/[email protected]
env:
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.E2E_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.E2E_AWS_SECRET_ACCESS_KEY }}
with:
storageType: s3
resultsGlob: './artifacts/reports/allure/results'
bucket: lace-e2e-test-results
prefix: 'all/linux/${BROWSER}/${RUN}'
copyLatest: true
ignoreMissingResults: true
baseUrl: 'https://${{ secrets.E2E_REPORTS_USER }}:${{ secrets.E2E_REPORTS_PASSWORD }}@${{ secrets.E2E_REPORTS_URL }}'
- name: Add link to summary
run: |
echo "TEST RESULTS:"
echo "https://${{ secrets.E2E_REPORTS_USER }}:${{ secrets.E2E_REPORTS_PASSWORD }}@${{ secrets.E2E_REPORTS_URL }}/all/linux/${{ env.BROWSER }}/${{ env.RUN }}/index.html | browser: ${{ env.BROWSER }} | network: ${{ env.NETWORK }} | platform: linux | tags: ${{ needs.setup.outputs.tags }} | smoke only: ${{ needs.setup.outputs.smoke_only }}" >> $GITHUB_STEP_SUMMARY
- name: Slack Notification
uses: rtCamp/[email protected]
env:
SLACK_COLOR: "${{ contains(needs.*.result, 'failure') && 'failure' || 'good' }}"
SLACK_ICON_EMOJI: ':lace:'
SLACK_MESSAGE: 'https://${{ secrets.E2E_REPORTS_USER }}:${{ secrets.E2E_REPORTS_PASSWORD }}@${{ secrets.E2E_REPORTS_URL }}/all/linux/${{ env.BROWSER }}/${{ env.RUN }}/index.html | browser: ${{ env.BROWSER }} | network: ${{ env.NETWORK }} | platform: linux | tags: ${{ needs.setup.outputs.tags }} | smoke only: ${{ needs.setup.outputs.smoke_only }}'
SLACK_TITLE: 'Test automation results :rocket:'
SLACK_USERNAME: lace-qa-bot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
- name: Deleting chrome tmp files
id: clean-chrome-tmp-files
if: ${{ needs.setup.outputs.runner == 'self-hosted' }}
run: |
runCommand="rm -rf /tmp/.org.chromium.*"
eval "$runCommand";
- name: Upload allure tests results
uses: actions/upload-artifact@v4
with:
name: allure-results
path: ./artifacts/reports/allure/results