diff --git a/.github/workflows/cypress-workflow-bundle-snapshot-based-ci-groups.yml b/.github/workflows/cypress-workflow-bundle-snapshot-based-ci-groups.yml index c20803ac9..e59dfd3a4 100644 --- a/.github/workflows/cypress-workflow-bundle-snapshot-based-ci-groups.yml +++ b/.github/workflows/cypress-workflow-bundle-snapshot-based-ci-groups.yml @@ -72,7 +72,7 @@ jobs: uses: ./.github/workflows/release-e2e-workflow-template.yml with: test-name: "osd:ciGroup${{ matrix.ciGroup }}" - test-command: env CYPRESS_NO_COMMAND_LOG=1 CYPRESS_ML_COMMONS_DASHBOARDS_ENABLED=true CYPRESS_VISBUILDER_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-with-security --browser chromium --spec '${{ matrix.specs }}' + test-command: env CYPRESS_ML_COMMONS_DASHBOARDS_ENABLED=true CYPRESS_VISBUILDER_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-with-security --browser chromium --spec '${{ matrix.specs }}' osd-serve-args: --data_source.enabled=true --data_source.ssl.verificationMode=none --vis_builder.enabled=true --ml_commons_dashboards.enabled=true tests-without-security: @@ -85,7 +85,7 @@ jobs: uses: ./.github/workflows/release-e2e-workflow-template.yml with: test-name: "osd:ciGroup${{ matrix.ciGroup }}" - test-command: env CYPRESS_NO_COMMAND_LOG=1 CYPRESS_ML_COMMONS_DASHBOARDS_ENABLED=true CYPRESS_VISBUILDER_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-without-security --browser chromium --spec '${{ matrix.specs }}' + test-command: env CYPRESS_ML_COMMONS_DASHBOARDS_ENABLED=true CYPRESS_VISBUILDER_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-without-security --browser chromium --spec '${{ matrix.specs }}' osd-serve-args: --data_source.enabled=true --data_source.ssl.verificationMode=none --vis_builder.enabled=true --ml_commons_dashboards.enabled=true security-enabled: false diff --git a/.github/workflows/cypress-workflow-bundle-snapshot-based-windows.yml b/.github/workflows/cypress-workflow-bundle-snapshot-based-windows.yml index 4a5410a67..27cdc2ac6 100644 --- a/.github/workflows/cypress-workflow-bundle-snapshot-based-windows.yml +++ b/.github/workflows/cypress-workflow-bundle-snapshot-based-windows.yml @@ -5,18 +5,20 @@ on: paths: - 'cypress/**/core-opensearch-dashboards/**' - 'cypress/utils/dashboards/**' + - '.github/workflows/release-e2e-workflow-template-windows.yml' push: branches: [ '**' ] paths: - 'cypress/**/core-opensearch-dashboards/**' - 'cypress/utils/dashboards/**' + - '.github/workflows/release-e2e-workflow-template-windows.yml' jobs: tests-with-security: uses: ./.github/workflows/release-e2e-workflow-template-windows.yml with: test-name: Core Dashboards using Bundle Snapshot - test-command: env CYPRESS_NO_COMMAND_LOG=1 CYPRESS_VISBUILDER_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-with-security --browser chrome --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js' + test-command: env CYPRESS_VISBUILDER_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-with-security --browser chrome --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js' # not useful now as the windows e2e template currently do not allow serving parameters #osd-serve-args: --data_source.enabled=true --vis_builder.enabled=true @@ -24,7 +26,7 @@ jobs: uses: ./.github/workflows/release-e2e-workflow-template-windows.yml with: test-name: Core Dashboards using Bundle Snapshot - test-command: env CYPRESS_NO_COMMAND_LOG=1 CYPRESS_VISBUILDER_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-without-security --browser chrome --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js' + test-command: env CYPRESS_VISBUILDER_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-without-security --browser chrome --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js' # not useful now as the windows e2e template currently do not allow serving parameters #osd-serve-args: --data_source.enabled=true --vis_builder.enabled=true security-enabled: false \ No newline at end of file diff --git a/.github/workflows/cypress-workflow-bundle-snapshot-based.yml b/.github/workflows/cypress-workflow-bundle-snapshot-based.yml index edfe7e832..4c10e8fc2 100644 --- a/.github/workflows/cypress-workflow-bundle-snapshot-based.yml +++ b/.github/workflows/cypress-workflow-bundle-snapshot-based.yml @@ -6,25 +6,27 @@ on: - 'cypress/**/core-opensearch-dashboards/**' - 'cypress/utils/dashboards/**' - '.github/workflows/cypress-workflow-bundle-snapshot-based.yml' + - '.github/workflows/release-e2e-workflow-template.yml' push: branches: ['**'] paths: - 'cypress/**/core-opensearch-dashboards/**' - 'cypress/utils/dashboards/**' - '.github/workflows/cypress-workflow-bundle-snapshot-based.yml' + - '.github/workflows/release-e2e-workflow-template.yml' jobs: tests-with-security: uses: ./.github/workflows/release-e2e-workflow-template.yml with: test-name: Core Dashboards using Bundle Snapshot - test-command: env CYPRESS_NO_COMMAND_LOG=1 CYPRESS_ML_COMMONS_DASHBOARDS_ENABLED=true CYPRESS_VISBUILDER_ENABLED=true CYPRESS_UIMETRIC_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js' + test-command: env CYPRESS_ML_COMMONS_DASHBOARDS_ENABLED=true CYPRESS_VISBUILDER_ENABLED=true CYPRESS_UIMETRIC_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js' osd-serve-args: --data_source.enabled=true --data_source.ssl.verificationMode=none --vis_builder.enabled=true --ml_commons_dashboards.enabled=true --usageCollection.uiMetric.enabled=true tests-without-security: uses: ./.github/workflows/release-e2e-workflow-template.yml with: test-name: Core Dashboards using Bundle Snapshot - test-command: env CYPRESS_NO_COMMAND_LOG=1 CYPRESS_ML_COMMONS_DASHBOARDS_ENABLED=true CYPRESS_VISBUILDER_ENABLED=true CYPRESS_UIMETRIC_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-without-security --browser chromium --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js' + test-command: env CYPRESS_ML_COMMONS_DASHBOARDS_ENABLED=true CYPRESS_VISBUILDER_ENABLED=true CYPRESS_UIMETRIC_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-without-security --browser chromium --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js' osd-serve-args: --data_source.enabled=true --data_source.ssl.verificationMode=none --vis_builder.enabled=true --ml_commons_dashboards.enabled=true --usageCollection.uiMetric.enabled=true security-enabled: false diff --git a/.github/workflows/release-e2e-workflow-template.yml b/.github/workflows/release-e2e-workflow-template.yml index 1d0e976d5..3d212672a 100644 --- a/.github/workflows/release-e2e-workflow-template.yml +++ b/.github/workflows/release-e2e-workflow-template.yml @@ -39,6 +39,18 @@ jobs: with: repository: ${{github.repository}} path: cypress-test + - name: Remove Github built-in Chromium + run: | + sudo rm /usr/bin/chromium + sudo rm /usr/bin/chromium-browser + - name: Download Chromium 112 + working-directory: cypress-test + run: | + ## using Chromium 112 for stable test env, for more detail: https://github.com/opensearch-project/opensearch-build/issues/4241 + source ./browser_downloader.sh + download_chromium + sudo ln -s $chromium_path /usr/bin/chromium + sudo ln -s $chromium_path /usr/bin/chromium-browser - name: Get package version working-directory: cypress-test run: | @@ -127,6 +139,7 @@ jobs: - run: npx cypress cache path - name: Cypress tests uses: cypress-io/github-action@v2 + timeout-minutes: 120 with: working-directory: cypress-test command: ${{ inputs.test-command }} diff --git a/cypress.json b/cypress.json index 0bc38edf8..e0ada5ccd 100644 --- a/cypress.json +++ b/cypress.json @@ -1,5 +1,5 @@ { - "defaultCommandTimeout": 60000, + "defaultCommandTimeout": 10000, "requestTimeout": 60000, "responseTimeout": 60000, "baseUrl": "http://localhost:5601", diff --git a/cypress/support/index.js b/cypress/support/index.js index ee60936d9..fd4985712 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -19,7 +19,7 @@ // *********************************************************** // Import commands.js using ES2015 syntax: -import '../utils/commands'; +import { currentBackendEndpoint } from '../utils/commands'; import '../utils/dashboards/commands'; import '../utils/dashboards/datasource-management-dashboards-plugin/commands'; import '../utils/plugins/index-management-dashboards-plugin/commands'; @@ -33,7 +33,6 @@ import '../utils/plugins/notifications-dashboards/commands'; import '../utils/plugins/dashboards-assistant/commands'; import '../utils/dashboards/console/commands'; import '../utils/dashboards/workspace-plugin/commands'; -import { currentBackendEndpoint } from '../utils/commands'; import 'cypress-real-events';