Skip to content

Commit

Permalink
Merge pull request #631 from Percona-QA/PMM-11046-fix-test
Browse files Browse the repository at this point in the history
PMM-11046 pmm2-client_integration_upgrade_custom_port updated
  • Loading branch information
Vadym Yarosh authored Feb 5, 2024
2 parents 5a28e62 + e7776d6 commit e09a1ad
Show file tree
Hide file tree
Showing 11 changed files with 140 additions and 307 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pmm-package-test-fb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
repository: 'dev-latest'

fb_test:
name: ${{ inputs.test_name || 'pmm2-client_integration_custom_path' }}
name: ${{ inputs.playbook }}
uses: ./.github/workflows/pmm-package-test-runner.yml
secrets: inherit
needs: get_versions
Expand All @@ -83,8 +83,8 @@ jobs:
os: ${{ fromJSON(needs.get_versions.outputs.pt_os) }}
with:
package_testing_branch: ${{ inputs.package_testing_branch || 'master' }}
pmm_server_image: ${{ inputs.package_testing_branch }}
pmm_client_tarball: ${{ inputs.package_testing_branch }}
pmm_server_image: ${{ inputs.pmm_server_image }}
pmm_client_tarball: ${{ inputs.pmm_client_tarball == 'dev-latest' && needs.get_versions.outputs.finish_version || inputs.pmm_client_tarball }}
expected_version: ${{needs.get_versions.outputs.finish_version}}
repository: 'dev-latest'
metrics_mode: ${{ inputs.metrics_mode || 'auto' }}
Expand Down
32 changes: 11 additions & 21 deletions .github/workflows/pmm-package-test-matrix-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ on:

jobs:
c_test:
name: "pmm2-client"
name: "Package Install (basic)"
uses: ./.github/workflows/pmm-package-test-single.yml
secrets: inherit
with:
Expand All @@ -40,7 +40,7 @@ jobs:
playbook: "pmm2-client_integration"

cu_test:
name: "pmm2-client_upgrade"
name: "Package Upgrade (basic)"
uses: ./.github/workflows/pmm-package-test-single.yml
secrets: inherit
with:
Expand All @@ -50,7 +50,7 @@ jobs:
playbook: "pmm2-client_upgrade"

tb_test:
name: "pmm2-client_custom_path"
name: "Tarball Install (basic)"
uses: ./.github/workflows/pmm-package-test-single.yml
secrets: inherit
with:
Expand All @@ -60,7 +60,7 @@ jobs:
playbook: "pmm2-client_custom_path"

auth_config_test:
name: "pmm2-client_integration_auth_config"
name: "Package Install (auth config)"
uses: ./.github/workflows/pmm-package-test-single.yml
secrets: inherit
with:
Expand All @@ -70,7 +70,7 @@ jobs:
playbook: "pmm2-client_integration_auth_config"

auth_register_test:
name: "pmm2-client_integration_auth_register"
name: "Package Install (auth register)"
uses: ./.github/workflows/pmm-package-test-single.yml
secrets: inherit
with:
Expand All @@ -79,18 +79,8 @@ jobs:
metrics_mode: ${{ inputs.metrics_mode || 'auto' }}
playbook: "pmm2-client_integration_auth_register"

auth_setup_test:
name: "pmm2-client_integration_auth_setup"
uses: ./.github/workflows/pmm-package-test-single.yml
secrets: inherit
with:
package_testing_branch: ${{ inputs.package_testing_branch || 'master' }}
repository: ${{ inputs.repository || 'dev-latest' }}
metrics_mode: ${{ inputs.metrics_mode || 'auto' }}
playbook: "pmm2-client_integration_auth_setup"

tbi_test:
name: "pmm2-client_integration_custom_path"
name: "Tarball Install (custom path)"
uses: ./.github/workflows/pmm-package-test-single.yml
secrets: inherit
with:
Expand All @@ -100,7 +90,7 @@ jobs:
playbook: "pmm2-client_integration_custom_path"

port_test:
name: "pmm2-client_integration_custom_port"
name: "Tarball Install (custom port)"
uses: ./.github/workflows/pmm-package-test-single.yml
secrets: inherit
with:
Expand All @@ -110,7 +100,7 @@ jobs:
playbook: "pmm2-client_integration_custom_port"

port_u_test:
name: "pmm2-client_integration_upgrade_custom_port"
name: "Package Upgrade: custom port"
uses: ./.github/workflows/pmm-package-test-single.yml
secrets: inherit
with:
Expand All @@ -120,7 +110,7 @@ jobs:
playbook: "pmm2-client_integration_upgrade_custom_port"

i_test:
name: "pmm2-client_integration"
name: "Package Install"
uses: ./.github/workflows/pmm-package-test-single.yml
secrets: inherit
with:
Expand All @@ -130,7 +120,7 @@ jobs:
playbook: "pmm2-client_integration"

