From dd25640e79d113f7e22d0826964730312b8e4321 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Tue, 20 Jan 2026 16:47:04 +0200 Subject: [PATCH] Fix PMM integration CI workflow PMM integration workflow was broken by changes made on PMM QA framwork side. This PR updates the workflow to address these changes. --- .github/workflows/pmm-integration.yaml | 75 ++++++++++++++++++++++++ .github/workflows/postgresql-13-pmm.yaml | 50 ---------------- .github/workflows/postgresql-14-pmm.yaml | 50 ---------------- .github/workflows/postgresql-15-pmm.yaml | 50 ---------------- 4 files changed, 75 insertions(+), 150 deletions(-) create mode 100644 .github/workflows/pmm-integration.yaml delete mode 100644 .github/workflows/postgresql-13-pmm.yaml delete mode 100644 .github/workflows/postgresql-14-pmm.yaml delete mode 100644 .github/workflows/postgresql-15-pmm.yaml diff --git a/.github/workflows/pmm-integration.yaml b/.github/workflows/pmm-integration.yaml new file mode 100644 index 00000000..e1e0efa8 --- /dev/null +++ b/.github/workflows/pmm-integration.yaml @@ -0,0 +1,75 @@ +name: PMM Integration +on: + push: + branches: + - main + - release-* + tags: + - '[0-9]+.[0-9]+.[0-9]+*' + +permissions: + contents: read + +jobs: + test: + name: Test + runs-on: ubuntu-latest + timeout-minutes: 30 + continue-on-error: true + strategy: + matrix: + postgresql: [13, 14, 15, 16, 17, 18] + + steps: + - name: Clone QA Integration + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + repository: Percona-Lab/qa-integration + ref: main + path: qa-integration + + - name: Clone PMM UI tests + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + repository: percona/pmm-ui-tests + ref: main + path: pmm-ui-tests + + - name: Set TARGET_BRANCH variable + run: echo "TARGET_BRANCH=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Run PMM Server + run: docker run --detach --restart always -p 443:8443 -p 8081:8080 --name pmm-server perconalab/pmm-server:3-dev-latest + + - name: Setup PostgreSQL ${{ matrix.postgresql }} & PGSM + 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 + python3 pmm-framework.py --database pdpgsql=${{ matrix.postgresql }},PGSM_BRANCH=${{ env.TARGET_BRANCH }} + + - name: Install npx dependencies + working-directory: pmm-ui-tests + run: npm ci && npx playwright install --with-deps && npx codeceptjs def pr.codecept.js + + - name: Run integration tests + working-directory: pmm-ui-tests + 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 + + - name: Collect pmm-agent logs + if: failure() + run: docker exec pdpgsql_pmm_${{ matrix.postgresql }}_1 cat /var/log/pmm-agent.log > ./pmm-ui-tests/tests/output/pmm-agent.log + + - name: Upload artifacts + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + if: failure() + with: + name: tests-artifact + path: ./pmm-ui-tests/tests/output/ + if-no-files-found: ignore diff --git a/.github/workflows/postgresql-13-pmm.yaml b/.github/workflows/postgresql-13-pmm.yaml deleted file mode 100644 index 17346684..00000000 --- a/.github/workflows/postgresql-13-pmm.yaml +++ /dev/null @@ -1,50 +0,0 @@ -name: postgresql-13-pmm-integration -on: - pull_request: - push: - branches: - - main - tags: - - '[0-9]+.[0-9]+.[0-9]+*' - -permissions: - contents: read - -jobs: - build: - name: pg-13-pgsm-pmm-integration-test - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - name: Clone QA Integration repository - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - repository: 'Percona-Lab/qa-integration' - ref: 'main' - - # print branch and Repo name - - name: Get branch and Repo Name - run: echo 'The branch and Repo Name is' ${{ github.head_ref }} ${{ github.actor }}/pg_stat_monitor - - - name: "Set TARGET_BRANCH variable for a PR run" - if: github.event_name == 'pull_request' - run: echo "TARGET_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV - - - name: "Set TARGET_BRANCH variable for a PUSH run" - if: github.event_name == 'push' - run: echo "TARGET_BRANCH=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - - name: Run PMM & PGSM Setup, E2E Tests - run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=13 --pgstat-monitor-branch=${{ env.TARGET_BRANCH }} - - - name: Get PMM-Agent Logs from the Container - if: success() || failure() # run this step even if previous step failed - run: docker exec pgsql_pgsm_13 cat pmm-agent.log > ./pmm-ui-tests/tests/output/pmm-agent.log - - - name: Upload Tests Artifacts - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - if: success() || failure() # run this step even if previous step failed - with: - name: tests-artifact - path: ./pmm-ui-tests/tests/output/ - if-no-files-found: ignore # 'warn' or 'ignore' are also available, defaults to `warn` diff --git a/.github/workflows/postgresql-14-pmm.yaml b/.github/workflows/postgresql-14-pmm.yaml deleted file mode 100644 index 38899f56..00000000 --- a/.github/workflows/postgresql-14-pmm.yaml +++ /dev/null @@ -1,50 +0,0 @@ -name: postgresql-14-pmm-integration -on: - pull_request: - push: - branches: - - main - tags: - - '[0-9]+.[0-9]+.[0-9]+*' - -permissions: - contents: read - -jobs: - build: - name: pg-14-pgsm-pmm-integration-test - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - name: Clone QA Integration repository - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - repository: 'Percona-Lab/qa-integration' - ref: 'main' - - # print branch and Repo name - - name: Get branch and Repo Name - run: echo 'The branch and Repo Name is' ${{ github.head_ref }} ${{ github.actor }}/pg_stat_monitor - - - name: "Set TARGET_BRANCH variable for a PR run" - if: github.event_name == 'pull_request' - run: echo "TARGET_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV - - - name: "Set TARGET_BRANCH variable for a PUSH run" - if: github.event_name == 'push' - run: echo "TARGET_BRANCH=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - - name: Run PMM & PGSM Setup, E2E Tests - run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=14 --pgstat-monitor-branch=${{ env.TARGET_BRANCH }} - - - name: Get PMM-Agent Logs from the Container - if: success() || failure() # run this step even if previous step failed - run: docker exec pgsql_pgsm_14 cat pmm-agent.log > ./pmm-ui-tests/tests/output/pmm-agent.log - - - name: Upload Tests Artifacts - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - if: success() || failure() # run this step even if previous step failed - with: - name: tests-artifact - path: ./pmm-ui-tests/tests/output/ - if-no-files-found: ignore # 'warn' or 'ignore' are also available, defaults to `warn` diff --git a/.github/workflows/postgresql-15-pmm.yaml b/.github/workflows/postgresql-15-pmm.yaml deleted file mode 100644 index 8b0c342b..00000000 --- a/.github/workflows/postgresql-15-pmm.yaml +++ /dev/null @@ -1,50 +0,0 @@ -name: postgresql-15-pmm-integration -on: - pull_request: - push: - branches: - - main - tags: - - '[0-9]+.[0-9]+.[0-9]+*' - -permissions: - contents: read - -jobs: - build: - name: pg-15-pgsm-pmm-integration-test - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - name: Clone QA Integration repository - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - repository: 'Percona-Lab/qa-integration' - ref: 'main' - - # print branch and Repo name - - name: Get branch and Repo Name - run: echo 'The branch and Repo Name is' ${{ github.head_ref }} ${{ github.actor }}/pg_stat_monitor - - - name: "Set TARGET_BRANCH variable for a PR run" - if: github.event_name == 'pull_request' - run: echo "TARGET_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV - - - name: "Set TARGET_BRANCH variable for a PUSH run" - if: github.event_name == 'push' - run: echo "TARGET_BRANCH=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - - name: Run PMM & PGSM Setup, E2E Tests - run: bash -xe ./pmm_pgsm_setup/pmm_pgsm_setup.sh --pgsql-version=15 --pgstat-monitor-branch=${{ env.TARGET_BRANCH }} - - - name: Get PMM-Agent Logs from the Container - if: success() || failure() # run this step even if previous step failed - run: docker exec pgsql_pgsm_15 cat pmm-agent.log > ./pmm-ui-tests/tests/output/pmm-agent.log - - - name: Upload Tests Artifacts - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - if: success() || failure() # run this step even if previous step failed - with: - name: tests-artifact - path: ./pmm-ui-tests/tests/output/ - if-no-files-found: ignore # 'warn' or 'ignore' are also available, defaults to `warn`