diff --git a/.github/workflows/pmm2-ui-tests-fb.yml b/.github/workflows/pmm2-ui-tests-fb.yml index a9de4435dba4..0aff30d29771 100644 --- a/.github/workflows/pmm2-ui-tests-fb.yml +++ b/.github/workflows/pmm2-ui-tests-fb.yml @@ -1,6 +1,6 @@ -name: pmm2-ui-tests-fb pipeline -on: +name: pmm2-ui-tests-fb +on: workflow_dispatch: inputs: server_image: @@ -61,9 +61,7 @@ on: BACKUP_LOCATION_SECRET_KEY: required: false - jobs: - backup_management_mongo: name: Backup Management MongoDB UI tests uses: ./.github/workflows/ui-tests.yml @@ -203,3 +201,17 @@ jobs: sha: ${{ inputs.sha || github.event.pull_request.head.sha || 'null' }} client_flags: '--mongomagic --with-arbiter' tags_for_tests: '@pmm-psmdb-arbiter-integration' + + user_and_password_podman: + name: User with changed password UI tests + uses: ./.github/workflows/ui-tests-podman.yml + secrets: inherit + with: + server_image: ${{ inputs.server_image || 'perconalab/pmm-server:dev-latest' }} + client_version: ${{ inputs.client_version || 'dev-latest' }} + client_image: ${{ inputs.client_image || 'perconalab/pmm-client:dev-latest' }} + pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'main' }} + pmm_ui_branch: ${{ inputs.pmm_ui_branch || 'main' }} + sha: ${{ inputs.sha || github.event.pull_request.head.sha || 'null' }} + client_flags: '--addclient=ps,1 --addclient=modb,1 --addclient=pdpgsql,1' + tags_for_tests: '@user-password' diff --git a/.github/workflows/ui-tests-podman.yml b/.github/workflows/ui-tests-podman.yml new file mode 100644 index 000000000000..915e38162749 --- /dev/null +++ b/.github/workflows/ui-tests-podman.yml @@ -0,0 +1,239 @@ +name: ui-tests-podman-pipeline +on: + workflow_call: + inputs: + server_image: + description: "pmm-server docker image, default perconalab/pmm-server:dev-latest" + required: false + type: string + client_version: + description: "pmm2-client version Tarball or Dev-latest, default is dev-latest" + required: false + type: string + 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_branch: + description: "Branch for PMM-UI tests to checkout" + required: false + type: string + sha: + description: "SHA (leave empty if running manually, default - 'null')" + required: false + type: string + client_flags: + description: "example: --addclient=ps,1 --ps-version=5.7" + required: false + type: string + tags_for_tests: + description: "example: @settings-fb" + required: true + type: string + push: + branches: + - PMM-12359-podman-setup + +jobs: + ui-tests-e2e: + name: "podman e2e tests: ${{ inputs.tags_for_tests || '@settings-fb' }}" +# runs-on: ubuntu-latest Mongo Replica setup fails in ubuntu-latest for some reason. Additional investigation needed + runs-on: ubuntu-20.04 + timeout-minutes: 60 + env: + SERVER_IMAGE: ${{ inputs.server_image || 'perconalab/pmm-server:dev-latest' }} + CLIENT_IMAGE: ${{ inputs.client_image || 'perconalab/pmm-client:dev-latest' }} + CLIENT_VERSION: ${{ inputs.client_version || 'dev-latest' }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ADMIN_PASSWORD: 'admin-password' + PMM_QA_BRANCH: ${{ inputs.pmm_qa_branch || 'main' }} + PMM_QA_GIT_BRANCH: ${{ inputs.pmm_qa_branch || 'main' }} + PMM_UI_BRANCH: ${{ inputs.pmm_ui_branch || 'main' }} + DOCKER_VERSION: ${{ inputs.server_image || 'perconalab/pmm-server:dev-latest' }} + CLIENT_DOCKER_VERSION: ${{ inputs.client_image || 'perconalab/pmm-client:dev-latest' }} + SHA: ${{ inputs.sha || 'null' }} + CLIENT_FLAGS: ${{ inputs.client_flags || '' }} + TAGS_FOR_TESTS: ${{ inputs.tags_for_tests || '@settings-fb' }} + +# Environment variables for tests + BACKUP_LOCATION_ACCESS_KEY: ${{ secrets.BACKUP_LOCATION_ACCESS_KEY }} + BACKUP_LOCATION_SECRET_KEY: ${{ secrets.BACKUP_LOCATION_SECRET_KEY }} + + + steps: + - name: Create status check + if: ${{ github.event_name != 'pull_request' }} + uses: percona-platform/github-status-action@v1 + continue-on-error: true + with: + authToken: ${{ secrets.GITHUB_TOKEN }} + context: "${{ env.TAGS_FOR_TESTS }} UI 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 UI tests: ${{ env.PMM_UI_BRANCH }}" + uses: actions/checkout@v3 + with: + ref: ${{ env.PMM_UI_BRANCH }} + repository: percona/pmm-ui-tests + path: ./pmm-ui-tests + + - name: "Checkout PMM QA: ${{ env.PMM_QA_BRANCH }}" + uses: actions/checkout@v3 + with: + ref: ${{ env.PMM_QA_BRANCH }} + repository: percona/pmm-qa + path: ./pmm-qa + + - name: Setup tools + run: | + npm install -g bats + 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 + . /etc/os-release + echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee \ + /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list + curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key" | sudo apt-key add - + sudo apt-get update + sudo apt-get -y upgrade + sudo apt-get install -y + sudo apt-get install -y clickhouse-client podman + sudo curl -s https://raw.githubusercontent.com/datacharmer/dbdeployer/master/scripts/dbdeployer-install.sh | bash + ls -la + pushd ./pmm-qa + wget https://raw.githubusercontent.com/Percona-QA/percona-qa/master/get_download_link.sh + chmod +x get_download_link.sh + popd + sudo sysctl net.ipv4.ip_unprivileged_port_start=80 + + - name: Setup PMM2-Server + working-directory: ./pmm-ui-tests + run: | + mkdir -p ~/.config/systemd/user/ + cat > ~/.config/systemd/user/pmm-server.service < ~/.config/pmm-server/pmm-server.env <> $GITHUB_ENV + + - name: Setup PMM2-Client + working-directory: ./pmm-qa + run: sudo bash -x pmm-tests/pmm2-client-setup.sh --pmm_server_ip 127.0.0.1 --client_version ${{ env.CLIENT_VERSION }} --admin_password ${{ env.ADMIN_PASSWORD }} --use_metrics_mode no + + - name: Run Setup for E2E Tests + working-directory: ./pmm-qa + run: sudo -E bash -x pmm-tests/pmm-framework.sh ${{ env.CLIENT_FLAGS }} --pmm2 + + - name: Setup npm modules for e2e tests + working-directory: ./pmm-ui-tests + run: | + npm ci + envsubst < env.list > env.generated.list + + - name: Execute e2e tests with tags ${{ env.TAGS_FOR_TESTS }} + working-directory: ./pmm-ui-tests + env: + SERVER_IP : "127.0.0.1" + PMM_UI_URL : "http://127.0.0.1/" + PMM_URL : "http://admin:${{ env.ADMIN_PASSWORD }}@${{ env.SERVER_IP }}" + run: | + sed -i 's+http://localhost/+${PMM_UI_URL}/+g' pr.codecept.js + ./node_modules/.bin/codeceptjs run -c pr.codecept.js --grep "${{ env.TAGS_FOR_TESTS }}" + + - uses: actions/github-script@v6 + if: ${{ always() }} + id: artifact_name + with: + script: | + return `artifacts_for_${process.env.TAGS_FOR_TESTS.replaceAll('|', '')}` + result-encoding: string + + - name: Create status check + if: ${{ github.event_name != 'pull_request' && always() }} + uses: percona-platform/github-status-action@v1 + continue-on-error: true + with: + authToken: ${{ secrets.GITHUB_TOKEN }} + context: "${{ env.TAGS_FOR_TESTS }} UI 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 }} + +# - name: Setup tmate session on failure +# if: ${{ failure() }} +# uses: percona-platform/action-tmate@v2 diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index aad1911daad4..4ef9d32f4258 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -1,4 +1,4 @@ -name: UI tests +name: ui-tests-pipeline on: workflow_call: inputs: @@ -37,6 +37,7 @@ on: jobs: ui-tests-e2e: + name: "e2e tests: ${{ inputs.tags_for_tests || '@settings-fb' }}" # runs-on: ubuntu-latest Mongo Replica setup fails in ubuntu-latest for some reason. Additional investigation needed runs-on: ubuntu-20.04 timeout-minutes: 60 diff --git a/VERSION b/VERSION index cde8adf34d68..770060be9f9b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.39.0 +2.40.0 diff --git a/sources/pmm-dump b/sources/pmm-dump index b31e04927bad..f94cd12e3bf3 160000 --- a/sources/pmm-dump +++ b/sources/pmm-dump @@ -1 +1 @@ -Subproject commit b31e04927bad162dbfffa9b119de0db44c4134fe +Subproject commit f94cd12e3bf37d3e00058c05898fdf1e9c23969b diff --git a/sources/pmm-qa/src/github.com/percona/pmm-qa b/sources/pmm-qa/src/github.com/percona/pmm-qa index a03e24f19a33..4cca8e79ebde 160000 --- a/sources/pmm-qa/src/github.com/percona/pmm-qa +++ b/sources/pmm-qa/src/github.com/percona/pmm-qa @@ -1 +1 @@ -Subproject commit a03e24f19a337a92b9f40f85efc8163e5fce5498 +Subproject commit 4cca8e79ebde6b4c9e1d32cb977ba03ca9a19b38 diff --git a/sources/pmm-ui-tests/src/github.com/percona/pmm-ui-tests b/sources/pmm-ui-tests/src/github.com/percona/pmm-ui-tests index 09ccc4f9b7c8..74b5ce04934a 160000 --- a/sources/pmm-ui-tests/src/github.com/percona/pmm-ui-tests +++ b/sources/pmm-ui-tests/src/github.com/percona/pmm-ui-tests @@ -1 +1 @@ -Subproject commit 09ccc4f9b7c84468552c9f4e95279cc1f0db3e1f +Subproject commit 74b5ce04934a639d4af8781bad5bf0803774af98 diff --git a/sources/pmm/src/github.com/percona/pmm b/sources/pmm/src/github.com/percona/pmm index fba350688bfe..d3eb708658c7 160000 --- a/sources/pmm/src/github.com/percona/pmm +++ b/sources/pmm/src/github.com/percona/pmm @@ -1 +1 @@ -Subproject commit fba350688bfe047bea6c34057418d7760b115dbe +Subproject commit d3eb708658c74b6bab4495783b02be604ed74371