From a236b2ba85e963afe829f930b08ffedd8eb63864 Mon Sep 17 00:00:00 2001 From: Puneet Kala Date: Thu, 28 Sep 2023 14:09:19 +0530 Subject: [PATCH 1/4] PMM-7 Add PDPGSQL Job --- .github/workflows/PMM_PDPGSQL.yaml | 88 ++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 .github/workflows/PMM_PDPGSQL.yaml diff --git a/.github/workflows/PMM_PDPGSQL.yaml b/.github/workflows/PMM_PDPGSQL.yaml new file mode 100644 index 0000000..0453d6f --- /dev/null +++ b/.github/workflows/PMM_PDPGSQL.yaml @@ -0,0 +1,88 @@ +name: PMM_PDPGSQL +on: + workflow_dispatch: + inputs: + pdpgsql_version: + description: "PDPGSQL Docker hub example perconalab/percona-distribution-postgresql:16.0 latest available Image" + required: true + pmm_image: + description: "pmm_image, example: perconalab/pmm-server:dev-latest" + required: false + repo: + description: "Percona Release Repo defaults to Experiemental example: experimental" + required: false + push: + branches: + - main + + pull_request: + branches: + - main + +jobs: + PMM_PDPGSQL_TEST: + runs-on: ubuntu-latest + timeout-minutes: 20 + env: + PDPGSQL_VERSION: ${{ github.event.inputs.pdpgsql_version || 'perconalab/percona-distribution-postgresql:16.0' }} + PMM_IMAGE: ${{ github.event.inputs.pmm_image || 'perconalab/pmm-server:dev-latest' }} + REPO: ${{ github.event.inputs.repo || 'experimental' }} + + steps: + - uses: actions/checkout@v2 + + - name: Concatenate values to environment file + run: | + echo "PMM_QA_REPO_URL=https://github.com/percona/pmm-qa/" >> $GITHUB_ENV + echo "PMM_QA_REPO_BRANCH=main" >> $GITHUB_ENV + + - name: Install Ansible and update the node + run: sudo apt-get update -y && sudo apt-get install ansible -y + + - name: Install Percona Release Package + run: wget https://repo.percona.com/apt/percona-release_latest.generic_all.deb && sudo dpkg -i percona-release_latest.generic_all.deb + + - name: Install Enable percona-release experimental for dev-latest installation of pmm2-client + if: ${{ inputs.repo == 'experimental' }} + run: sudo percona-release enable-only original experimental + + - name: Install Enable percona-release testing for rc installation of pmm2-client + if: ${{ inputs.repo == 'testing' }} + run: sudo percona-release enable-only original testing + + - name: Install PMM Client + run: sudo apt update -y && sudo apt-get upgrade -y && sudo apt-get install -y pmm2-client + + - name: Delete if the Repo already checked out + run: sudo rm -r pmm-qa || true + + - name: Clone the PMM_QA repo + run: git clone -b ${{ env.PMM_QA_REPO_BRANCH }} ${{ env.PMM_QA_REPO_URL }} + + - name: Give write perimssion to the bash script + run: chmod +x ./pmm-tests/pmm-framework.sh + working-directory: pmm-qa + + - name: Run the pmm container in backgrounds + run: docker run --detach --restart always -p 443:443 -p 80:80 --name pmm-server ${{ env.PMM_IMAGE }} + + - name: Wait before pmm-admin config command + run: sleep 120 + + - name: setup pmm-admin config + run: sudo pmm-admin config --server-insecure-tls --server-url=https://admin:admin@localhost:443 + + - name: Run for PDPGSQL tests + run: ./pmm-framework.sh --addclient=pgpgsql,1 --pdpgsql-version=16 --pmm2 --download + working-directory: pmm-qa/pmm-tests + + - name: Checkout the repo and install node packages + run: git clone https://github.com/percona/pmm-ui-tests.git && cd pmm-ui-tests && npm ci + + - name: Install npx dependencies + run: sudo npx playwright install-deps && npx codeceptjs def pr.codecept.js + working-directory: pmm-ui-tests + + - name: Run the Integration tests of pdpgsql + run: npx codeceptjs run -c pr.codecept.js tests/qa-integration/pmm_pdpgsql_integration_test.js --steps --debug + working-directory: pmm-ui-tests From e30764a3c1683716797b1ff8cd22cb4597536fbe Mon Sep 17 00:00:00 2001 From: Puneet Kala Date: Thu, 28 Sep 2023 14:29:23 +0530 Subject: [PATCH 2/4] PMM-7 Fix the setup --- .github/workflows/PMM_PDPGSQL.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PMM_PDPGSQL.yaml b/.github/workflows/PMM_PDPGSQL.yaml index 0453d6f..a19181e 100644 --- a/.github/workflows/PMM_PDPGSQL.yaml +++ b/.github/workflows/PMM_PDPGSQL.yaml @@ -73,7 +73,7 @@ jobs: run: sudo pmm-admin config --server-insecure-tls --server-url=https://admin:admin@localhost:443 - name: Run for PDPGSQL tests - run: ./pmm-framework.sh --addclient=pgpgsql,1 --pdpgsql-version=16 --pmm2 --download + run: ./pmm-framework.sh --pdpgsql-version=16 --pmm2 --download --addclient=pgpgsql,1 working-directory: pmm-qa/pmm-tests - name: Checkout the repo and install node packages From 07b6b35c9b644f728f7fc6fba3196597dbe9c684 Mon Sep 17 00:00:00 2001 From: Puneet Kala Date: Thu, 28 Sep 2023 16:08:27 +0530 Subject: [PATCH 3/4] PMM-7 PDPGSQL --- .github/workflows/PMM_PDPGSQL.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PMM_PDPGSQL.yaml b/.github/workflows/PMM_PDPGSQL.yaml index a19181e..d2d648f 100644 --- a/.github/workflows/PMM_PDPGSQL.yaml +++ b/.github/workflows/PMM_PDPGSQL.yaml @@ -73,7 +73,7 @@ jobs: run: sudo pmm-admin config --server-insecure-tls --server-url=https://admin:admin@localhost:443 - name: Run for PDPGSQL tests - run: ./pmm-framework.sh --pdpgsql-version=16 --pmm2 --download --addclient=pgpgsql,1 + run: ./pmm-framework.sh --pdpgsql-version=16 --pmm2 --download --addclient=pdpgsql,1 working-directory: pmm-qa/pmm-tests - name: Checkout the repo and install node packages From 87589fafb17e4a3312a3121415f35f28eed02b77 Mon Sep 17 00:00:00 2001 From: Puneet Kala Date: Thu, 28 Sep 2023 16:54:25 +0530 Subject: [PATCH 4/4] PMM-7 PDPGSQL setup --- .github/workflows/PMM_PDPGSQL.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PMM_PDPGSQL.yaml b/.github/workflows/PMM_PDPGSQL.yaml index d2d648f..2499a8b 100644 --- a/.github/workflows/PMM_PDPGSQL.yaml +++ b/.github/workflows/PMM_PDPGSQL.yaml @@ -73,7 +73,7 @@ jobs: run: sudo pmm-admin config --server-insecure-tls --server-url=https://admin:admin@localhost:443 - name: Run for PDPGSQL tests - run: ./pmm-framework.sh --pdpgsql-version=16 --pmm2 --download --addclient=pdpgsql,1 + run: sudo ./pmm-framework.sh --pdpgsql-version=16 --pmm2 --download --addclient=pdpgsql,1 working-directory: pmm-qa/pmm-tests - name: Checkout the repo and install node packages