-
Notifications
You must be signed in to change notification settings - Fork 28
289 lines (253 loc) · 12.3 KB
/
pmm2-testsuite.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
name: PMM2 Integration Tests
on:
# run with default inputs
workflow_dispatch:
inputs:
server_image:
description: "pmm-server docker image, default perconalab/pmm-server:dev-latest"
required: false
type: string
client_version:
description: "pmm2-client version Tarball or Dev-latest, default is dev-latest"
required: false
type: string
client_image:
description: "pmm2-client docker image, default perconalab/pmm-client:dev-latest"
required: false
type: string
pmm_qa_branch:
description: "Branch for PMM-QA to checkout"
required: false
type: string
pmm_ui_branch:
description: "Branch for PMM-UI(CLI) tests to checkout"
required: false
type: string
sha:
description: "SHA (leave empty if running manually, default - 'null')"
required: false
type: string
workflow_call:
inputs:
server_image:
description: "pmm-server docker image, default perconalab/pmm-server:dev-latest"
required: false
type: string
client_version:
description: "pmm2-client version Tarball or Dev-latest, default is dev-latest"
required: false
type: string
client_image:
description: "pmm2-client docker image, default perconalab/pmm-client:dev-latest"
required: false
type: string
pmm_qa_branch:
description: "Branch for PMM-QA to checkout"
required: false
type: string
pmm_ui_branch:
description: "Branch for PMM-UI(CLI) tests to checkout"
required: false
type: string
sha:
description: "SHA (leave empty if running manually, default - 'null')"
required: false
type: string
jobs:
cli-tests:
runs-on: ubuntu-latest
timeout-minutes: 40
env:
SERVER_IMAGE: ${{ github.event.inputs.server_image || inputs.server_image || 'perconalab/pmm-server:dev-latest' }}
CLIENT_IMAGE: ${{ github.event.inputs.client_image || inputs.client_image || 'perconalab/pmm-client:dev-latest' }}
CLIENT_VERSION: ${{ github.event.inputs.client_version || inputs.client_version || 'dev-latest' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PMM_QA_BRANCH: ${{ github.event.inputs.pmm_qa_branch || inputs.pmm_qa_branch || 'main' }}
PMM_UI_BRANCH: ${{ github.event.inputs.pmm_ui_branch || inputs.pmm_ui_branch || 'main' }}
DOCKER_VERSION: ${{ github.event.inputs.server_image || inputs.server_image || 'perconalab/pmm-server:dev-latest' }}
CLIENT_DOCKER_VERSION: ${{ github.event.inputs.client_image || inputs.client_image || 'perconalab/pmm-client:dev-latest' }}
SHA: ${{ github.event.inputs.sha || inputs.sha || github.event.pull_request.head.sha || github.event.pull_request.head.sha || github.sha || 'null' }}
strategy:
fail-fast: false
matrix:
db-type: [ps5.7, ps8, ms8.0, pdpgsql13, pdpgsql14, pdpgsql15, modb4.4, modb5, modb6, help, generic, server-container, clientContainer, haproxy, proxysql, remove]
steps:
- name: Create status check
if: ${{ env.SHA != 'null' }}
uses: percona/gh-action-github-status-action@update-node
continue-on-error: true
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
context: "${{ matrix.db-type }} CLI tests"
description: "Test execution ${{ job.status }}"
state: "pending"
repository: ${{ github.repository }}
target_url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
sha: ${{ env.SHA }}
- name: Checkout PMM-QA tests ${{ env.PMM_QA_BRANCH }} branch
uses: actions/checkout@v4
with:
ref: ${{ env.PMM_QA_BRANCH }}
repository: percona/pmm-qa
path: ./
- name: Checkout PMM UI tests
uses: actions/checkout@v4
with:
ref: ${{ env.PMM_UI_BRANCH }}
repository: percona/pmm-ui-tests
path: ./pmm-ui-tests
- name: Install playwright
working-directory: ./pmm-ui-tests/cli
run: |
npm ci
- name: Setup tools
run: |
sudo apt-get install -y apt-transport-https ca-certificates dirmngr ansible libaio1 libaio-dev libnuma-dev libncurses5 socat sysbench
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 8919F6BD2B48D754
echo "deb https://packages.clickhouse.com/deb stable main" | sudo tee \
/etc/apt/sources.list.d/clickhouse.list
sudo apt-get update
sudo apt-get install -y clickhouse-client
sudo curl -s https://raw.githubusercontent.com/datacharmer/dbdeployer/master/scripts/dbdeployer-install.sh | bash
wget https://raw.githubusercontent.com/Percona-QA/percona-qa/master/get_download_link.sh
chmod +x get_download_link.sh
- name: Setup PMM2-Server
run: |
docker create -v /srv --name pmm-server-data ${{ env.SERVER_IMAGE }}
docker run -d -p 80:80 -p 443:443 -p 9000:9000 \
-e PERCONA_TEST_PLATFORM_ADDRESS=https://check-dev.percona.com:443 \
-e PERCONA_TEST_PLATFORM_PUBLIC_KEY=RWTg+ZmCCjt7O8eWeAmTLAqW+1ozUbpRSKSwNTmO+exlS5KEIPYWuYdX \
--volumes-from pmm-server-data --name pmm-server --restart always ${{ env.SERVER_IMAGE }}
timeout 240 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://127.0.0.1/v1/readyz)" != "200" ]]; do sleep 2; done' || false
- name: Setup PMM2-Client
run: sudo -E bash -x ./pmm-tests/pmm2-client-setup.sh --pmm_server_ip 127.0.0.1 --client_version ${{ env.CLIENT_VERSION }} --admin_password admin --use_metrics_mode no
- name: Setup npm modules for the integration setup
working-directory: pmm-integration
run: npm ci
- name: Run CLI '--help' tests
if: ${{ matrix.db-type == 'help' }}
working-directory: ./pmm-ui-tests/cli
run: npx playwright test pmm-ui-tests/cli/tests/help.spec.ts --quiet
- name: Run CLI remove tests
if: ${{ matrix.db-type == 'remove' }}
working-directory: ./pmm-ui-tests/cli
run: npx playwright test pmm-ui-tests/cli/tests/remove.spec.ts --quiet
- name: Run Setup for ps5.7
working-directory: pmm-integration
if: ${{ matrix.db-type == 'ps5.7' }}
run: |
sudo npx ts-node ./integration-setup.ts --ps-version=5.7 --ci --addclient=ps,1
- name: Run Setup for ps8.0
working-directory: pmm-integration
if: ${{ matrix.db-type == 'ps8' }}
run: |
sudo npx ts-node ./integration-setup.ts --ps-version=8 --ci --addclient=ps,1
- name: Run CLI tests for PS
if: ${{ matrix.db-type == 'ps5.7' || matrix.db-type == 'ps8' }}
working-directory: ./pmm-ui-tests/cli
run: npx playwright test pmm-ui-tests/cli/tests/perconaMySqlServer.spec.ts --quiet
- name: Run Setup for pdpgsql 13
working-directory: pmm-integration
if: ${{ matrix.db-type == 'pdpgsql13' }}
run: |
sudo npx ts-node ./integration-setup.ts --ci --addclient=pdpgsql,1 --pdpgsql-version=13
- name: Run Setup for pdpgsql 14
working-directory: pmm-integration
if: ${{ matrix.db-type == 'pdpgsql14' }}
run: |
sudo npx ts-node ./integration-setup.ts --ci --addclient=pdpgsql,1 --pdpgsql-version=14
- name: Run Setup for pdpgsql 15.0
working-directory: pmm-integration
if: ${{ matrix.db-type == 'pdpgsql15' }}
run: |
sudo npx ts-node ./integration-setup.ts --ci --addclient=pdpgsql,1 --pdpgsql-version=15.0
- name: Run CLI tests for PDPGSQL
if: ${{ matrix.db-type == 'pdpgsql13' || matrix.db-type == 'pdpgsql14' || matrix.db-type == 'pdpgsql15' }}
working-directory: ./pmm-ui-tests/cli
run: npx playwright test postgreSql --quiet
- name: Run Setup for PSMDB 4.4
working-directory: pmm-integration
if: ${{ matrix.db-type == 'modb4.4' }}
run: |
sudo npx ts-node ./integration-setup.ts --ci --addclient=modb,1 --mo-version=4
sudo -E bash -x ../pmm-tests/pmm-framework.sh --addclient=modb,1 --mo-version=4 --with-shard --mongomagic
- name: Run Setup for PSMDB 5
working-directory: pmm-integration
if: ${{ matrix.db-type == 'modb5' }}
run: |
sudo npx ts-node ./integration-setup.ts --ci --addclient=modb,1 --mo-version=5
sudo -E bash -x ../pmm-tests/pmm-framework.sh --addclient=modb,1 --mo-version=5 --with-shard --mongomagic
- name: Run Setup for PSMDB 6
working-directory: pmm-integration
if: ${{ matrix.db-type == 'modb6' }}
run: |
sudo npx ts-node ./integration-setup.ts --ci --addclient=modb,1 --mo-version=6
sudo -E bash -x ../pmm-tests/pmm-framework.sh --addclient=modb,1 --mo-version=6 --with-shard --mongomagic
- name: Run CLI tests for PSMDB
if: ${{ matrix.db-type == 'modb6' || matrix.db-type == 'modb5' || matrix.db-type == 'modb4.4' }}
working-directory: ./pmm-ui-tests/cli
run: |
npx playwright test pmm-ui-tests/cli/tests/mongoDb-psmdb.spec.ts --quiet
# TODO: Add setup for the official MongoDB and run "npx playwright test pmm-ui-tests/cli/tests/mongoDb.spec.ts"
- name: Run Client Container Setup
if: ${{ matrix.db-type == 'clientContainer' }}
run: |
sudo -E bash -x ./pmm-tests/pmm-framework.sh --setup-pmm-client-docker --pmm2
- name: Run CLI tests for Generic Scenarios
if: ${{ matrix.db-type == 'generic' }}
working-directory: ./pmm-ui-tests/cli
run: npx playwright test generic unregister --quiet
- name: Run CLI tests for PMM Server Container
if: ${{ matrix.db-type == 'server-container' && !contains(env.PMM_UI_BRANCH, 'pmm-2.') }}
working-directory: ./pmm-ui-tests/cli
run: npx playwright test pmm-server-only --quiet
- name: Run CLI tests for PMM Client Docker Container
if: ${{ matrix.db-type == 'clientContainer' }}
working-directory: ./pmm-ui-tests/cli
run: npx playwright test pmm-client-docker --quiet
- name: Run Setup for HAPROXY
if: ${{ matrix.db-type == 'haproxy' }}
run: |
export CLIENT_VERSION=${{ env.CLIENT_VERSION }}
export CLIENT_DOCKER_VERSION=${{ env.CLIENT_DOCKER_VERSION }}
sudo -E bash -x ./pmm-tests/pmm-framework.sh --addclient=haproxy,1 --pmm2
- name: Run CLI tests for Client Container Scenarios
if: ${{ matrix.db-type == 'haproxy' }}
working-directory: ./pmm-ui-tests/cli
run: npx playwright test haproxy --quiet
- name: Run Setup for ProxySQL
if: ${{ matrix.db-type == 'proxysql' }}
run: sudo -E bash -x ./pmm-tests/pmm-framework.sh --addclient=pxc,1 --pmm2 --pxc-version=5.7
- name: Run CLI tests for ProxySQL
if: ${{ matrix.db-type == 'proxysql' }}
working-directory: ./pmm-ui-tests/cli
run: npx playwright test proxySql --quiet
- name: Run Setup for MySQL 8.0
if: ${{ matrix.db-type == 'ms8.0' }}
run: sudo -E bash -x ./pmm-tests/pmm-framework.sh --addclient=ms,1 --pmm2 --ms-version=8.0
- name: Run MySQL specific CLI tests
if: ${{ matrix.db-type == 'ms8.0' }}
working-directory: ./pmm-ui-tests/cli
run: npx playwright test pmm-ui-tests/cli/tests/mysql.spec.ts --quiet
- name: Run CLI tests for MySQL Tests
if: ${{ matrix.db-type == 'ms8.0' }}
working-directory: ./pmm-ui-tests/cli
run: npx playwright test pmm-ui-tests/cli/tests/mysql-conf-file.spec.ts --quiet
- name: Generate and Attach the report
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: "report-${{ matrix.db-type }}"
path: ./pmm-ui-tests/cli/test-report
- name: Create status check
if: ${{ always() }}
uses: percona/gh-action-github-status-action@update-node
continue-on-error: true
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
context: "${{ matrix.db-type }} CLI tests"
description: "Test execution ${{ job.status }}"
state: ${{ job.status }}
repository: ${{ github.repository }}
target_url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
sha: ${{ env.SHA }}