diff --git a/.github/workflows/PMM_PDPGSQL.yaml b/.github/workflows/PMM_PDPGSQL.yaml new file mode 100644 index 00000000..b9f5389d --- /dev/null +++ b/.github/workflows/PMM_PDPGSQL.yaml @@ -0,0 +1,84 @@ +name: PMM_PDPGSQL + +on: + workflow_dispatch: + inputs: + pmm_qa_branch: + description: 'Branch of PMM QA' + default: 'main' + required: false + type: string + pdpgsql_version: + description: 'PDPGSQL major version, e.g. 15, 16, 17' + required: true + default: '17' + 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 + type: string + pmm_client_version: + description: 'PMM Client version (3-dev-latest|pmm3-rc|x.xx.x|https...)' + default: '3-dev-latest' + required: false + type: string + + workflow_call: + inputs: + pmm_qa_branch: + required: false + type: string + pdpgsql_version: + required: false + type: string + pmm_server_image: + required: false + type: string + pmm_client_version: + required: false + type: string + +jobs: + PMM_PDPGSQL_TEST: + runs-on: ubuntu-22.04 + timeout-minutes: 40 + env: + ADMIN_PASSWORD: 'admin' + PDPGSQL_VERSION: ${{ inputs.pdpgsql_version || '17' }} + PMM_SERVER_IMAGE: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:3-dev-latest' }} + PMM_CLIENT_VERSION: ${{ inputs.pmm_client_version || '3-dev-latest' }} + + steps: + - 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 pmm-qa + uses: actions/checkout@v4 + with: + ref: ${{ inputs.pmm_qa_branch || 'main' }} + + - name: Export path to qa-integration tree + working-directory: qa-integration + run: echo "PATH_TO_PMM_QA=$(pwd)" >> $GITHUB_ENV + + - name: Run Setup for 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 + python pmm-framework.py --verbose --pmm-server-password=${{ env.ADMIN_PASSWORD }} --client-version=${{ env.PMM_CLIENT_VERSION }} --database PDPGSQL=${{ env.PDPGSQL_VERSION }} + + - name: Setup npm modules for CodeceptJS + working-directory: codeceptjs-e2e + run: npm ci && npx playwright install --with-deps && npx codeceptjs def pr.codecept.js + + - name: Run the Integration tests of PDPGSQL + working-directory: codeceptjs-e2e + run: | + export PMM_UI_URL="http://127.0.0.1:8081/" + npx codeceptjs run -c pr.codecept.js tests/qa-integration/pmm_pdpgsql_integration_test.js diff --git a/.github/workflows/PMM_PROXYSQL.yaml b/.github/workflows/PMM_PROXYSQL.yaml new file mode 100644 index 00000000..9eeff974 --- /dev/null +++ b/.github/workflows/PMM_PROXYSQL.yaml @@ -0,0 +1,121 @@ +name: PMM_PROXYSQL + +on: + workflow_dispatch: + inputs: + pmm_qa_branch: + description: 'Branch of PMM QA' + default: 'main' + required: false + type: string + pxc_version: + description: 'PXC version, example: 8.0.33-25 or VERSIONS URL' + default: 'https://github.com/Percona-QA/package-testing/blob/master/VERSIONS' + required: true + type: string + pxc_glibc: + description: 'PXC glibc version, example: 2.35' + default: '2.35' + required: true + 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 + type: string + pmm_client_version: + description: 'PMM Client version (3-dev-latest|pmm3-rc|x.xx.x|https...)' + default: '3-dev-latest' + required: false + type: string + + workflow_call: + inputs: + pmm_qa_branch: + required: false + type: string + pxc_version: + required: false + type: string + pxc_glibc: + required: false + type: string + pmm_server_image: + required: false + type: string + pmm_client_version: + required: false + type: string + +jobs: + PMM_PXC_TEST: + runs-on: ubuntu-22.04 + timeout-minutes: 40 + env: + ADMIN_PASSWORD: 'admin' + PXC_VERSION: ${{ inputs.pxc_version || '8.0' }} + PXC_GLIBC: ${{ inputs.pxc_glibc || '2.35' }} + PMM_SERVER_IMAGE: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:3-dev-latest' }} + PMM_CLIENT_VERSION: ${{ inputs.pmm_client_version || '3-dev-latest' }} + + steps: + - name: PXC_VERSION ENV Setup + run: | + if [[ "${PXC_VERSION}" != http* ]]; then + PXC_VERSION="${PXC_VERSION}" + PXC_VERSION_PATH=$(echo "pxc-$PXC_VERSION") + PXC_VERSION_TRIMED=$(echo ${PXC_VERSION%-*}) + else + wget https://raw.githubusercontent.com/Percona-QA/package-testing/master/VERSIONS + PXC_VERSION="$(grep 'PXC80_VER' VERSIONS | cut -d = -f 2)" + PXC_VERSION_PATH=$(echo "pxc-$PXC_VERSION.1") + PXC_VERSION_TRIMED=$(echo ${PXC_VERSION%-*}) + fi + echo "PXC_VERSION=${PXC_VERSION}" | sed 's/"//g' >> $GITHUB_ENV + echo "PXC_VERSION_TAR=${PXC_VERSION}.1" | sed 's/"//g' >> $GITHUB_ENV + echo "PXC_VERSION_PATH=${PXC_VERSION_PATH}" >> $GITHUB_ENV + echo "PXC_VERSION_TRIMED=${PXC_VERSION_TRIMED}" >> $GITHUB_ENV + + - name: Concatenate values to environment file + run: | + echo "PXC_TARBALL_PATH=https://downloads.percona.com/downloads/TESTING/${PXC_VERSION_PATH}/Percona-XtraDB-Cluster_${PXC_VERSION_TAR}_Linux.x86_64.glibc${PXC_GLIBC}.tar.gz" >> $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 pmm-qa + uses: actions/checkout@v4 + with: + ref: ${{ inputs.pmm_qa_branch || 'main' }} + + - name: Export path to qa-integration tree + working-directory: qa-integration + run: echo "PATH_TO_PMM_QA=$(pwd)" >> $GITHUB_ENV + + - name: Run Setup for 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 [[ "${PXC_VERSION}" != http* ]]; then + python pmm-framework.py --verbose --pmm-server-password=${{ env.ADMIN_PASSWORD }} --client-version=${{ env.PMM_CLIENT_VERSION }} --database PXC=${PXC_VERSION} + else + python pmm-framework.py --verbose --pmm-server-password=${{ env.ADMIN_PASSWORD }} --client-version=${{ env.PMM_CLIENT_VERSION }} --database PXC,TARBALL=${PXC_TARBALL_PATH} + fi + + - name: Install npx dependencies + working-directory: codeceptjs-e2e + run: npm ci && npx playwright install --with-deps && npx codeceptjs def pr.codecept.js + + - name: Run the Integration tests of PXC + working-directory: codeceptjs-e2e + run: | + export PMM_UI_URL="http://127.0.0.1:8081/" + npx codeceptjs run -c pr.codecept.js tests/qa-integration/pmm_pxc_integration_test.js diff --git a/.github/workflows/PMM_PSMDB_PBM_FULL.yml b/.github/workflows/PMM_PSMDB_PBM_FULL.yml new file mode 100644 index 00000000..b4880252 --- /dev/null +++ b/.github/workflows/PMM_PSMDB_PBM_FULL.yml @@ -0,0 +1,98 @@ +name: PMM_PSMDB_PBM_FULL + +on: + workflow_dispatch: + inputs: + pmm_qa_branch: + description: 'Branch of PMM QA' + default: 'main' + required: false + type: string + pmm_client_version: + description: 'PMM Client version string (e.g. pmm3-rc)' + default: '3-dev-latest' + required: false + type: string + pmm_server_image: + description: 'PMM Server docker image' + default: 'perconalab/pmm-server:3-dev-latest' + required: false + type: string + + workflow_call: + inputs: + pmm_qa_branch: + required: false + type: string + pmm_client_version: + required: false + type: string + pmm_server_image: + required: false + type: string + +jobs: + test_replica_set: + runs-on: ubuntu-22.04 + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + psmdb: ['6.0', '7.0', '8.0'] + env: + PMM_CLIENT_VERSION: ${{ inputs.pmm_client_version || '3-dev-latest' }} + PMM_SERVER_IMAGE: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:3-dev-latest' }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.pmm_qa_branch || 'main' }} + - name: Test RS with PSMDB ${{ matrix.psmdb }} + run: | + PSMDB_VERSION=${{ matrix.psmdb }} ./start-rs.sh + working-directory: ./qa-integration/pmm_psmdb-pbm_setup + + test_sharded_cluster: + runs-on: ubuntu-22.04 + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + psmdb: ['6.0', '7.0', '8.0'] + env: + PMM_CLIENT_VERSION: ${{ inputs.pmm_client_version || '3-dev-latest' }} + PMM_SERVER_IMAGE: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:3-dev-latest' }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.pmm_qa_branch || 'main' }} + - name: Test sharded with PSMDB ${{ matrix.psmdb }} + run: | + PSMDB_VERSION=${{ matrix.psmdb }} ./start-sharded.sh + working-directory: ./qa-integration/pmm_psmdb-pbm_setup + + test_diff_auth: + runs-on: ubuntu-22.04 + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + psmdb: ['6.0', '7.0', '8.0'] + env: + PMM_CLIENT_VERSION: ${{ inputs.pmm_client_version || '3-dev-latest' }} + PMM_SERVER_IMAGE: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:3-dev-latest' }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.pmm_qa_branch || 'main' }} + - name: Test auth with PSMDB ${{ matrix.psmdb }} + run: | + PSMDB_VERSION=${{ matrix.psmdb }} ./test-auth.sh + working-directory: ./qa-integration/pmm_psmdb_diffauth_setup + - name: PMM Server container logs + if: failure() + run: | + docker logs pmm-server || true + - name: PSMDB Server container logs + if: failure() + run: | + docker logs psmdb-server || true diff --git a/.github/workflows/gssapi-psmdb-tests-matrix.yml b/.github/workflows/gssapi-psmdb-tests-matrix.yml index 2d883498..d524b523 100644 --- a/.github/workflows/gssapi-psmdb-tests-matrix.yml +++ b/.github/workflows/gssapi-psmdb-tests-matrix.yml @@ -60,6 +60,15 @@ on: pmm_client_image: required: false type: string + pmm_client_version_ol8: + required: false + type: string + pmm_client_version_ol9: + required: false + type: string + repository: + required: false + type: string expected_version: required: false type: string @@ -171,6 +180,7 @@ jobs: secrets: inherit with: sha: ${{ inputs.sha || github.event.pull_request.head.sha || 'null' }} + pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'main' }} pmm_server_image: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:3-dev-latest' }} pmm_client_image: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:3-dev-latest' }} pmm_client_version: ${{ inputs.pmm_client_version_ol8 || 'https://s3.us-east-2.amazonaws.com/pmm-build-cache/PR-BUILDS/pmm-client/pmm-client-dynamic-ol8-latest.tar.gz' }} @@ -184,6 +194,7 @@ jobs: secrets: inherit with: sha: ${{ inputs.sha || github.event.pull_request.head.sha || 'null' }} + pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'main' }} pmm_server_image: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:3-dev-latest' }} pmm_client_image: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:3-dev-latest' }} pmm_client_version: ${{ inputs.pmm_client_version_ol8 || 'https://s3.us-east-2.amazonaws.com/pmm-build-cache/PR-BUILDS/pmm-client/pmm-client-dynamic-ol8-latest.tar.gz' }} @@ -197,6 +208,7 @@ jobs: secrets: inherit with: sha: ${{ inputs.sha || github.event.pull_request.head.sha || 'null' }} + pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'main' }} pmm_server_image: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:3-dev-latest' }} pmm_client_image: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:3-dev-latest' }} pmm_client_version: ${{ inputs.pmm_client_version_ol8 || 'https://s3.us-east-2.amazonaws.com/pmm-build-cache/PR-BUILDS/pmm-client/pmm-client-dynamic-ol8-latest.tar.gz' }} @@ -210,6 +222,7 @@ jobs: secrets: inherit with: sha: ${{ inputs.sha || github.event.pull_request.head.sha || 'null' }} + pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'main' }} pmm_server_image: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:3-dev-latest' }} pmm_client_image: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:3-dev-latest' }} pmm_client_version: ${{ inputs.pmm_client_version_ol9 || 'https://s3.us-east-2.amazonaws.com/pmm-build-cache/PR-BUILDS/pmm-client/pmm-client-dynamic-ol9-latest.tar.gz' }} @@ -223,6 +236,7 @@ jobs: secrets: inherit with: sha: ${{ inputs.sha || github.event.pull_request.head.sha || 'null' }} + pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'main' }} pmm_server_image: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:3-dev-latest' }} pmm_client_image: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:3-dev-latest' }} pmm_client_version: ${{ inputs.pmm_client_version_ol9 || 'https://s3.us-east-2.amazonaws.com/pmm-build-cache/PR-BUILDS/pmm-client/pmm-client-dynamic-ol9-latest.tar.gz' }} @@ -236,6 +250,7 @@ jobs: secrets: inherit with: sha: ${{ inputs.sha || github.event.pull_request.head.sha || 'null' }} + pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'main' }} pmm_server_image: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:3-dev-latest' }} pmm_client_image: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:3-dev-latest' }} pmm_client_version: ${{ inputs.pmm_client_version_ol9 || 'https://s3.us-east-2.amazonaws.com/pmm-build-cache/PR-BUILDS/pmm-client/pmm-client-dynamic-ol9-latest.tar.gz' }} diff --git a/.github/workflows/rc-testing-suite.yml b/.github/workflows/rc-testing-suite.yml new file mode 100644 index 00000000..06bc106b --- /dev/null +++ b/.github/workflows/rc-testing-suite.yml @@ -0,0 +1,165 @@ +name: "RC Testing Suite" + +on: + workflow_dispatch: + inputs: + rc_version: + description: 'Numeric RC version, e.g. 3.7.0 (images perconalab/pmm-server:-rc and perconalab/pmm-client:-rc;)' + required: true + type: string + pmm_client_tarball_ol8: + description: 'RC OL8 pmm-client dynamic tarball URL (from client autobuild)' + required: true + type: string + pmm_client_tarball_ol9: + description: 'RC OL9 pmm-client dynamic tarball URL (from client autobuild)' + required: true + type: string + pmm_qa_branch: + description: 'PMM QA branch' + required: false + default: 'main' + type: string + pxc_version: + description: 'PMM_PROXYSQL: PXC version or VERSIONS URL' + required: false + default: '8.0' + type: string + pxc_glibc: + description: 'PMM_PROXYSQL: glibc suffix (e.g. 2.35)' + required: false + default: '2.35' + type: string + pdpgsql_version: + description: 'PMM_PDPGSQL: major version (15, 16, 17, …)' + required: false + default: '17' + type: string + +jobs: + get_compat_versions: + name: GA pmm-client tags (pmm-version-getter) + uses: ./.github/workflows/pmm-version-getter.yml + with: + repository: 'release candidate' + matrix_range: '5' + + plan: + name: Compatibility matrix (percona/pmm-client) + needs: get_compat_versions + runs-on: ubuntu-latest + timeout-minutes: 1 + outputs: + compat_matrix: ${{ steps.pick.outputs.compat_matrix }} + steps: + - id: pick + shell: bash + env: + VERSIONS_JSON: ${{ needs.get_compat_versions.outputs.version_matrix }} + run: | + set -euo pipefail + n="$(echo "$VERSIONS_JSON" | jq 'length')" + if [[ "$n" -lt 1 ]]; then + echo '::error::pmm-version-getter returned no GA tags for compatibility (check Docker Hub).' + exit 1 + fi + compat_matrix_json="$(echo "$VERSIONS_JSON" | jq 'map({version: ., image: ("percona/pmm-client:" + .)})')" + { + echo "compat_matrix<<__COMPAT_MATRIX_EOF__" + echo "$compat_matrix_json" + echo "__COMPAT_MATRIX_EOF__" + } >> "$GITHUB_OUTPUT" + + cli_integration_tests: + name: CLI integration (pmm-cli-integration-tests) + needs: plan + uses: ./.github/workflows/integration-cli-tests.yml + secrets: + LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN }} + with: + pmm_qa_branch: ${{ inputs.pmm_qa_branch }} + pmm_server_image: 'perconalab/pmm-server:${{ inputs.rc_version }}-rc' + pmm_client_image: 'perconalab/pmm-client:${{ inputs.rc_version }}-rc' + pmm_client_version: pmm3-rc + + compatibility_integration_tests: + name: Compatibility CLI (${{ matrix.version }}) + needs: plan + strategy: + fail-fast: false + matrix: + include: ${{ fromJson(needs.plan.outputs.compat_matrix) }} + uses: ./.github/workflows/integration-cli-tests.yml + secrets: + LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN }} + with: + pmm_qa_branch: ${{ inputs.pmm_qa_branch }} + pmm_server_image: 'perconalab/pmm-server:${{ inputs.rc_version }}-rc' + pmm_client_image: ${{ matrix.image }} + pmm_client_version: ${{ matrix.version }} + + e2e_tests_matrix: + name: E2E Tests Matrix (CodeceptJS) + needs: plan + uses: ./.github/workflows/e2e-tests-matrix.yml + secrets: inherit + with: + pmm_server_image: 'perconalab/pmm-server:${{ inputs.rc_version }}-rc' + pmm_client_image: 'perconalab/pmm-client:${{ inputs.rc_version }}-rc' + pmm_client_version: pmm3-rc + pmm_qa_branch: ${{ inputs.pmm_qa_branch }} + + helm_tests: + name: pmm3-helm + needs: plan + uses: ./.github/workflows/helm-tests.yml + secrets: inherit + with: + server_image: 'perconalab/pmm-server:${{ inputs.rc_version }}-rc' + client_image: 'perconalab/pmm-client:${{ inputs.rc_version }}-rc' + pmm_chart_branch: latest + pmm_qa_branch: ${{ inputs.pmm_qa_branch }} + + gssapi_tests: + name: GSSAPI Tests Matrix + needs: plan + uses: ./.github/workflows/gssapi-psmdb-tests-matrix.yml + secrets: inherit + with: + pmm_server_image: 'perconalab/pmm-server:${{ inputs.rc_version }}-rc' + pmm_client_image: 'perconalab/pmm-client:${{ inputs.rc_version }}-rc' + pmm_qa_branch: ${{ inputs.pmm_qa_branch }} + pmm_client_version_ol8: ${{ inputs.pmm_client_tarball_ol8 }} + pmm_client_version_ol9: ${{ inputs.pmm_client_tarball_ol9 }} + repository: 'release candidate' + expected_version: ${{ inputs.rc_version }} + + qa_integration_psmdb_pbm_full: + name: PMM_PSMDB_PBM_FULL + needs: plan + uses: ./.github/workflows/PMM_PSMDB_PBM_FULL.yml + with: + pmm_qa_branch: ${{ inputs.pmm_qa_branch }} + pmm_version: pmm3-rc + pmm_image: 'perconalab/pmm-server:${{ inputs.rc_version }}-rc' + + qa_integration_proxysql: + name: PMM_PROXYSQL + needs: plan + uses: ./.github/workflows/PMM_PROXYSQL.yaml + with: + pmm_qa_branch: ${{ inputs.pmm_qa_branch }} + pxc_version: ${{ inputs.pxc_version }} + pxc_glibc: ${{ inputs.pxc_glibc }} + pmm_server_image: 'perconalab/pmm-server:${{ inputs.rc_version }}-rc' + pmm_client_version: pmm3-rc + + qa_integration_pdpgsql: + name: PMM_PDPGSQL + needs: plan + uses: ./.github/workflows/PMM_PDPGSQL.yaml + with: + pmm_qa_branch: ${{ inputs.pmm_qa_branch }} + pdpgsql_version: ${{ inputs.pdpgsql_version }} + pmm_server_image: 'perconalab/pmm-server:${{ inputs.rc_version }}-rc' + pmm_client_version: pmm3-rc