Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMM-12921 added suites #657

Merged
merged 5 commits into from
Feb 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
PMM-12921 Added 2 fb groups
Vadym Yarosh committed Feb 23, 2024
commit 458caad7e537b11e58c63546012988a2373f2062
67 changes: 67 additions & 0 deletions .github/workflows/fb-integration-suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: _FB integration CLI tests

on:
workflow_dispatch:
inputs:
pmm_server_image:
description: "pmm-server docker image, default perconalab/pmm-server:dev-latest"
required: false
type: string
pmm_client_version:
description: "pmm2-client version Tarball or Dev-latest, default is dev-latest"
required: false
type: string
pmm_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_tests_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:
get_versions:
name: Get versions
uses: ./.github/workflows/pmm-version-getter.yml
with:
repository: ${{ inputs.pmm_server_case || 'release candidate'}}

pmm-server-tests:
name: 'PMM Server ${{needs.get_versions.outputs.finish_version}} containers tests'
uses: ./.github/workflows/runner-integration-cli-tests.yml
secrets: inherit
needs: get_versions
with:
sha: ${{ inputs.sha || github.event.pull_request.head.sha || 'null' }}
pmm_ui_tests_branch: ${{ inputs.pmm_ui_tests_branch || 'main' }}
pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'main' }}
pmm_server_image: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:dev-latest' }}
pmm_client_image: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:dev-latest' }}
pmm_client_version: ${{ inputs.pmm_client_version || 'dev-latest' }}
cli_test: 'pmm-server-only'

# [ps5.7, ps8, ms8.0, pdpgsql13, pdpgsql14, pdpgsql15, modb4.4, modb5, modb6, help, generic, clientContainer, haproxy, proxysql, remove]

pmm-client-container-tests:
name: 'PMM Client Docker Container tests'
uses: ./.github/workflows/runner-integration-cli-tests.yml
secrets: inherit
needs: get_versions
with:
sha: ${{ inputs.sha || github.event.pull_request.head.sha || 'null' }}
pmm_ui_tests_branch: ${{ inputs.pmm_ui_tests_branch || 'main' }}
pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'main' }}
pmm_server_image: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:dev-latest' }}
pmm_client_image: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:dev-latest' }}
pmm_client_version: ${{ inputs.pmm_client_version || 'dev-latest' }}
cli_test: 'pmm-client-docker'
services_list: '--setup-pmm-client-docker'
8 changes: 4 additions & 4 deletions .github/workflows/fb-tarball-suite.yml
Original file line number Diff line number Diff line change
@@ -70,8 +70,8 @@ jobs:
secrets: inherit
with:
package_testing_branch: 'master'
pmm_server_image: ${{ inputs.pmm_server_image }}
pmm_client_tarball: ${{ inputs.client_version || 'dev-latest' }}
pmm_server_image: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:dev-latest' }}
pmm_client_tarball: ${{ inputs.pmm_client_tarball || 'dev-latest' }}
playbook: 'pmm2-client_integration_custom_port'
test_name: 'Tarball install'
sha: ${{ inputs.sha || github.event.pull_request.head.sha || 'null' }}
@@ -82,8 +82,8 @@ jobs:
secrets: inherit
with:
package_testing_branch: 'master'
pmm_server_image: ${{ inputs.server_image || 'perconalab/pmm-server:dev-latest' }}
pmm_client_tarball: ${{ inputs.client_version || 'dev-latest' }}
pmm_server_image: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:dev-latest' }}
pmm_client_tarball: ${{ inputs.pmm_client_tarball || 'dev-latest' }}
playbook: 'pmm2-client_integration_upgrade_custom_path'
test_name: 'Tarball upgrade'
sha: ${{ inputs.sha || github.event.pull_request.head.sha || 'null' }}
Original file line number Diff line number Diff line change
@@ -211,7 +211,7 @@ jobs:
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"
# 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' }}
148 changes: 148 additions & 0 deletions .github/workflows/runner-integration-cli-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
name: _runner-integration-cli-tests
on:
workflow_call:
inputs:
pmm_qa_branch:
description: "Branch for PMM-QA to checkout"
required: false
type: string
pmm_ui_tests_branch:
description: "Branch for PMM-UI(CLI) tests to checkout"
required: false
type: string
pmm_server_image:
description: 'PMM Server docker image:'
default: 'perconalab/pmm-server:dev-latest'
required: true
type: string
client_image:
description: "pmm2-client docker image, default perconalab/pmm-client:dev-latest"
required: false
type: string
pmm_client_version:
description: 'PMM Client version (dev-latest|pmm2-latest|pmm2-rc|x.xx.x|https://tarball.tar.gz)'
default: 'dev-latest'
required: true
type: string
services_list:
description: "pmm-framework.sh flags to perform setup, '--pmm2' added implicitly"
required: false
type: string
cli_test:
description: "playwright test arguments to execute tests"
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:
SHA: ${{ github.event.inputs.sha || inputs.sha || github.event.pull_request.head.sha || github.event.pull_request.head.sha || github.sha || 'null' }}
PMM_QA_BRANCH: ${{ inputs.pmm_qa_branch || 'main' }}
PMM_UI_TESTS_BRANCH: ${{ inputs.pmm_ui_tests_branch || 'main' }}
PMM_CLIENT_VERSION: ${{ inputs.pmm_client_version || 'dev-latest' }}
### used in tests ###
PMM_SERVER_IMAGE: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:dev-latest' }}

### used in pmm-framework.sh ###
DOCKER_VERSION: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:dev-latest' }}
CLIENT_DOCKER_VERSION: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:dev-latest' }}

steps:
- name: Create status check
if: ${{ env.SHA != 'null' }}
uses: percona/gh-action-github-status-action@v1
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: <${{ env.PMM_QA_BRANCH }}>'
uses: actions/checkout@v4
with:
ref: ${{ env.PMM_QA_BRANCH }}
repository: percona/pmm-qa
path: ./

- name: 'Checkout pmm-ui-tests: <${{ env.PMM_UI_TESTS_BRANCH }}>'
uses: actions/checkout@v4
with:
ref: ${{ env.PMM_UI_TESTS_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 <PMM Sever>: "${{ env.PMM_SERVER_IMAGE }}"'
run: |
docker create -v /srv --name pmm-server-data ${{ env.PMM_SERVER_IMAGE }}
docker run -d -p 80:80 -p 443:443 -p 9000:9000 --name pmm-server \
-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
--restart always ${{ env.PMM_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 PMM Client: <${{ env.PMM_CLIENT_VERSION }}>'
run: sudo -E bash -x ./pmm-tests/pmm2-client-setup.sh --pmm_server_ip 127.0.0.1 --client_version ${{ env.PMM_CLIENT_VERSION }} --admin_password admin --use_metrics_mode no

- name: 'Run env setup'
if: ${{ !!inputs.services_list }}
run: |
sudo -E bash -x ./pmm-tests/pmm-framework.sh ${{ inputs.services_list }} --pmm2

- 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: ${{ inputs.cli_test }}'
working-directory: ./pmm-ui-tests/cli
run: npx playwright test ${{ inputs.cli_test }} --quiet

- name: Generate and Attach the report
if: ${{ failure() && !!inputs.cli_test }}
uses: actions/upload-artifact@v3
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@v1
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 }}