From 89a861ea54552654fa3fc46efa945d904074b37a Mon Sep 17 00:00:00 2001 From: Preet Shah <48907607+preetsshah@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:14:20 +0530 Subject: [PATCH] Update Cypress CI workflows for issue-14324 (#14334) * Update Cypress CI workflows for issue-14324 * Update Cypress CI workflows to introduce parallel execution * Update cypress skip CI workflows --- .../cypress-integration-tests-mysql-skip.yml | 14 +++++++---- .../cypress-integration-tests-mysql.yml | 23 +++++++++++++++---- ...ress-integration-tests-postgresql-skip.yml | 14 +++++++---- .../cypress-integration-tests-postgresql.yml | 23 +++++++++++++++---- 4 files changed, 58 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cypress-integration-tests-mysql-skip.yml b/.github/workflows/cypress-integration-tests-mysql-skip.yml index 5a7b6b414ac5..e664cb0d9bbc 100644 --- a/.github/workflows/cypress-integration-tests-mysql-skip.yml +++ b/.github/workflows/cypress-integration-tests-mysql-skip.yml @@ -12,9 +12,15 @@ name: MySQL Cypress Integration Tests on: - push: - branches: - - main + schedule: + - cron: '30 0 * * *' + pull_request: + types: + - labeled + - opened + - synchronize + - reopened + - ready_for_review paths: - 'openmetadata-docs/**' @@ -23,7 +29,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - job: [0, 1, 2] + job: [1, 2, 3, 4] environment: test steps: - run: 'echo "Step is not required"' \ No newline at end of file diff --git a/.github/workflows/cypress-integration-tests-mysql.yml b/.github/workflows/cypress-integration-tests-mysql.yml index 86e448784353..d68ccb3b3c8e 100644 --- a/.github/workflows/cypress-integration-tests-mysql.yml +++ b/.github/workflows/cypress-integration-tests-mysql.yml @@ -16,9 +16,15 @@ name: MySQL Cypress Integration Tests on: workflow_dispatch: - push: - branches: - - main + schedule: + - cron: '30 0 * * *' + pull_request: + types: + - labeled + - opened + - synchronize + - reopened + - ready_for_review paths-ignore: - 'openmetadata-docs/**' @@ -31,7 +37,16 @@ concurrency: jobs: cypress-ci-mysql: + if: | + github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + || ( github.event_name == 'pull_request' + && contains(github.event.pull_request.labels.*.name, 'e2e') + && github.event.pull_request.draft == false + ) runs-on: ubuntu-latest + strategy: + matrix: + parallel-machine: [1, 2, 3, 4] environment: test steps: - name: Free Disk Space (Ubuntu) @@ -115,7 +130,7 @@ jobs: with: install-command: yarn --frozen-lockfile --silent --ignore-scripts record: true - parallel: false + parallel: true working-directory: openmetadata-ui/src/main/resources/ui/ wait-on: 'http://localhost:8585' group: cypress-ci-mysql-oss-${{ github.run_id }}-${{github.run_attempt}} diff --git a/.github/workflows/cypress-integration-tests-postgresql-skip.yml b/.github/workflows/cypress-integration-tests-postgresql-skip.yml index 0e73e66930a2..bbd841d60fd9 100644 --- a/.github/workflows/cypress-integration-tests-postgresql-skip.yml +++ b/.github/workflows/cypress-integration-tests-postgresql-skip.yml @@ -12,9 +12,15 @@ name: PostgreSQL Cypress Integration Tests on: - push: - branches: - - main + schedule: + - cron: '30 0 * * *' + pull_request: + types: + - labeled + - opened + - synchronize + - reopened + - ready_for_review paths: - 'openmetadata-docs/**' @@ -23,7 +29,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - job: [0, 1, 2] + job: [1, 2, 3, 4] environment: test steps: - run: 'echo "Step is not required"' \ No newline at end of file diff --git a/.github/workflows/cypress-integration-tests-postgresql.yml b/.github/workflows/cypress-integration-tests-postgresql.yml index 408488cf1ddf..c39490fca5e9 100644 --- a/.github/workflows/cypress-integration-tests-postgresql.yml +++ b/.github/workflows/cypress-integration-tests-postgresql.yml @@ -16,9 +16,15 @@ name: PostgreSQL Cypress Integration Tests on: workflow_dispatch: - push: - branches: - - main + schedule: + - cron: '30 0 * * *' + pull_request: + types: + - labeled + - opened + - synchronize + - reopened + - ready_for_review paths-ignore: - 'openmetadata-docs/**' @@ -31,7 +37,16 @@ concurrency: jobs: cypress-ci-postgresql: + if: | + github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + || ( github.event_name == 'pull_request' + && contains(github.event.pull_request.labels.*.name, 'e2e') + && github.event.pull_request.draft == false + ) runs-on: ubuntu-latest + strategy: + matrix: + parallel-machine: [1, 2, 3, 4] environment: test steps: - name: Free Disk Space (Ubuntu) @@ -115,7 +130,7 @@ jobs: with: install-command: yarn --frozen-lockfile --silent --ignore-scripts record: true - parallel: false + parallel: true working-directory: openmetadata-ui/src/main/resources/ui/ wait-on: 'http://localhost:8585' group: cypress-ci-psql-oss-${{ github.run_id }}-${{github.run_attempt}}