-
Notifications
You must be signed in to change notification settings - Fork 2
135 lines (119 loc) · 5.48 KB
/
Copy pathPMM_PS.yaml
File metadata and controls
135 lines (119 loc) · 5.48 KB
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
name: PMM_PS
on:
workflow_dispatch:
inputs:
ps_version:
description: "PS Version ex: 5.7/8.0/8.4, Minor versions from https://github.com/Percona-QA/package-testing/blob/master/VERSIONS"
default: '8.4'
required: true
ps_glibc:
description: "PS Glibc version, example: 2.35"
default: '2.35'
required: false
pmm_qa_branch:
description: "Branch for qa-integration to checkout"
required: false
type: string
pmm_ui_tests_branch:
description: "Branch for PMM-UI tests to checkout"
required: false
type: string
pmm_server_image:
description: "PMM Server image, example: perconalab/pmm-server:3-dev-latest"
default: 'perconalab/pmm-server:3-dev-latest'
required: false
pmm_client_version:
description: 'PMM Client version (3-dev-latest|pmm3-rc|3.xx.x|https...)'
default: '3-dev-latest'
required: false
type: string
push:
branches:
- v3
pull_request:
branches:
- v3
jobs:
PMM_PS_TEST:
runs-on: ubuntu-22.04
timeout-minutes: 40
env:
ADMIN_PASSWORD: 'admin'
PS_VERSION: ${{ github.event.inputs.ps_version || '8.4' }}
PS_GLIBC: ${{ github.event.inputs.ps_glibc || '2.35' }}
PMM_SERVER_IMAGE: ${{ github.event.inputs.pmm_server_image || 'perconalab/pmm-server:3-dev-latest' }}
PMM_QA_BRANCH: ${{ github.event.inputs.pmm_qa_branch || 'v3' }}
PMM_UI_BRANCH: ${{ github.event.inputs.pmm_ui_tests_branch || 'v3' }}
PMM_CLIENT_VERSION: ${{ github.event.inputs.pmm_client_version || '3-dev-latest' }}
steps:
- uses: actions/checkout@v2
- name: PS_VERSION ENV Setup
run: |
if [[ "${{ github.event.inputs.ps_version }}" != http* ]]; then
PS_VERSION="${{ github.event.inputs.ps_version }}"
PS_VERSION_PATH=$(echo "ps-$PS_VERSION")
PS_VERSION_TRIMED=$(echo ${PS_VERSION%-*})
else
wget https://raw.githubusercontent.com/Percona-QA/package-testing/master/VERSIONS
PS_VERSION="$(grep 'PS80_VER' VERSIONS | cut -d = -f 2)"
PS_VERSION_PATH=$(echo "ps-$PS_VERSION")
PS_VERSION_TRIMED=$(echo ${PS_VERSION_FULL%-*})
fi
echo "PS_VERSION=${PS_VERSION}" | sed 's/"//g' >> $GITHUB_ENV
echo "PS_VERSION_PATH=${PS_VERSION_PATH}" >> $GITHUB_ENV
echo "PS_VERSION_TRIMED=${PS_VERSION_TRIMED}" >> $GITHUB_ENV
- name: Concatenate values to environment file
run: |
echo "PS_TARBALL_PATH=https://downloads.percona.com/downloads/TESTING/${{env.PS_VERSION_PATH}}/Percona-Server-${{env.PS_VERSION}}-Linux.x86_64.glibc${{env.PS_GLIBC}}.tar.gz" >> $GITHUB_ENV
echo "PMM_QA_REPO_URL=https://github.com/percona/pmm-qa/" >> $GITHUB_ENV
echo "PMM_QA_REPO_BRANCH=main" >> $GITHUB_ENV
- name: Install Ansible and update the node
run: sudo apt-get update -y && sudo apt-get install ansible -y
- name: Run the PMM Server container
run: docker run --detach --restart always -p 443:8443 -p 8081:8080 --name pmm-server ${{ env.PMM_SERVER_IMAGE }}
- name: Checkout qa-integration repo
uses: actions/checkout@v4
with:
ref: ${{ env.PMM_QA_BRANCH }}
repository: Percona-Lab/qa-integration
path: ./qa-integration
- name: Export path to qa-integration repo
working-directory: qa-integration
run: echo "PATH_TO_PMM_QA=$(pwd)" >> $GITHUB_ENV
- name: Run Setup for PS E2E Tests
working-directory: qa-integration/pmm_qa
run: |
mkdir -m 777 -p /tmp/backup_data
python3 -m venv virtenv
. virtenv/bin/activate
pip install --upgrade pip
pip install --force-reinstall -U setuptools
pip install -r requirements.txt
if [[ "${{ github.event.inputs.ps_version }}" != http* ]]; then
python pmm-framework.py --verbose --pmm-server-password=${{ env.ADMIN_PASSWORD }} --client-version=${{ env.PMM_CLIENT_VERSION }} --database PS=${{ env.PS_VERSION }}
else
python pmm-framework.py --verbose --pmm-server-password=${{ env.ADMIN_PASSWORD }} --client-version=${{ env.PMM_CLIENT_VERSION }} --database PS,TARBALL=${{ env.PS_TARBALL_PATH }}
fi
- name: Run Setup for PS Replica E2E Tests
working-directory: qa-integration/pmm_qa
run: |
. virtenv/bin/activate
if [[ "${{ github.event.inputs.ps_version }}" != http* ]]; then
python pmm-framework.py --verbose --pmm-server-password=${{ env.ADMIN_PASSWORD }} --client-version=${{ env.PMM_CLIENT_VERSION }} --database PS=${{ env.PS_VERSION }},SETUP_TYPE=replica
else
python pmm-framework.py --verbose --pmm-server-password=${{ env.ADMIN_PASSWORD }} --client-version=${{ env.PMM_CLIENT_VERSION }} --database PS,TARBALL=${{ env.PS_TARBALL_PATH }},SETUP_TYPE=replica
fi
- 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 npx dependencies
run: npm ci && npx playwright install --with-deps && npx codeceptjs def pr.codecept.js
working-directory: pmm-ui-tests
- name: Run the Integration tests of PS and PS Replica
run: |
export PMM_UI_URL="http://127.0.0.1:8081/"
npx codeceptjs run -c pr.codecept.js tests/qa-integration/pmm_ps_integration_test.js tests/qa-integration/pmm_ps_replica_integration_test.js
working-directory: pmm-ui-tests