From 33924f3371595487d5889b6f299bbec3eee8776a Mon Sep 17 00:00:00 2001 From: Vadym Yarosh Date: Fri, 1 Mar 2024 10:00:01 +0100 Subject: [PATCH] PMM-12926 cleanup duplicated jobs and fixed conditional (#663) * PMM-12926 cleanup duplicated jobs and fixed conditional * PMM-12926 added doc --- .github/workflows/pmm-version-getter.yml | 2 +- .github/workflows/pmm2-integration-tests.yml | 149 ------------------ .github/workflows/portal-tests-matrix.yml | 33 ---- .../runner-integration-cli-tests.yml | 2 +- .github/workflows/testsuite.yml | 13 -- 5 files changed, 2 insertions(+), 197 deletions(-) delete mode 100644 .github/workflows/pmm2-integration-tests.yml delete mode 100644 .github/workflows/portal-tests-matrix.yml delete mode 100644 .github/workflows/testsuite.yml diff --git a/.github/workflows/pmm-version-getter.yml b/.github/workflows/pmm-version-getter.yml index 4ba0f12c..f2ad2047 100644 --- a/.github/workflows/pmm-version-getter.yml +++ b/.github/workflows/pmm-version-getter.yml @@ -10,7 +10,7 @@ on: description: 'PMM Client version to upgrade from (dev-latest|pmm2-latest|pmm2-rc|x.xx.x)' type: string repository: - description: 'Upgrade to:' + description: 'To detect "finish_version" string: X.XX.X' required: true default: 'dev-latest' type: string diff --git a/.github/workflows/pmm2-integration-tests.yml b/.github/workflows/pmm2-integration-tests.yml deleted file mode 100644 index e9eaaf1e..00000000 --- a/.github/workflows/pmm2-integration-tests.yml +++ /dev/null @@ -1,149 +0,0 @@ ---- -name: pmm2-integration-tests - -on: - workflow_dispatch: - inputs: - pmm_ui_tests_branch: - description: 'Target branch for pmm-ui-tests repository' - default: 'main' - required: true - pmm_qa_branch: - description: 'Target branch for pmm-qa repository' - default: 'main' - required: true - integration_setup: - description: 'Add flag to test selected integration setup' - default: '--setup-pmm-pgsm-integration' - required: true - pmm_server_version: - description: 'Provide version of pmm server' - default: 'dev-latest' - required: true - pmm_client_version: - description: 'Provide version of pmm server' - default: 'dev-latest' - required: true - pgsql_version: - description: 'Provide version of PostgreSQL' - default: '15.0' - required: true - ps_version: - description: 'Provide version of Percona Server for MySQL' - default: '8.0' - required: true - mongo_version: - description: 'Provide version of Mongo DB' - default: '4.4' - required: true - mongo_setup: - description: 'Provide setup type for Mongo DB' - type: choice - options: - - regular - - replica - - sharded - - arbiter - default: 'regular' - required: true - -jobs: - integration-tests: - name: Integration Tests - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - SHA: ${{ github.event.inputs.sha || 'null' }} - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - - UI_TESTS_BRANCH: ${{ github.event.inputs.pmm_ui_tests_branch }} - QA_TESTS_BRANCH: ${{ github.event.inputs.pmm_qa_branch }} - INTEGRATION_SETUP: ${{ github.event.inputs.integration_setup }} - PMM_SERVER_VERSION: ${{ github.event.inputs.pmm_server_version }} - PMM_CLIENT_VERSION: ${{ github.event.inputs.pmm_client_version }} - - PGSQL_VERSION: ${{ github.event.inputs.pgsql_version }} - PS_VERSION: ${{ github.event.inputs.ps_version }} - MONGO_VERSION: ${{ github.event.inputs.mongo_version }} - MONGO_SETUP: ${{ github.event.inputs.mongo_setup }} - - - - steps: - - name: Tests of pmm server version ${{ github.event.inputs.pmm_server_version }} for integration flag ${{ github.event.inputs.integration_setup }} - if: ${{ github.event_name == 'workflow_dispatch' && env.SHA != 'null' }} - uses: Sibz/github-status-action@v1 - with: - context: 'pmm2-ui-tests' - description: 'Tests execution has been started' - state: 'pending' - repository: ${{ github.event.inputs.repo }} - target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' - sha: ${{ env.SHA }} - - - name: Install NodeJS v16 - uses: percona-platform/setup-node@v2 - with: - node-version: 16.14.1 - - - name: Checkout UI tests - uses: percona-platform/checkout@v2 - with: - ref: ${{ env.UI_TESTS_BRANCH }} - repository: percona/pmm-ui-tests - path: ./pmm-ui-tests - - - name: Checkout pmm-qa Repo - uses: percona-platform/checkout@v2 - with: - repository: percona/pmm-qa - path: ./pmm-qa - ref: ${{ env.QA_TESTS_BRANCH }} - - - name: Start PMM-Sever - run: | - docker network create pmm-integration-network - docker run -d --restart always -e PERCONA_TEST_PLATFORM_ADDRESS=https://check-dev.percona.com:443 --network="pmm-integration-network" --publish 80:80 --publish 443:443 --name pmm-integration-server perconalab/pmm-server:${{ env.PMM_SERVER_VERSION }} - - - name: Setup Docker client for PMM-Server - run: | - sudo bash -x ./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 - sudo pmm-admin status - - - name: Setup Databases for PMM-Server - working-directory: pmm-qa/pmm-integration - run: | - sudo npm install - sudo npx ts-node ./integration-setup.ts --pmm-client-version=${{ env.PMM_CLIENT_VERSION }} --pgsql-version=${{ env.PGSQL_VERSION }} --ps-version=${{ env.PS_VERSION }} --mo-version=${{ env.MONGO_VERSION }} --mo-setup=${{ env.MONGO_SETUP }} --ci ${{ env.INTEGRATION_SETUP }} - shell: bash - - - name: Execute Integration Tests - working-directory: pmm-ui-tests - id: pmm-ui-tests - run: | - sudo docker ps -a - node -v - npm install - ./node_modules/.bin/codeceptjs run --debug --steps --reporter mochawesome -c pr.codecept.js --grep '${{ env.INTEGRATION_FLAG }}' - - - name: Generating the report - if: ${{ always() && (steps.pmm-ui-tests-all.outcome != 'skipped' || steps.pmm-ui-tests-tagged.outcome != 'skipped' ) }} - working-directory: pmm-ui-tests - run: | - npx mochawesome-merge tests/output/*/*.json > tests/output/output.json - - - name: Create the report - uses: phoenix-actions/test-reporting@v10 - if: success() || failure() - with: - token: ${{ secrets.ROBOT_TOKEN }} - name: Integration Tests - path: pmm-ui-tests/tests/output/mochawesome.json - reporter: mocha-json - - - name: Attaching the report - if: ${{ always() && (steps.pmm-ui-tests-all.outcome != 'skipped' || steps.pmm-ui-tests-tagged.outcome != 'skipped' ) }} - uses: percona-platform/upload-artifact@v2 - with: - name: pmm-ui-tests-report - path: pmm-ui-tests/tests/output diff --git a/.github/workflows/portal-tests-matrix.yml b/.github/workflows/portal-tests-matrix.yml deleted file mode 100644 index 6cd09181..00000000 --- a/.github/workflows/portal-tests-matrix.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: "Portal Tests Matrix" - -on: - push: - branches: - - "PMM-7-fix-portal-pipeline" - -jobs: - get_versions: - name: Get versions - uses: ./.github/workflows/pmm-version-getter.yml - with: - repository: ${{ inputs.repository || 'dev-latest'}} - matrix_range: 5 - - portal: - name: 'Portal / Integration' - uses: ./.github/workflows/portal-ui-tests.yml - secrets: inherit - needs: get_versions - strategy: - fail-fast: false - matrix: - old_version: ${{ fromJSON(needs.get_versions.outputs.version_matrix) }} - with: - pmm_ui_tests_branch: ${{ inputs.pmm_ui_tests_branch || 'main' }} - pmm_test_flag: '@portal' - pmm_server_version: ${{ matrix.old_version }} - pmm_client_version: ${{ matrix.old_version }} - pmm_qa_branch: ${{ inputs.pmm_qa_branch || 'main' }} - setup_services: '' - version_string_from: ${{needs.get_versions.outputs.start_version}} - diff --git a/.github/workflows/runner-integration-cli-tests.yml b/.github/workflows/runner-integration-cli-tests.yml index 47cdb9be..61f2620d 100644 --- a/.github/workflows/runner-integration-cli-tests.yml +++ b/.github/workflows/runner-integration-cli-tests.yml @@ -142,7 +142,7 @@ jobs: path: ./pmm-ui-tests/cli/test-report - name: Create status check - if: ${{ always() }} + if: ${{ env.SHA != 'null' && always() }} uses: percona/gh-action-github-status-action@master continue-on-error: true with: diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml deleted file mode 100644 index dec88eda..00000000 --- a/.github/workflows/testsuite.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: pmm2-testsuite pipeline -on: - # run with default inputs - pull_request: - -jobs: - bats-testsuite: - uses: Percona-Lab/pmm-submodules/.github/workflows/pmm2-testsuite.yml@PMM-2.0 - with: - server_image: ${{ github.event.inputs.server_image || 'perconalab/pmm-server:dev-latest' }} - client_version: ${{ github.event.inputs.client_version || 'dev-latest' }} - client_image: ${{ github.event.inputs.client_image || 'perconalab/pmm-client:dev-latest' }} - pmm_qa_branch: ${{ github.head_ref || 'main' }}