iu_test:
name: "pmm2-client_integration_upgrade"
name: "Package Upgrade"
uses: ./.github/workflows/pmm-package-test-single.yml
secrets: inherit
with:
Expand All @@ -140,7 +130,7 @@ jobs:
playbook: "pmm2-client_integration_upgrade"

tu_test:
name: "pmm2-client_integration_upgrade_custom_path"
name: "Tarball Upgrade (custom path)"
uses: ./.github/workflows/pmm-package-test-single.yml
secrets: inherit
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pmm-package-test-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ jobs:
EOF
- name: "Run (${{ inputs.repository }})${{ inputs.playbook }} test on ${{ inputs.os }}"
- name: "Run (${{ contains(env.TARBALL, 'PR-') && 'feature build' || inputs.repository }})${{ inputs.playbook }} test on ${{ inputs.os }}"
working-directory: ./
run: vagrant up

Expand Down
12 changes: 6 additions & 6 deletions playbooks/pmm2-client_custom_path.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,9 @@
### Setup PMM Client
- name: Use "pmm-admin config" to set correct path base
shell: >-
pmm-agent setup --config-file={{ custom_path }}/config/pmm-agent.yaml --force --server-insecure-tls
--server-address={{ pmm_server_address }}
--metrics-mode={{ metrics_mode }}
--server-username=admin
--server-password={{ pmm_server_password }}
pmm-admin config --force --server-insecure-tls --metrics-mode={{ metrics_mode }}
--paths-base={{ custom_path }}/
--server-url=https://admin:{{ pmm_server_password }}@{{ pmm_server_address }}
{{ instance_ip }} generic node_{{ instance_ip }}
- name: Check if the configuration generated with paths-base is using the custom path
Expand All @@ -89,8 +86,11 @@
become: yes

- name: PMM-8141 fix for deleted vmscrpconfig file, file being created with vmagent reload
command: "rm -r {{ tmp_path.stdout }}/vm_agent && pkill -f vmagent"
command: "{{item}}"
become: yes
with_items:
- rm -r {{ tmp_path.stdout }}/vm_agent
- pkill -f vmagent

- name: "Wait for 'vmagent' is Running"
include_tasks: ../tasks/wait_exporter_is_running.yml
Expand Down
8 changes: 4 additions & 4 deletions playbooks/pmm2-client_integration_custom_port.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
custom_port: 17788
port_flag: "--pmm-agent-listen-port={{ custom_port }}"
tarball_link: "{{ lookup('env', 'tarball_link') }}"
install_path: "/usr/local/percona/pmm2"

tasks:
- name: Register Instance IP
Expand All @@ -44,21 +45,20 @@
### Setup PMM Client
- name: Use pmm-agent setup to configure pmm client to connect to server
shell: >-
pmm-agent setup --config-file={{ custom_path }}/config/pmm-agent.yaml --force --server-insecure-tls
pmm-agent setup --config-file={{ install_path }}/config/pmm-agent.yaml --force --server-insecure-tls
--server-address={{ pmm_server_address }}
--listen-port={{ custom_port }}
--metrics-mode={{ metrics_mode }}
--server-username=admin
--server-password={{ pmm_server_password }}
--paths-base={{ custom_path }}/
{{ instance_ip }} generic node2_{{ instance_ip }}
- name: Verify that config generated with the custom port listening
shell: "cat /usr/local/percona/pmm2/config/pmm-agent.yaml | grep -o -c '{{ custom_port }}' | grep '1'"
shell: "cat {{ install_path }}/config/pmm-agent.yaml | grep -o -c '{{ custom_port }}' | grep '1'"
become: yes

- name: Start agent on custom port non-default port
shell: pmm-agent --config-file=/usr/local/percona/pmm2/config/pmm-agent.yaml > pmm-agent.log 2>&1 &
shell: pmm-agent --config-file={{ install_path }}/config/pmm-agent.yaml > pmm-agent.log 2>&1 &

- name: check that PMM client version is correct
include_tasks: ../tasks/verify_pmm_status_versions.yml
Expand Down
4 changes: 2 additions & 2 deletions playbooks/pmm2-client_integration_upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
include_tasks: ../tasks/pmm2_client_test_prepare.yml

### enable pmm2-client release and install old version to update
- name: enable pmm2-client release repo
- name: Enable pmm2-client release repo
include_tasks: ../tasks/enable_repo.yml
vars:
only: yes
Expand Down Expand Up @@ -180,6 +180,6 @@
when: ansible_os_family == "RedHat"
yum: name=pmm2-client state=latest

### verifications after upgrade
### Verifications after upgrade
- name: Perform standard verifications set for PMM Client
include_tasks: ../tasks/verifications_set_for_pmm_client_after_upgrade.yml
2 changes: 1 addition & 1 deletion playbooks/pmm2-client_integration_upgrade_custom_path.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# Advanced package tarball upgrade test:
# Advanced tarball upgrade test:
# prepare Percona Repository and software;
# install PMM old client tarball;
# perform correct setup;
Expand Down
Loading

0 comments on commit e09a1ad

Please sign in to comment.