Skip to content

Commit e75ed18

Browse files
authored
Pmm3 add ps replica (#116)
* Updates add PS replica test in setup
1 parent 74d03b3 commit e75ed18

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

.github/workflows/PMM_PS.yaml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ on:
33
workflow_dispatch:
44
inputs:
55
ps_version:
6-
description: "ps version example: 8.0.34-26 , Fetched from https://github.com/Percona-QA/package-testing/blob/master/VERSIONS"
7-
default: 'https://github.com/Percona-QA/package-testing/blob/master/VERSIONS'
6+
description: "PS Version ex: 5.7/8.0/8.4, Minor versions from https://github.com/Percona-QA/package-testing/blob/master/VERSIONS"
7+
default: '8.4'
88
required: true
99
ps_glibc:
10-
description: "ps glibc version, example: 2.35"
10+
description: "PS Glibc version, example: 2.35"
1111
default: '2.35'
1212
required: false
1313
pmm_qa_branch:
@@ -19,11 +19,11 @@ on:
1919
required: false
2020
type: string
2121
pmm_server_image:
22-
description: "pmm_image, example: perconalab/pmm-server:3-dev-latest"
22+
description: "PMM Server image, example: perconalab/pmm-server:3-dev-latest"
2323
default: 'perconalab/pmm-server:3-dev-latest'
2424
required: false
2525
pmm_client_version:
26-
description: 'PMM Client version (3-dev-latest|pmm3-rc|x.xx.x|https...)'
26+
description: 'PMM Client version (3-dev-latest|pmm3-rc|3.xx.x|https...)'
2727
default: '3-dev-latest'
2828
required: false
2929
type: string
@@ -41,7 +41,7 @@ jobs:
4141
timeout-minutes: 40
4242
env:
4343
ADMIN_PASSWORD: 'admin'
44-
PS_VERSION: ${{ github.event.inputs.ps_version || '8.0' }}
44+
PS_VERSION: ${{ github.event.inputs.ps_version || '8.4' }}
4545
PS_GLIBC: ${{ github.event.inputs.ps_glibc || '2.35' }}
4646
PMM_SERVER_IMAGE: ${{ github.event.inputs.pmm_server_image || 'perconalab/pmm-server:3-dev-latest' }}
4747
PMM_QA_BRANCH: ${{ github.event.inputs.pmm_qa_branch || 'v3' }}
@@ -92,7 +92,7 @@ jobs:
9292
working-directory: qa-integration
9393
run: echo "PATH_TO_PMM_QA=$(pwd)" >> $GITHUB_ENV
9494

95-
- name: Run Setup for E2E Tests
95+
- name: Run Setup for PS E2E Tests
9696
working-directory: qa-integration/pmm_qa
9797
run: |
9898
mkdir -m 777 -p /tmp/backup_data
@@ -107,6 +107,16 @@ jobs:
107107
python pmm-framework.py --verbose --pmm-server-password=${{ env.ADMIN_PASSWORD }} --client-version=${{ env.PMM_CLIENT_VERSION }} --database PS,TARBALL=${{ env.PS_TARBALL_PATH }}
108108
fi
109109
110+
- name: Run Setup for PS Replica E2E Tests
111+
working-directory: qa-integration/pmm_qa
112+
run: |
113+
. virtenv/bin/activate
114+
if [[ "${{ github.event.inputs.ps_version }}" != http* ]]; then
115+
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
116+
else
117+
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
118+
fi
119+
110120
- name: Checkout PMM UI tests
111121
uses: actions/checkout@v4
112122
with:
@@ -118,8 +128,8 @@ jobs:
118128
run: npm ci && npx playwright install --with-deps && npx codeceptjs def pr.codecept.js
119129
working-directory: pmm-ui-tests
120130

121-
- name: Run the Integration tests of PS
131+
- name: Run the Integration tests of PS and PS Replica
122132
run: |
123133
export PMM_UI_URL="http://127.0.0.1:8081/"
124-
npx codeceptjs run -c pr.codecept.js tests/qa-integration/pmm_ps_integration_test.js
134+
npx codeceptjs run -c pr.codecept.js tests/qa-integration/pmm_ps_integration_test.js tests/qa-integration/pmm_ps_replica_integration_test.js
125135
working-directory: pmm-ui-tests

pmm_qa/pmm-framework.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ def setup_ps(db_type, db_version=None, db_config=None, args=None):
177177
'PS_NODES': no_of_nodes,
178178
'PS_VERSION': ps_version,
179179
'PMM_SERVER_IP': args.pmm_server_ip or container_name or '127.0.0.1',
180-
'PS_CONTAINER': 'ps_pmm_' + str(ps_version),
180+
'PS_CONTAINER': 'ps_pmm_' + str(ps_version) + ('_replica' if setup_type_value in ("replication", "replica") else ''),
181+
'PS_PORT': 3318 if setup_type_value in ("replication", "replica") else 3317,
181182
'CLIENT_VERSION': get_value('CLIENT_VERSION', db_type, args, db_config),
182183
'QUERY_SOURCE': get_value('QUERY_SOURCE', db_type, args, db_config),
183184
'PS_TARBALL': get_value('TARBALL', db_type, args, db_config),

pmm_qa/ps_pmm_setup.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
admin_password: "{{ lookup('vars', 'extra_admin_password', default=lookup('env','ADMIN_PASSWORD') | default('admin', true) ) }}"
1616
pmm_qa_branch: "{{ lookup('vars', 'extra_pmm_qa_branch', default=lookup('env','PMM_QA_GIT_BRANCH') | default('main', true) ) }}"
1717
number_of_nodes: "{{ lookup('vars', 'extra_number_of_nodes', default=lookup('env','PS_NODES') | default('3', true) ) }}"
18+
ps_port: "{{ lookup('vars', 'extra_number_of_nodes', default=lookup('env','PS_PORT') | default('3317', true) ) }}"
1819
group_replication: "{{ lookup('vars', 'extra_group_replication', default=lookup('env','GROUP_REPLICATION') | default('', true) ) }}"
1920

2021
tasks:
@@ -32,7 +33,7 @@
3233
- name: Prepare Container for ps and Proxysql
3334
shell: >
3435
docker run -d --name={{ ps_container }}
35-
-p 3317:3307
36+
-p {{ ps_port }}:3307
3637
phusion/baseimage:jammy-1.0.1
3738
3839
- name: Copy all required Artifacts to the docker ps_container
@@ -68,5 +69,5 @@
6869
- name: Execute Setup script inside the ps ps_container
6970
shell: "{{ item }}"
7071
with_items:
71-
- docker exec {{ ps_container }} bash -xe ./client_container_ps_setup.sh --ps_version {{ ps_version }} --ps_tarball {{ ps_tarball }} --number_of_nodes {{ number_of_nodes }} --query_source {{ query_source }} --group_replication {{ group_replication }} > setup_ps_{{ ps_version }}.log
72+
- docker exec {{ ps_container }} bash -xe ./client_container_ps_setup.sh --ps_version {{ ps_version }} --ps_tarball {{ ps_tarball }} --number_of_nodes {{ number_of_nodes }} --query_source {{ query_source }} --group_replication {{ group_replication }} > setup_ps_{{ ps_container }}.log
7273

0 commit comments

Comments
 (0)