diff --git a/.github/workflows/fb-e2e-suite.yml b/.github/workflows/fb-e2e-suite.yml index 607863b0..be85a94f 100644 --- a/.github/workflows/fb-e2e-suite.yml +++ b/.github/workflows/fb-e2e-suite.yml @@ -73,7 +73,8 @@ jobs: pmm_client_image: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:3-dev-latest' }} pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'v3' }} pmm_ui_tests_branch: ${{ inputs.pmm_ui_tests_branch || 'v3' }} - setup_services: '--database psmdb,SETUP_TYPE=pss,COMPOSE_PROFILES=extra' + setup_services: '--database psmdb,SETUP_TYPE=pss' + # setup_services: '--database psmdb,SETUP_TYPE=pss,COMPOSE_PROFILES=extra' tags_for_tests: '@bm-mongo' # -- include backup_management_ps once setup for mysql fixed for the worker @@ -117,7 +118,7 @@ jobs: pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'v3' }} pmm_ui_tests_branch: ${{ inputs.pmm_ui_tests_branch || 'v3' }} sha: ${{ inputs.sha || github.event.pull_request.head.sha || 'null' }} - setup_services: '--database psmdb,SETUP_TYPE=pss --database ps' + setup_services: '--database psmdb --database ps,QUERY_SOURCE=slowlog' tags_for_tests: '@mongodb-exporter|@exporters' instances: @@ -199,22 +200,23 @@ jobs: pmm_test_flag: '@rbac' pmm_server_version: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:3-dev-latest' }} pmm_client_version: ${{ inputs.pmm_client_version || '3-dev-latest' }} - setup_services: '--database ps' + setup_services: '--database ps --database psmdb' pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'v3' }} - psmdb_arbiter: - name: PSMDB Arbiter Replica UI tests - uses: ./.github/workflows/runner-e2e-tests-codeceptjs.yml - secrets: inherit - with: - pmm_server_image: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:3-dev-latest' }} - pmm_client_version: ${{ inputs.pmm_client_version || '3-dev-latest' }} - pmm_client_image: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:3-dev-latest' }} - pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'v3' }} - pmm_ui_tests_branch: ${{ inputs.pmm_ui_tests_branch || 'v3' }} - sha: ${{ inputs.sha || github.event.pull_request.head.sha || 'null' }} - setup_services: '--database psmdb,SETUP_TYPE=psa' - tags_for_tests: '@pmm-psmdb-arbiter-integration' +# Unskip once it will be possible to find ARBITER element on the replset summary dashboard + # psmdb_arbiter: + # name: PSMDB Arbiter Replica UI tests + # uses: ./.github/workflows/runner-e2e-tests-codeceptjs.yml + # secrets: inherit + # with: + # pmm_server_image: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:3-dev-latest' }} + # pmm_client_version: ${{ inputs.pmm_client_version || '3-dev-latest' }} + # pmm_client_image: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:3-dev-latest' }} + # pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'v3' }} + # pmm_ui_tests_branch: ${{ inputs.pmm_ui_tests_branch || 'v3' }} + # sha: ${{ inputs.sha || github.event.pull_request.head.sha || 'null' }} + # setup_services: '--database psmdb,SETUP_TYPE=psa' + # tags_for_tests: '@pmm-psmdb-arbiter-integration' user_and_password_podman: name: User with changed password UI tests @@ -224,10 +226,11 @@ jobs: pmm_server_image: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:3-dev-latest' }} pmm_client_version: ${{ inputs.pmm_client_version || '3-dev-latest' }} pmm_client_image: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:3-dev-latest' }} - pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'v3' }} + pmm_qa_branch: 'v3' + qa_integration_branch: ${{ inputs.pmm_qa_branch || 'v3' }} pmm_ui_tests_branch: ${{ inputs.pmm_ui_tests_branch || 'v3' }} sha: ${{ inputs.sha || github.event.pull_request.head.sha || 'null' }} - setup_services: '--database ps --database psmdb --database pdpgsql' + setup_services: '--addclient=ps,1 --addclient=modb,1' tags_for_tests: '@user-password' dump_tool: diff --git a/.github/workflows/runner-e2e-tests-codeceptjs.yml b/.github/workflows/runner-e2e-tests-codeceptjs.yml index 3900f40f..de2111a1 100644 --- a/.github/workflows/runner-e2e-tests-codeceptjs.yml +++ b/.github/workflows/runner-e2e-tests-codeceptjs.yml @@ -124,7 +124,6 @@ jobs: sudo apt-get install -y clickhouse-client sudo apt-get install -y ansible sudo curl -s https://raw.githubusercontent.com/datacharmer/dbdeployer/master/scripts/dbdeployer-install.sh | bash - ls -la - name: Setup PMM2-Server working-directory: pmm-ui-tests @@ -145,6 +144,7 @@ jobs: - 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 diff --git a/.github/workflows/runner-e2e-tests-playwright.yml b/.github/workflows/runner-e2e-tests-playwright.yml index 6f17cc3a..bc180d92 100644 --- a/.github/workflows/runner-e2e-tests-playwright.yml +++ b/.github/workflows/runner-e2e-tests-playwright.yml @@ -63,16 +63,10 @@ jobs: env: SHA: ${{ inputs.sha || 'null' }} PMM_BASE_URL: https://127.0.0.1 - ADMIN_PASSWORD: admin UI_TESTS_BRANCH: ${{ inputs.pmm_ui_tests_branch }} - WIZARD_ARGS: ${{ inputs.setup_services }} PMM_TEST_FLAG: ${{ inputs.pmm_test_flag }} - PMM_SERVER_VERSION: ${{ inputs.pmm_server_version }} - PMM_CLIENT_VERSION: ${{ inputs.pmm_client_version }} - PMM_QA_BRANCH: ${{ inputs.pmm_qa_branch }} - OKTA_TOKEN: ${{ secrets.OKTA_TOKEN }} OAUTH_ISSUER_URL: 'https://id-dev.percona.com/oauth2/aus15pi5rjdtfrcH51d7' OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }} @@ -91,6 +85,18 @@ jobs: SERVICENOW_PASSWORD: ${{ secrets.SERVICENOW_PASSWORD }} SERVICENOW_DEV_URL: 'https://perconadev.service-now.com/api/x_pellc_percona_pl/platform/settest' + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ADMIN_PASSWORD: 'admin' + PMM_SERVER_VERSION: ${{ inputs.pmm_server_version }} + PMM_QA_BRANCH: ${{ inputs.pmm_qa_branch || 'v3' }} + PMM_QA_GIT_BRANCH: ${{ inputs.pmm_qa_branch || 'v3' }} + PMM_UI_BRANCH: ${{ inputs.pmm_ui_tests_branch || 'v3' }} + DOCKER_VERSION: ${{ inputs.pmm_server_version || 'perconalab/pmm-server:3-dev-latest' }} + CLIENT_DOCKER_VERSION: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:3-dev-latest' }} + PMM_CLIENT_VERSION: ${{ inputs.pmm_client_version || '3-dev-latest' }} + WIZARD_ARGS: ${{ inputs.setup_services || '' }} + TAGS_FOR_TESTS: ${{ inputs.tags_for_tests || '@settings-fb' }} + steps: - name: PMM server version ${{ inputs.pmm_server_version }} and UI tests for flag "${{ inputs.pmm_test_flag }}" and pmm-ui-tests branch ${{ inputs.pmm_ui_tests_branch }} if: ${{ env.SHA != 'null' }} @@ -105,47 +111,62 @@ jobs: target_url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" sha: ${{ env.SHA }} - - name: 'Checkout UI tests: "${{ inputs.pmm_ui_tests_branch }}"' - uses: actions/checkout@v3 + - name: Checkout PMM UI tests + uses: actions/checkout@v4 with: - ref: ${{ inputs.pmm_ui_tests_branch }} + ref: ${{ env.PMM_UI_BRANCH }} repository: percona/pmm-ui-tests path: ./pmm-ui-tests + - name: Checkout qa-integration repo + uses: actions/checkout@v4 + with: + ref: ${{ env.PMM_QA_BRANCH }} + repository: Percona-Lab/qa-integration + path: ./qa-integration + - name: 'Install playwright' working-directory: ./pmm-ui-tests/playwright-tests run: | npm ci npx playwright install - - name: 'Checkout pmm-qa: "${{ inputs.pmm_qa_branch }}"' - uses: actions/checkout@v3 - with: - # token: ${{ secrets.ROBOT_TOKEN }} - repository: percona/pmm-qa - ref: ${{ inputs.pmm_qa_branch }} - path: ./pmm-qa - - - name: 'Setup : "${{ inputs.pmm_server_version }}"' - working-directory: pmm-qa/pmm-integration + - name: Setup tools run: | - npm install - sudo npx ts-node ./integration-setup.ts --ci --setup-docker-pmm-server --rbac --pmm-server-docker-tag=${{ env.PMM_SERVER_VERSION }} --pmm-client-version=${{ env.PMM_CLIENT_VERSION }} - timeout 100 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost/ping)" != "200" ]]; do sleep 5; done' || false - - - name: 'Setup ' + 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 apt-get install -y ansible + sudo curl -s https://raw.githubusercontent.com/datacharmer/dbdeployer/master/scripts/dbdeployer-install.sh | bash + ls -la + + - name: Setup PMM2-Server + working-directory: pmm-ui-tests run: | - sudo bash ./pmm-qa/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 - shell: bash + PWD=$(pwd) PMM_SERVER_IMAGE=${{ env.DOCKER_VERSION }} docker-compose up -d + sleep 60 + docker exec pmm-server change-admin-password ${{ env.ADMIN_PASSWORD }} + bash -x testdata/db_setup.sh + + - name: Export path to qa-integration repo + working-directory: qa-integration + run: echo "PATH_TO_PMM_QA=$(pwd)" >> $GITHUB_ENV + + - name: Setup PMM-Client + working-directory: qa-integration/pmm_qa + run: sudo bash -x pmm3-client-setup.sh --pmm_server_ip 192.168.0.1 --client_version ${{ env.PMM_CLIENT_VERSION }} --admin_password ${{ env.ADMIN_PASSWORD }} --use_metrics_mode no - - name: Setup Databases for the PMM-Server - working-directory: pmm-qa/pmm-integration + - name: Run Setup for E2E Tests + working-directory: qa-integration/pmm_qa run: | - sudo npx ts-node ./integration-setup.ts --ci \ - ${{ env.WIZARD_ARGS }} - sleep 30 - sudo pmm-admin list - shell: bash + python3 -m venv virtenv + . virtenv/bin/activate + pip install --upgrade pip + pip install -r requirements.txt + python pmm-framework.py --pmm-server-password=${{ env.ADMIN_PASSWORD }} ${{ env.WIZARD_ARGS }} - name: Execute UI tests if: ${{ inputs.pmm_test_flag == 'null' }} diff --git a/.github/workflows/runner-e2e-tests-podman.yml b/.github/workflows/runner-e2e-tests-podman.yml index 195ba9e1..8d9608b3 100644 --- a/.github/workflows/runner-e2e-tests-podman.yml +++ b/.github/workflows/runner-e2e-tests-podman.yml @@ -6,23 +6,27 @@ on: description: "Branch for PMM-UI tests to checkout" required: false type: string + qa_integration_branch: + description: "Branch for qa-integration to checkout" + required: false + type: string pmm_qa_branch: description: "Branch for PMM-QA to checkout" required: false type: string pmm_server_image: description: 'PMM Server docker image' - default: 'perconalab/pmm-server:dev-latest' + default: 'perconalab/pmm-server:3-dev-latest' required: false type: string pmm_client_image: description: 'pmm2-client docker image' - default: 'perconalab/pmm-client:dev-latest' + default: 'perconalab/pmm-client:3-dev-latest' required: false type: string pmm_client_version: - description: 'PMM Client version (dev-latest|pmm2-latest|pmm2-rc|x.xx.x|https...)' - default: 'dev-latest' + description: 'PMM Client version (dev-latest|pmm3-rc|x.xx.x|https...)' + default: '3-dev-latest' required: false type: string setup_services: @@ -47,6 +51,9 @@ on: pmm_qa_branch: required: false type: string + qa_integration_branch: + required: false + type: string pmm_server_image: required: false type: string @@ -75,20 +82,17 @@ jobs: env: SHA: ${{ inputs.sha || 'null' }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PMM_UI_TESTS_BRANCH: ${{ inputs.pmm_ui_tests_branch || 'main' }} - PMM_QA_BRANCH: ${{ inputs.pmm_qa_branch || 'main' }} - DOCKER_VERSION: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:dev-latest' }} - CLIENT_DOCKER_VERSION: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:dev-latest' }} - CLIENT_IMAGE: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:dev-latest' }} - CLIENT_VERSION: ${{ inputs.pmm_client_version || 'dev-latest' }} + PMM_UI_TESTS_BRANCH: ${{ inputs.pmm_ui_tests_branch || 'v3' }} + PMM_QA_BRANCH: ${{ inputs.pmm_qa_branch || 'v3' }} + QA_INTEGRATION_BRANCH: ${{ inputs.qa_integration_branch || 'v3' }} + DOCKER_VERSION: ${{ inputs.pmm_server_image || 'perconalab/pmm-server:3-dev-latest' }} + CLIENT_DOCKER_VERSION: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:3-dev-latest' }} + CLIENT_IMAGE: ${{ inputs.pmm_client_image || 'perconalab/pmm-client:3-dev-latest' }} + CLIENT_VERSION: ${{ inputs.pmm_client_version || '3-dev-latest' }} WIZARD_ARGS: ${{ inputs.setup_services || '' }} TAGS_FOR_TESTS: ${{ inputs.tags_for_tests || '@settings-fb' }} ADMIN_PASSWORD: 'admin-password' - # 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' }} @@ -117,9 +121,15 @@ jobs: repository: percona/pmm-qa path: ./pmm-qa + - name: "Checkout qa-integration: ${{ env.QA_INTEGRATION_BRANCH }}" + uses: actions/checkout@v4 + with: + ref: ${{ env.QA_INTEGRATION_BRANCH }} + repository: Percona-Lab/qa-integration + path: ./qa-integration + - 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 \ @@ -165,7 +175,7 @@ jobs: # optional env file that could override previous env settings for this unit EnvironmentFile=-%h/.config/pmm-server/env - ExecStart=/usr/bin/podman run --rm --replace=true --name=%N -p \${PMM_PUBLIC_PORT}:443/tcp -p \${PMM_HTTP_PORT}:80/tcp --ulimit=host --volume=\${PMM_VOLUME_NAME}:/srv --env-file=\${PMM_ENV_FILE} --health-cmd=none --health-interval=disable \${PMM_SERVER_IMAGE} + ExecStart=/usr/bin/podman run --rm --replace=true --name=%N -p \${PMM_PUBLIC_PORT}:8443/tcp -p \${PMM_HTTP_PORT}:8080/tcp --ulimit=host --volume=\${PMM_VOLUME_NAME}:/srv --env-file=\${PMM_ENV_FILE} --health-cmd=none --health-interval=disable \${PMM_SERVER_IMAGE} ExecStop=/usr/bin/podman stop -t 10 %N Restart=on-failure RestartSec=20 @@ -182,10 +192,8 @@ jobs: #ENABLE_DBAAS=1 PMM_DEBUG=1 PERCONA_TEST_SAAS_HOST=check-dev.percona.com:443 - PERCONA_TEST_CHECKS_PUBLIC_KEY=RWTg+ZmCCjt7O8eWeAmTLAqW+1ozUbpRSKSwNTmO+exlS5KEIPYWuYdX - PERCONA_TEST_PLATFORM_ADDRESS=https://check-dev.percona.com:443 - PERCONA_TEST_PLATFORM_PUBLIC_KEY=RWTg+ZmCCjt7O8eWeAmTLAqW+1ozUbpRSKSwNTmO+exlS5KEIPYWuYdX - PERCONA_TEST_VERSION_SERVICE_URL=https://check-dev.percona.com/versions/v1 + PMM_DEV_PERCONA_PLATFORM_PUBLIC_KEY=RWTg+ZmCCjt7O8eWeAmTLAqW+1ozUbpRSKSwNTmO+exlS5KEIPYWuYdX + PMM_DEV_PERCONA_PLATFORM_ADDRESS=https://check-dev.percona.com:443 PERCONA_TEST_TELEMETRY_INTERVAL=10s PERCONA_TEST_TELEMETRY_RETRY_BACKOFF=10s @@ -214,9 +222,9 @@ jobs: working-directory: ./pmm-qa run: echo "PATH_TO_PMM_QA=$(pwd)" >> $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: Setup PMM3-Client + working-directory: ./qa-integration/pmm_qa + run: sudo bash -x pmm3-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