-
Notifications
You must be signed in to change notification settings - Fork 6
194 lines (168 loc) · 6.27 KB
/
gasp-prod-smoke-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
name: GASP UI prod smoke tests
on:
workflow_dispatch:
schedule:
- cron: "30 7 * * *"
jobs:
setup-report:
name: setup testmo report
runs-on: ubuntu-latest
outputs:
testmo-run-id: ${{ steps.setTestRun.outputs.testmo-run-id }}
steps:
- name: Install testmo
run: yarn global add @testmo/testmo-cli
- name: Add extra params
run: |
testmo automation:resources:add-field --name git --type string \
--value ${GITHUB_SHA:0:7} --resources resources.json
RUN_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
testmo automation:resources:add-link --name build \
--url $RUN_URL --resources resources.json
- name: Create test run
run: |
testmo automation:run:create \
--instance https://mangata-finance.testmo.net \
--project-id 2 \
--name "FE GASP prod smoke test run" \
--resources resources.json \
--source "gasp-prod-e2e-job" > testmo-run-id.txt
ID=$(cat testmo-run-id.txt)
echo "testmo-run-id=$ID" >> $GITHUB_OUTPUT
echo "ID=$ID" >> $GITHUB_ENV
env:
TESTMO_URL: ${{ secrets.TESTMO_URL }}
TESTMO_TOKEN: ${{ secrets.TESTMO_TOKEN }}
id: setTestRun
e2e-tm:
name: Run UI tests
needs: [setup-report]
strategy:
fail-fast: false
matrix:
command: ["first"]
runs-on: ubuntu-latest
env:
API_URL: "wss://collator-01-ws-rollup-holesky.gasp.xyz/"
UI_URL: https://holesky.gasp.xyz/
TEST_SUDO_NAME: ${{ secrets.DEV_SUDO_NAME }}
MNEMONIC_META: ${{ secrets.MNEMONIC_PROD_META }}
PRIVKEY_META: ${{ secrets.PRIVKEY_PROD_META }}
TEST_SCRIPT: "test-gasp-prod"
NODE_ENV: test
SELENIUM_REMOTE_URL: http://localhost:4444/wd/hub
steps:
- name: Start Selenoid Server
uses: Xotabu4/selenoid-github-action@v2
with:
selenoid-start-arguments: |
--args "-timeout 300s" --browsers 'chrome:119.0;chrome:129.0'
- uses: actions/checkout@v3
with:
ref: ci/temp-prod-fe-branch
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: Install testmo
run: yarn global add @testmo/testmo-cli
- name: Install dependencies with Yarn
run: yarn
- name: Tsc code quality check
run: yarn tsc-lint
- name: ESLint code quality check
run: yarn eslint
- name: installed packages
run: yarn list
- name: is selenoid started?
run: curl http://localhost:4444/status
- name: Run tests
run: yarn test-gasp-prod-${{ matrix.command }}
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: JEST UI Tests ${{ matrix.command }} # Name of the check run which will be created
path: reports/*.xml # Path to test results
reporter: jest-junit # Format of test results
- name: Install testmo
run: yarn global add @testmo/testmo-cli
- name: Submit results to the testmo-run
if: always()
run: |
testmo automation:run:submit-thread \
--instance https://mangata-finance.testmo.net \
--run-id ${{needs.setup-report.outputs.testmo-run-id}} \
--results reports/*.xml
env:
TESTMO_URL: ${{ secrets.TESTMO_URL }}
TESTMO_TOKEN: ${{ secrets.TESTMO_TOKEN }}
continue-on-error: true
- name: Sleep for 5 seconds
run: sleep 10s #close buffers of videos.
- name: Copy video files to reports folder
if: success() || failure()
run: "cp ~/.aerokube/selenoid/* -r reports/artifacts/"
- name: Create reports zip
uses: vimtor/action-zip@v1
if: success() || failure()
with:
files: reports/
dest: reports.zip
- name: Archive report files
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: ReportData ${{ matrix.command }}
path: reports.zip
- name: Archive report files
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: TestReport ${{ matrix.command }}
path: reports/html-report/report.html
test-complete:
needs: [setup-report, e2e-tm]
if: always()
runs-on: ubuntu-latest
steps:
- name: Install testmo
run: yarn global add @testmo/testmo-cli
- name: Complete test run
run: |
npx testmo automation:run:complete \
--instance https://mangata-finance.testmo.net \
--run-id ${{needs.setup-report.outputs.testmo-run-id}} \
env:
TESTMO_URL: ${{ secrets.TESTMO_URL }}
TESTMO_TOKEN: ${{ secrets.TESTMO_TOKEN }}
continue-on-error: true
slack-notify-ok:
needs: [e2e-tm, setup-report]
if: success()
runs-on: ubuntu-latest
steps:
- name: Slack Notification - OK
if: success()
uses: bryannice/gitactions-slack-notification@2.0.0
env:
SLACK_INCOMING_WEBHOOK: ${{ secrets.STG_SLACK_WEBHOOK }}
SLACK_TITLE: "PROD GASP smoke UI tests - results - OK"
SLACK_COLOR: "#00ff11"
SLACK_MESSAGE: "Test succeed in [ ${{ env.TEST_SCRIPT }} ]
testmo report: https://mangata-finance.testmo.net/automation/runs/view/${{needs.setup-report.outputs.testmo-run-id}}"
GITHUB_REF: "https://mangata-finance.github.io/mangata-e2e/${{ github.run_number }}"
slack-notify-nook:
needs: [e2e-tm]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Slack Notification - Error
uses: bryannice/gitactions-slack-notification@2.0.0
env:
SLACK_INCOMING_WEBHOOK: ${{ secrets.STG_SLACK_WEBHOOK }}
SLACK_TITLE: "PROD GASP smoke UI tests - results - NOOK"
SLACK_COLOR: "#ff0011"
SLACK_MESSAGE: "Test failures [ ${{ env.TEST_SCRIPT }} ]
testmo report: https://mangata-finance.testmo.net/automation/runs/view/${{needs.setup-report.outputs.testmo-run-id}}"
GITHUB_REF: "https://mangata-finance.github.io/mangata-e2e/${{ github.run_number }}"