From 1135793682a69ba1eeb7e402b8984e21731b19f7 Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Wed, 6 Dec 2023 16:15:16 -0800 Subject: [PATCH 01/13] Fix the integration cypress test and add a dashboard check in integration GH workflow Signed-off-by: Ryan Liang --- .cypress/integration/9_integrations.spec.js | 2 +- .../workflows/integration-tests-workflow.yml | 20 +++++++++++-- package.json | 4 +-- yarn.lock | 29 ++++++++++++------- 4 files changed, 39 insertions(+), 16 deletions(-) diff --git a/.cypress/integration/9_integrations.spec.js b/.cypress/integration/9_integrations.spec.js index 162acd958..933b0955f 100644 --- a/.cypress/integration/9_integrations.spec.js +++ b/.cypress/integration/9_integrations.spec.js @@ -66,7 +66,7 @@ describe('Basic sanity test for integrations plugin', () => { moveToAvailableNginxIntegration(); cy.get('.euiFilterGroup').trigger('mouseover').click(); cy.get('.euiFilterSelectItem').contains('visualization').click(); - cy.get('.euiTableRow').should('have.length', 4);//Filters correctly to visualization types + cy.get('.euiTableRow').should('have.length', 6);//Filters correctly to visualization types }) }); diff --git a/.github/workflows/integration-tests-workflow.yml b/.github/workflows/integration-tests-workflow.yml index cd2f9de38..cc93f83ec 100644 --- a/.github/workflows/integration-tests-workflow.yml +++ b/.github/workflows/integration-tests-workflow.yml @@ -114,8 +114,24 @@ jobs: - name: Run OpenSearch Dashboards server run: | cd OpenSearch-Dashboards - yarn start --no-base-path --no-watch & - sleep 200 + nohup yarn start --no-base-path --no-watch | tee dashboard.log & + + - name : Check If OpenSearch Dashboards Is Ready + if: ${{ runner.os == 'Linux' }} + run: | + cd ./OpenSearch-Dashboards + echo "Start checking OpenSearch Dashboards." + for i in {1..60}; do + if grep -q "bundles compiled successfully after" "dashboard.log"; then + echo "OpenSearch Dashboards compiled successfully." + break + fi + if [ $i -eq 60 ]; then + echo "Timeout for 600 seconds reached. OpenSearch Dashboards did not finish compiling." + exit 1 + fi + sleep 10 + done - name: Install Cypress run: | diff --git a/package.json b/package.json index d9ac42f9c..8b8dca7cd 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@types/react-test-renderer": "^16.9.1", "@types/sanitize-filename": "^1.6.3", "antlr4ts-cli": "^0.5.0-alpha.4", - "cypress": "^12.8.1", + "cypress": "^13.6.1", "cypress-watch-and-reload": "^1.10.6", "eslint": "^6.8.0", "husky": "6.0.0", @@ -82,4 +82,4 @@ "node_modules/*", "target/*" ] -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index fb51cc33e..9c40cff37 100644 --- a/yarn.lock +++ b/yarn.lock @@ -108,7 +108,7 @@ resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.6.0.tgz#ec6cd237440700bc23ca23087f513c75508958b0" integrity sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA== -"@cypress/request@2.88.12", "@cypress/request@^3.0.0": +"@cypress/request@^3.0.0": version "3.0.1" resolved "https://registry.yarnpkg.com/@cypress/request/-/request-3.0.1.tgz#72d7d5425236a2413bd3d8bb66d02d9dc3168960" integrity sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ== @@ -298,10 +298,12 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-20.5.9.tgz#a70ec9d8fa0180a314c3ede0e20ea56ff71aed9a" integrity sha512-PcGNd//40kHAS3sTlzKB9C9XL4K0sTup8nbG5lC14kzEteTNuAFh9u5nA0o5TWnSG2r/JNPRXFVcHJIIeRlmqQ== -"@types/node@^16.18.39": - version "16.18.48" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.48.tgz#3bc872236cdb31cb51024d8875d655e25db489a4" - integrity sha512-mlaecDKQ7rIZrYD7iiKNdzFb6e/qD5I9U1rAhq+Fd+DWvYVs+G2kv74UFHmSOlg5+i/vF3XxuR522V4u8BqO+Q== +"@types/node@^18.17.5": + version "18.19.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.2.tgz#865107157bda220eef9fa8c2173152d6559a41ae" + integrity sha512-6wzfBdbWpe8QykUkXBjtmO3zITA0A3FIjoy+in0Y2K4KrCiRhNYJIdwAPDffZ3G6GnaKaSLSEa9ZuORLfEoiwg== + dependencies: + undici-types "~5.26.4" "@types/plotly.js@*": version "2.12.26" @@ -982,14 +984,14 @@ cypress-watch-and-reload@^1.10.6: chokidar "3.5.3" ws "8.13.0" -cypress@^12.8.1: - version "12.17.4" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.17.4.tgz#b4dadf41673058493fa0d2362faa3da1f6ae2e6c" - integrity sha512-gAN8Pmns9MA5eCDFSDJXWKUpaL3IDd89N9TtIupjYnzLSmlpVr+ZR+vb4U/qaMp+lB6tBvAmt7504c3Z4RU5KQ== +cypress@^13.6.1: + version "13.6.1" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-13.6.1.tgz#c5f714f08551666ed3ac1fa95718eabb23a416df" + integrity sha512-k1Wl5PQcA/4UoTffYKKaxA0FJKwg8yenYNYRzLt11CUR0Kln+h7Udne6mdU1cUIdXBDTVZWtmiUjzqGs7/pEpw== dependencies: - "@cypress/request" "2.88.12" + "@cypress/request" "^3.0.0" "@cypress/xvfb" "^1.2.4" - "@types/node" "^16.18.39" + "@types/node" "^18.17.5" "@types/sinonjs__fake-timers" "8.1.1" "@types/sizzle" "^2.3.2" arch "^2.2.0" @@ -3402,6 +3404,11 @@ typed-styles@^0.0.7: resolved "https://registry.yarnpkg.com/typed-styles/-/typed-styles-0.0.7.tgz#93392a008794c4595119ff62dde6809dbc40a3d9" integrity sha512-pzP0PWoZUhsECYjABgCGQlRGL1n7tOHsgwYv3oIiEpJwGhFTuty/YNeduxQYzXXa3Ge5BdT6sHYIQYpl4uJ+5Q== +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + unherit@^1.0.4: version "1.1.3" resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.3.tgz#6c9b503f2b41b262330c80e91c8614abdaa69c22" From 0fdbbe6d4382b2dba174080da03e3aa65739bed7 Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Wed, 6 Dec 2023 16:47:30 -0800 Subject: [PATCH 02/13] Minimize the cypress steps in ci Signed-off-by: Ryan Liang --- .../workflows/integration-tests-workflow.yml | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/.github/workflows/integration-tests-workflow.yml b/.github/workflows/integration-tests-workflow.yml index cc93f83ec..605d91746 100644 --- a/.github/workflows/integration-tests-workflow.yml +++ b/.github/workflows/integration-tests-workflow.yml @@ -136,7 +136,7 @@ jobs: - name: Install Cypress run: | cd ./OpenSearch-Dashboards/plugins/dashboards-observability - npx cypress install + npm install cypress --save-dev shell: bash - name: Get Cypress version @@ -145,26 +145,15 @@ jobs: cd ./OpenSearch-Dashboards/plugins/dashboards-observability echo "::set-output name=cypress_version::$(cat ./package.json | jq '.dependencies.cypress' | tr -d '"')" - - name: Cache Cypress - id: cache-cypress - uses: actions/cache@v2 - with: - path: ${{ matrix.cypress_cache_folder }} - key: cypress-cache-v2-${{ runner.os }}-${{ hashFiles('OpenSearch-Dashboards/plugins/dashboards-observability/package.json') }} - - name: Reset npm's script shell if: ${{ matrix.os == 'windows-latest' }} run: | npm config delete script-shell - - name: Cypress tests - uses: cypress-io/github-action@v2 - with: - working-directory: OpenSearch-Dashboards/plugins/dashboards-observability - command: yarn cypress:parallel --browser chrome - wait-on: 'http://localhost:5601' - env: - CYPRESS_CACHE_FOLDER: ${{ matrix.cypress_cache_folder }} + - name: Run Cypress tests + run: | + cd ./OpenSearch-Dashboards/plugins/dashboards-observability + yarn cypress:parallel --browser chrome - name: Capture failure screenshots uses: actions/upload-artifact@v1 From d141d590a750de68abbb3644bc975ff588079f47 Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Thu, 7 Dec 2023 15:52:45 -0800 Subject: [PATCH 03/13] Revert it back to npx install Signed-off-by: Ryan Liang --- .github/workflows/integration-tests-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests-workflow.yml b/.github/workflows/integration-tests-workflow.yml index 605d91746..6d030102e 100644 --- a/.github/workflows/integration-tests-workflow.yml +++ b/.github/workflows/integration-tests-workflow.yml @@ -136,7 +136,7 @@ jobs: - name: Install Cypress run: | cd ./OpenSearch-Dashboards/plugins/dashboards-observability - npm install cypress --save-dev + npx cypress install shell: bash - name: Get Cypress version From da6c27d5e74be7c26ad1529c95c86fec92025e2c Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Thu, 7 Dec 2023 16:47:13 -0800 Subject: [PATCH 04/13] Parallel workflow setup 1 Signed-off-by: Ryan Liang --- .../workflows/integration-tests-workflow.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-tests-workflow.yml b/.github/workflows/integration-tests-workflow.yml index 6d030102e..3c6a90e63 100644 --- a/.github/workflows/integration-tests-workflow.yml +++ b/.github/workflows/integration-tests-workflow.yml @@ -10,6 +10,21 @@ env: OPENSEARCH_PLUGIN_VERSION: '3.0.0.0' jobs: + prepare-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Generate test files list + id: set-matrix + run: | + TEST_FILES=$(ls .cypress/integration/*.{js,ts} | xargs -n 1 basename | sed 's/.spec.js//; s/.spec.ts//') + TEST_FILES_JSON=$(echo $TEST_FILES | jq -R -s -c 'split("\n")[:-1]') + echo "::set-output name=matrix::{\"testfiles\": $TEST_FILES_JSON}" + tests: env: # Prevents extra Cypress installation progress messages @@ -23,10 +38,10 @@ jobs: matrix: os: [ubuntu-latest] java: [11] + testfiles: ${{ fromJson(needs.prepare-matrix.outputs.matrix).testfiles }} include: - os: ubuntu-latest cypress_cache_folder: ~/.cache/Cypress - runs-on: ${{ matrix.os }} steps: @@ -153,7 +168,7 @@ jobs: - name: Run Cypress tests run: | cd ./OpenSearch-Dashboards/plugins/dashboards-observability - yarn cypress:parallel --browser chrome + yarn cypress:run --browser chrome --headless --spec '.cypress/integration/${{ matrix.testfiles }}' - name: Capture failure screenshots uses: actions/upload-artifact@v1 From 316863dd6577ff32806d296ae3a5980cd1304be0 Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Thu, 7 Dec 2023 16:50:10 -0800 Subject: [PATCH 05/13] Parallel workflow setup 1 Signed-off-by: Ryan Liang --- .github/workflows/integration-tests-workflow.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/integration-tests-workflow.yml b/.github/workflows/integration-tests-workflow.yml index 3c6a90e63..996bf441e 100644 --- a/.github/workflows/integration-tests-workflow.yml +++ b/.github/workflows/integration-tests-workflow.yml @@ -24,6 +24,9 @@ jobs: TEST_FILES=$(ls .cypress/integration/*.{js,ts} | xargs -n 1 basename | sed 's/.spec.js//; s/.spec.ts//') TEST_FILES_JSON=$(echo $TEST_FILES | jq -R -s -c 'split("\n")[:-1]') echo "::set-output name=matrix::{\"testfiles\": $TEST_FILES_JSON}" + + - name: Print matrix output + run: echo ${{ steps.set-matrix.outputs.matrix }} tests: env: From 0772dbf00f6876b1cb1bbfa212c07ebf593d893b Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Thu, 7 Dec 2023 16:53:48 -0800 Subject: [PATCH 06/13] Correct test files matrix name Signed-off-by: Ryan Liang --- .github/workflows/integration-tests-workflow.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration-tests-workflow.yml b/.github/workflows/integration-tests-workflow.yml index 996bf441e..8155bab89 100644 --- a/.github/workflows/integration-tests-workflow.yml +++ b/.github/workflows/integration-tests-workflow.yml @@ -21,9 +21,10 @@ jobs: - name: Generate test files list id: set-matrix run: | - TEST_FILES=$(ls .cypress/integration/*.{js,ts} | xargs -n 1 basename | sed 's/.spec.js//; s/.spec.ts//') - TEST_FILES_JSON=$(echo $TEST_FILES | jq -R -s -c 'split("\n")[:-1]') - echo "::set-output name=matrix::{\"testfiles\": $TEST_FILES_JSON}" + TEST_FILES=$(ls .cypress/integration/*.{js,ts} | xargs -n 1 basename) + TEST_FILES_JSON=$(echo $TEST_FILES | jq -R -s -c 'split("\n") | map(select(length > 0)) | map("\"" + . + "\"") | join(", ")') + echo "::set-output name=matrix::{\"testfiles\": [$TEST_FILES_JSON]}" + - name: Print matrix output run: echo ${{ steps.set-matrix.outputs.matrix }} From 9625bd3710dadfc3dc90cc545d9cc9066f3e274e Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Thu, 7 Dec 2023 16:58:23 -0800 Subject: [PATCH 07/13] correct the matrix format and add comma for the json arraylist Signed-off-by: Ryan Liang --- .github/workflows/integration-tests-workflow.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration-tests-workflow.yml b/.github/workflows/integration-tests-workflow.yml index 8155bab89..0bfa5fb93 100644 --- a/.github/workflows/integration-tests-workflow.yml +++ b/.github/workflows/integration-tests-workflow.yml @@ -21,10 +21,8 @@ jobs: - name: Generate test files list id: set-matrix run: | - TEST_FILES=$(ls .cypress/integration/*.{js,ts} | xargs -n 1 basename) - TEST_FILES_JSON=$(echo $TEST_FILES | jq -R -s -c 'split("\n") | map(select(length > 0)) | map("\"" + . + "\"") | join(", ")') - echo "::set-output name=matrix::{\"testfiles\": [$TEST_FILES_JSON]}" - + TEST_FILES=$(ls .cypress/integration/*.{js,ts} | xargs -n 1 basename | jq -R -s -c 'split("\n") | map(select(length > 0))') + echo "::set-output name=matrix::{\"testfiles\": $TEST_FILES}" - name: Print matrix output run: echo ${{ steps.set-matrix.outputs.matrix }} From e5065a4122cba1b252402ed9a9e5d1d537edb5cb Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Thu, 7 Dec 2023 17:17:31 -0800 Subject: [PATCH 08/13] Add matrix env var Signed-off-by: Ryan Liang --- .github/workflows/integration-tests-workflow.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integration-tests-workflow.yml b/.github/workflows/integration-tests-workflow.yml index 0bfa5fb93..dd5f32cbc 100644 --- a/.github/workflows/integration-tests-workflow.yml +++ b/.github/workflows/integration-tests-workflow.yml @@ -12,8 +12,6 @@ env: jobs: prepare-matrix: runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - name: Checkout repository uses: actions/checkout@v2 @@ -22,12 +20,13 @@ jobs: id: set-matrix run: | TEST_FILES=$(ls .cypress/integration/*.{js,ts} | xargs -n 1 basename | jq -R -s -c 'split("\n") | map(select(length > 0))') - echo "::set-output name=matrix::{\"testfiles\": $TEST_FILES}" + echo "TEST_FILES_MATRIX=$TEST_FILES" >> $GITHUB_ENV - name: Print matrix output - run: echo ${{ steps.set-matrix.outputs.matrix }} + run: echo ${{ env.TEST_FILES_MATRIX }} tests: + needs: prepare-matrix env: # Prevents extra Cypress installation progress messages CI: 1 @@ -40,7 +39,7 @@ jobs: matrix: os: [ubuntu-latest] java: [11] - testfiles: ${{ fromJson(needs.prepare-matrix.outputs.matrix).testfiles }} + testfiles: ${{ env.TEST_FILES_MATRIX }} include: - os: ubuntu-latest cypress_cache_folder: ~/.cache/Cypress From ab9caa6fefd430045b435c5322aae6ef3a354637 Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Thu, 7 Dec 2023 17:22:25 -0800 Subject: [PATCH 09/13] Try hardcoded list for test files Signed-off-by: Ryan Liang --- .../workflows/integration-tests-workflow.yml | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/workflows/integration-tests-workflow.yml b/.github/workflows/integration-tests-workflow.yml index dd5f32cbc..dc03ffcfe 100644 --- a/.github/workflows/integration-tests-workflow.yml +++ b/.github/workflows/integration-tests-workflow.yml @@ -10,23 +10,7 @@ env: OPENSEARCH_PLUGIN_VERSION: '3.0.0.0' jobs: - prepare-matrix: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Generate test files list - id: set-matrix - run: | - TEST_FILES=$(ls .cypress/integration/*.{js,ts} | xargs -n 1 basename | jq -R -s -c 'split("\n") | map(select(length > 0))') - echo "TEST_FILES_MATRIX=$TEST_FILES" >> $GITHUB_ENV - - - name: Print matrix output - run: echo ${{ env.TEST_FILES_MATRIX }} - tests: - needs: prepare-matrix env: # Prevents extra Cypress installation progress messages CI: 1 @@ -39,7 +23,18 @@ jobs: matrix: os: [ubuntu-latest] java: [11] - testfiles: ${{ env.TEST_FILES_MATRIX }} + testfiles: [ + 10_datasources.spec.js, + 1_event_analytics.spec.js, + 2_notebooks.spec.js, + 3_panels.spec.ts, + 4_trace_analytics_dashboard.spec.js, + 5_trace_analytics_services.spec.js, + 6_trace_analytics_traces.spec.js, + 7_app_analytics.spec.js, + 8_metrics_analytics.spec.js, + 9_integrations.spec.js + ] include: - os: ubuntu-latest cypress_cache_folder: ~/.cache/Cypress From 792237982c7c3220750e46202cf226e74b27f403 Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Fri, 8 Dec 2023 12:11:39 -0800 Subject: [PATCH 10/13] Refactor cypress dir Signed-off-by: Ryan Liang --- .../app_analytics.spec.js} | 4 +-- .../datasources.spec.js} | 0 .../event_analytics.spec.js} | 6 ++-- .../integrations.spec.js} | 2 +- .../metrics_analytics.spec.js} | 6 ++-- .../notebooks.spec.js} | 4 +-- .../panels.spec.ts} | 4 +-- .../trace_analytics_dashboard.spec.js} | 4 +-- .../trace_analytics_services.spec.js} | 4 +-- .../trace_analytics_traces.spec.js} | 2 +- .../workflows/integration-tests-workflow.yml | 10 +++---- package.json | 2 +- yarn.lock | 29 +++++++------------ 13 files changed, 35 insertions(+), 42 deletions(-) rename .cypress/integration/{7_app_analytics.spec.js => app_analytics_tests/app_analytics.spec.js} (99%) rename .cypress/integration/{10_datasources.spec.js => datasources_tests/datasources.spec.js} (100%) rename .cypress/integration/{1_event_analytics.spec.js => event_analytics_tests/event_analytics.spec.js} (99%) rename .cypress/integration/{9_integrations.spec.js => integrations_tests/integrations.spec.js} (99%) rename .cypress/integration/{8_metrics_analytics.spec.js => metrics_analytics_tests/metrics_analytics.spec.js} (98%) rename .cypress/integration/{2_notebooks.spec.js => notebooks_tests/notebooks.spec.js} (99%) rename .cypress/integration/{3_panels.spec.ts => panels_tests/panels.spec.ts} (99%) rename .cypress/integration/{4_trace_analytics_dashboard.spec.js => trace_analytics_tests/trace_analytics_dashboard.spec.js} (99%) rename .cypress/integration/{5_trace_analytics_services.spec.js => trace_analytics_tests/trace_analytics_services.spec.js} (99%) rename .cypress/integration/{6_trace_analytics_traces.spec.js => trace_analytics_tests/trace_analytics_traces.spec.js} (98%) diff --git a/.cypress/integration/7_app_analytics.spec.js b/.cypress/integration/app_analytics_tests/app_analytics.spec.js similarity index 99% rename from .cypress/integration/7_app_analytics.spec.js rename to .cypress/integration/app_analytics_tests/app_analytics.spec.js index 1e50d76aa..b875d4f3b 100644 --- a/.cypress/integration/7_app_analytics.spec.js +++ b/.cypress/integration/app_analytics_tests/app_analytics.spec.js @@ -4,7 +4,7 @@ */ /// -import { suppressResizeObserverIssue } from '../utils/constants'; +import { suppressResizeObserverIssue } from '../../utils/constants'; import { delay, @@ -33,7 +33,7 @@ import { newName, TYPING_DELAY, timeoutDelay -} from '../utils/app_constants'; +} from '../../utils/app_constants'; suppressResizeObserverIssue();//needs to be in file once diff --git a/.cypress/integration/10_datasources.spec.js b/.cypress/integration/datasources_tests/datasources.spec.js similarity index 100% rename from .cypress/integration/10_datasources.spec.js rename to .cypress/integration/datasources_tests/datasources.spec.js diff --git a/.cypress/integration/1_event_analytics.spec.js b/.cypress/integration/event_analytics_tests/event_analytics.spec.js similarity index 99% rename from .cypress/integration/1_event_analytics.spec.js rename to .cypress/integration/event_analytics_tests/event_analytics.spec.js index f25987f4f..c018a0060 100644 --- a/.cypress/integration/1_event_analytics.spec.js +++ b/.cypress/integration/event_analytics_tests/event_analytics.spec.js @@ -24,8 +24,8 @@ import { VIS_TYPE_VBAR, FIELD_HOST, FIELD_AGENT -} from '../utils/event_analytics/constants'; -import { suppressResizeObserverIssue, COMMAND_TIMEOUT_LONG } from '../utils/constants'; +} from '../../utils/event_analytics/constants'; +import { suppressResizeObserverIssue, COMMAND_TIMEOUT_LONG } from '../../utils/constants'; import { querySearch, @@ -34,7 +34,7 @@ import { landOnEventVisualizations, landOnPanels, clearQuerySearchBoxText, -} from '../utils/event_analytics/helpers'; +} from '../../utils/event_analytics/helpers'; describe('Adding sample data and visualization', () => { it('Adds sample flights data for event analytics', () => { diff --git a/.cypress/integration/9_integrations.spec.js b/.cypress/integration/integrations_tests/integrations.spec.js similarity index 99% rename from .cypress/integration/9_integrations.spec.js rename to .cypress/integration/integrations_tests/integrations.spec.js index 933b0955f..4b446f26f 100644 --- a/.cypress/integration/9_integrations.spec.js +++ b/.cypress/integration/integrations_tests/integrations.spec.js @@ -7,7 +7,7 @@ import { TEST_INTEGRATION_INSTANCE, TEST_SAMPLE_INSTANCE, -} from '../utils/constants'; +} from '../../utils/constants'; let testInstanceSuffix = (Math.random() + 1).toString(36).substring(7); let testInstance = `${TEST_INTEGRATION_INSTANCE}_${testInstanceSuffix}`; diff --git a/.cypress/integration/8_metrics_analytics.spec.js b/.cypress/integration/metrics_analytics_tests/metrics_analytics.spec.js similarity index 98% rename from .cypress/integration/8_metrics_analytics.spec.js rename to .cypress/integration/metrics_analytics_tests/metrics_analytics.spec.js index 255a35434..d7898ba5a 100644 --- a/.cypress/integration/8_metrics_analytics.spec.js +++ b/.cypress/integration/metrics_analytics_tests/metrics_analytics.spec.js @@ -11,9 +11,9 @@ import { PPL_METRICS_NAMES, VIS_TYPE_LINE, TESTING_PANEL, -} from '../utils/metrics_constants'; -import { suppressResizeObserverIssue, COMMAND_TIMEOUT_LONG } from '../utils/constants'; -import { landOnPanels, clearQuerySearchBoxText } from '../utils/event_analytics/helpers'; +} from '../../utils/metrics_constants'; +import { suppressResizeObserverIssue, COMMAND_TIMEOUT_LONG } from '../../utils/constants'; +import { landOnPanels, clearQuerySearchBoxText } from '../../utils/event_analytics/helpers'; describe('Metrics Analytics', () => { beforeEach(() => { diff --git a/.cypress/integration/2_notebooks.spec.js b/.cypress/integration/notebooks_tests/notebooks.spec.js similarity index 99% rename from .cypress/integration/2_notebooks.spec.js rename to .cypress/integration/notebooks_tests/notebooks.spec.js index 46aab9b51..e23d70667 100644 --- a/.cypress/integration/2_notebooks.spec.js +++ b/.cypress/integration/notebooks_tests/notebooks.spec.js @@ -15,9 +15,9 @@ import { NOTEBOOK_TEXT, OPENSEARCH_URL, COMMAND_TIMEOUT_LONG, -} from '../utils/constants'; +} from '../../utils/constants'; -import { SAMPLE_PANEL } from '../utils/panel_constants'; +import { SAMPLE_PANEL } from '../../utils/panel_constants'; import { skipOn } from '@cypress/skip-test'; diff --git a/.cypress/integration/3_panels.spec.ts b/.cypress/integration/panels_tests/panels.spec.ts similarity index 99% rename from .cypress/integration/3_panels.spec.ts rename to .cypress/integration/panels_tests/panels.spec.ts index 7096f5aa8..3750c2e02 100644 --- a/.cypress/integration/3_panels.spec.ts +++ b/.cypress/integration/panels_tests/panels.spec.ts @@ -5,7 +5,7 @@ /// -import { suppressResizeObserverIssue } from '../utils/constants'; +import { suppressResizeObserverIssue } from '../../utils/constants'; import { delay, NEW_VISUALIZATION_NAME, @@ -14,7 +14,7 @@ import { PPL_VISUALIZATIONS, PPL_VISUALIZATIONS_NAMES, TEST_PANEL, -} from '../utils/panel_constants'; +} from '../../utils/panel_constants'; describe('Panels testing with Sample Data', () => { suppressResizeObserverIssue();//needs to be in file once diff --git a/.cypress/integration/4_trace_analytics_dashboard.spec.js b/.cypress/integration/trace_analytics_tests/trace_analytics_dashboard.spec.js similarity index 99% rename from .cypress/integration/4_trace_analytics_dashboard.spec.js rename to .cypress/integration/trace_analytics_tests/trace_analytics_dashboard.spec.js index be31f2183..5edf0d33a 100644 --- a/.cypress/integration/4_trace_analytics_dashboard.spec.js +++ b/.cypress/integration/trace_analytics_tests/trace_analytics_dashboard.spec.js @@ -5,8 +5,8 @@ /// -import { testDataSet, delay, setTimeFilter, jaegerTestDataSet } from '../utils/constants'; -import { suppressResizeObserverIssue } from '../utils/constants'; +import { testDataSet, delay, setTimeFilter, jaegerTestDataSet } from '../../utils/constants'; +import { suppressResizeObserverIssue } from '../../utils/constants'; suppressResizeObserverIssue();//needs to be in file once diff --git a/.cypress/integration/5_trace_analytics_services.spec.js b/.cypress/integration/trace_analytics_tests/trace_analytics_services.spec.js similarity index 99% rename from .cypress/integration/5_trace_analytics_services.spec.js rename to .cypress/integration/trace_analytics_tests/trace_analytics_services.spec.js index f09b92426..1f278c2b3 100644 --- a/.cypress/integration/5_trace_analytics_services.spec.js +++ b/.cypress/integration/trace_analytics_tests/trace_analytics_services.spec.js @@ -5,8 +5,8 @@ /// -import { delay, SERVICE_NAME, SERVICE_SPAN_ID, setTimeFilter, verify_traces_spans_data_grid_cols_exists, count_table_row, AUTH_SERVICE_SPAN_ID } from '../utils/constants'; -import { suppressResizeObserverIssue } from '../utils/constants'; +import { delay, SERVICE_NAME, SERVICE_SPAN_ID, setTimeFilter, verify_traces_spans_data_grid_cols_exists, count_table_row, AUTH_SERVICE_SPAN_ID } from '../../utils/constants'; +import { suppressResizeObserverIssue } from '../../utils/constants'; suppressResizeObserverIssue();//needs to be in file once diff --git a/.cypress/integration/6_trace_analytics_traces.spec.js b/.cypress/integration/trace_analytics_tests/trace_analytics_traces.spec.js similarity index 98% rename from .cypress/integration/6_trace_analytics_traces.spec.js rename to .cypress/integration/trace_analytics_tests/trace_analytics_traces.spec.js index 336f5b6ff..843e6640a 100644 --- a/.cypress/integration/6_trace_analytics_traces.spec.js +++ b/.cypress/integration/trace_analytics_tests/trace_analytics_traces.spec.js @@ -5,7 +5,7 @@ /// -import { delay, setTimeFilter, SPAN_ID, TRACE_ID } from '../utils/constants'; +import { delay, setTimeFilter, SPAN_ID, TRACE_ID } from '../../utils/constants'; describe('Testing traces table empty state', () => { beforeEach(() => { diff --git a/.github/workflows/integration-tests-workflow.yml b/.github/workflows/integration-tests-workflow.yml index dc03ffcfe..035f242f2 100644 --- a/.github/workflows/integration-tests-workflow.yml +++ b/.github/workflows/integration-tests-workflow.yml @@ -23,17 +23,17 @@ jobs: matrix: os: [ubuntu-latest] java: [11] - testfiles: [ - 10_datasources.spec.js, + testgroups: [ 1_event_analytics.spec.js, - 2_notebooks.spec.js, + notebooks, 3_panels.spec.ts, 4_trace_analytics_dashboard.spec.js, 5_trace_analytics_services.spec.js, 6_trace_analytics_traces.spec.js, 7_app_analytics.spec.js, 8_metrics_analytics.spec.js, - 9_integrations.spec.js + 9_integrations.spec.js, + 10_datasources.spec.js ] include: - os: ubuntu-latest @@ -164,7 +164,7 @@ jobs: - name: Run Cypress tests run: | cd ./OpenSearch-Dashboards/plugins/dashboards-observability - yarn cypress:run --browser chrome --headless --spec '.cypress/integration/${{ matrix.testfiles }}' + yarn cypress:run --browser chrome --headless --spec '.cypress/integration/${{ matrix.testgroups }}/*' - name: Capture failure screenshots uses: actions/upload-artifact@v1 diff --git a/package.json b/package.json index 8b8dca7cd..2e040938a 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@types/react-test-renderer": "^16.9.1", "@types/sanitize-filename": "^1.6.3", "antlr4ts-cli": "^0.5.0-alpha.4", - "cypress": "^13.6.1", + "cypress": "^12.8.1", "cypress-watch-and-reload": "^1.10.6", "eslint": "^6.8.0", "husky": "6.0.0", diff --git a/yarn.lock b/yarn.lock index 9c40cff37..fb51cc33e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -108,7 +108,7 @@ resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.6.0.tgz#ec6cd237440700bc23ca23087f513c75508958b0" integrity sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA== -"@cypress/request@^3.0.0": +"@cypress/request@2.88.12", "@cypress/request@^3.0.0": version "3.0.1" resolved "https://registry.yarnpkg.com/@cypress/request/-/request-3.0.1.tgz#72d7d5425236a2413bd3d8bb66d02d9dc3168960" integrity sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ== @@ -298,12 +298,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-20.5.9.tgz#a70ec9d8fa0180a314c3ede0e20ea56ff71aed9a" integrity sha512-PcGNd//40kHAS3sTlzKB9C9XL4K0sTup8nbG5lC14kzEteTNuAFh9u5nA0o5TWnSG2r/JNPRXFVcHJIIeRlmqQ== -"@types/node@^18.17.5": - version "18.19.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.2.tgz#865107157bda220eef9fa8c2173152d6559a41ae" - integrity sha512-6wzfBdbWpe8QykUkXBjtmO3zITA0A3FIjoy+in0Y2K4KrCiRhNYJIdwAPDffZ3G6GnaKaSLSEa9ZuORLfEoiwg== - dependencies: - undici-types "~5.26.4" +"@types/node@^16.18.39": + version "16.18.48" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.48.tgz#3bc872236cdb31cb51024d8875d655e25db489a4" + integrity sha512-mlaecDKQ7rIZrYD7iiKNdzFb6e/qD5I9U1rAhq+Fd+DWvYVs+G2kv74UFHmSOlg5+i/vF3XxuR522V4u8BqO+Q== "@types/plotly.js@*": version "2.12.26" @@ -984,14 +982,14 @@ cypress-watch-and-reload@^1.10.6: chokidar "3.5.3" ws "8.13.0" -cypress@^13.6.1: - version "13.6.1" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-13.6.1.tgz#c5f714f08551666ed3ac1fa95718eabb23a416df" - integrity sha512-k1Wl5PQcA/4UoTffYKKaxA0FJKwg8yenYNYRzLt11CUR0Kln+h7Udne6mdU1cUIdXBDTVZWtmiUjzqGs7/pEpw== +cypress@^12.8.1: + version "12.17.4" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.17.4.tgz#b4dadf41673058493fa0d2362faa3da1f6ae2e6c" + integrity sha512-gAN8Pmns9MA5eCDFSDJXWKUpaL3IDd89N9TtIupjYnzLSmlpVr+ZR+vb4U/qaMp+lB6tBvAmt7504c3Z4RU5KQ== dependencies: - "@cypress/request" "^3.0.0" + "@cypress/request" "2.88.12" "@cypress/xvfb" "^1.2.4" - "@types/node" "^18.17.5" + "@types/node" "^16.18.39" "@types/sinonjs__fake-timers" "8.1.1" "@types/sizzle" "^2.3.2" arch "^2.2.0" @@ -3404,11 +3402,6 @@ typed-styles@^0.0.7: resolved "https://registry.yarnpkg.com/typed-styles/-/typed-styles-0.0.7.tgz#93392a008794c4595119ff62dde6809dbc40a3d9" integrity sha512-pzP0PWoZUhsECYjABgCGQlRGL1n7tOHsgwYv3oIiEpJwGhFTuty/YNeduxQYzXXa3Ge5BdT6sHYIQYpl4uJ+5Q== -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - unherit@^1.0.4: version "1.1.3" resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.3.tgz#6c9b503f2b41b262330c80e91c8614abdaa69c22" From d5ce43d16700836c88aa7cfd3089331f210be8dd Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Fri, 8 Dec 2023 12:18:22 -0800 Subject: [PATCH 11/13] Correct the naming path Signed-off-by: Ryan Liang --- .../app_analytics.spec.js | 0 .../datasources.spec.js | 0 .../event_analytics.spec.js | 0 .../integrations.spec.js | 0 .../metrics_analytics.spec.js | 0 .../notebooks.spec.js | 0 .../panels.spec.ts | 0 .../trace_analytics_dashboard.spec.js | 0 .../trace_analytics_services.spec.js | 0 .../trace_analytics_traces.spec.js | 0 .../workflows/integration-tests-workflow.yml | 21 +++++++++---------- 11 files changed, 10 insertions(+), 11 deletions(-) rename .cypress/integration/{app_analytics_tests => app_analytics_test}/app_analytics.spec.js (100%) rename .cypress/integration/{datasources_tests => datasources_test}/datasources.spec.js (100%) rename .cypress/integration/{event_analytics_tests => event_analytics_test}/event_analytics.spec.js (100%) rename .cypress/integration/{integrations_tests => integrations_test}/integrations.spec.js (100%) rename .cypress/integration/{metrics_analytics_tests => metrics_analytics_test}/metrics_analytics.spec.js (100%) rename .cypress/integration/{notebooks_tests => notebooks_test}/notebooks.spec.js (100%) rename .cypress/integration/{panels_tests => panels_test}/panels.spec.ts (100%) rename .cypress/integration/{trace_analytics_tests => trace_analytics_test}/trace_analytics_dashboard.spec.js (100%) rename .cypress/integration/{trace_analytics_tests => trace_analytics_test}/trace_analytics_services.spec.js (100%) rename .cypress/integration/{trace_analytics_tests => trace_analytics_test}/trace_analytics_traces.spec.js (100%) diff --git a/.cypress/integration/app_analytics_tests/app_analytics.spec.js b/.cypress/integration/app_analytics_test/app_analytics.spec.js similarity index 100% rename from .cypress/integration/app_analytics_tests/app_analytics.spec.js rename to .cypress/integration/app_analytics_test/app_analytics.spec.js diff --git a/.cypress/integration/datasources_tests/datasources.spec.js b/.cypress/integration/datasources_test/datasources.spec.js similarity index 100% rename from .cypress/integration/datasources_tests/datasources.spec.js rename to .cypress/integration/datasources_test/datasources.spec.js diff --git a/.cypress/integration/event_analytics_tests/event_analytics.spec.js b/.cypress/integration/event_analytics_test/event_analytics.spec.js similarity index 100% rename from .cypress/integration/event_analytics_tests/event_analytics.spec.js rename to .cypress/integration/event_analytics_test/event_analytics.spec.js diff --git a/.cypress/integration/integrations_tests/integrations.spec.js b/.cypress/integration/integrations_test/integrations.spec.js similarity index 100% rename from .cypress/integration/integrations_tests/integrations.spec.js rename to .cypress/integration/integrations_test/integrations.spec.js diff --git a/.cypress/integration/metrics_analytics_tests/metrics_analytics.spec.js b/.cypress/integration/metrics_analytics_test/metrics_analytics.spec.js similarity index 100% rename from .cypress/integration/metrics_analytics_tests/metrics_analytics.spec.js rename to .cypress/integration/metrics_analytics_test/metrics_analytics.spec.js diff --git a/.cypress/integration/notebooks_tests/notebooks.spec.js b/.cypress/integration/notebooks_test/notebooks.spec.js similarity index 100% rename from .cypress/integration/notebooks_tests/notebooks.spec.js rename to .cypress/integration/notebooks_test/notebooks.spec.js diff --git a/.cypress/integration/panels_tests/panels.spec.ts b/.cypress/integration/panels_test/panels.spec.ts similarity index 100% rename from .cypress/integration/panels_tests/panels.spec.ts rename to .cypress/integration/panels_test/panels.spec.ts diff --git a/.cypress/integration/trace_analytics_tests/trace_analytics_dashboard.spec.js b/.cypress/integration/trace_analytics_test/trace_analytics_dashboard.spec.js similarity index 100% rename from .cypress/integration/trace_analytics_tests/trace_analytics_dashboard.spec.js rename to .cypress/integration/trace_analytics_test/trace_analytics_dashboard.spec.js diff --git a/.cypress/integration/trace_analytics_tests/trace_analytics_services.spec.js b/.cypress/integration/trace_analytics_test/trace_analytics_services.spec.js similarity index 100% rename from .cypress/integration/trace_analytics_tests/trace_analytics_services.spec.js rename to .cypress/integration/trace_analytics_test/trace_analytics_services.spec.js diff --git a/.cypress/integration/trace_analytics_tests/trace_analytics_traces.spec.js b/.cypress/integration/trace_analytics_test/trace_analytics_traces.spec.js similarity index 100% rename from .cypress/integration/trace_analytics_tests/trace_analytics_traces.spec.js rename to .cypress/integration/trace_analytics_test/trace_analytics_traces.spec.js diff --git a/.github/workflows/integration-tests-workflow.yml b/.github/workflows/integration-tests-workflow.yml index 035f242f2..5eab13d0a 100644 --- a/.github/workflows/integration-tests-workflow.yml +++ b/.github/workflows/integration-tests-workflow.yml @@ -24,16 +24,15 @@ jobs: os: [ubuntu-latest] java: [11] testgroups: [ - 1_event_analytics.spec.js, - notebooks, - 3_panels.spec.ts, - 4_trace_analytics_dashboard.spec.js, - 5_trace_analytics_services.spec.js, - 6_trace_analytics_traces.spec.js, - 7_app_analytics.spec.js, - 8_metrics_analytics.spec.js, - 9_integrations.spec.js, - 10_datasources.spec.js + app_analytics_test, + notebook, + datasources_test, + event_analytics_test, + integrations_test, + metrics_analytics_test, + notebooks_test, + panels_test, + trace_analytics_test ] include: - os: ubuntu-latest @@ -161,7 +160,7 @@ jobs: run: | npm config delete script-shell - - name: Run Cypress tests + - name: Run Cypress tests for test gourp of ${{ matrix.testgroups }} run: | cd ./OpenSearch-Dashboards/plugins/dashboards-observability yarn cypress:run --browser chrome --headless --spec '.cypress/integration/${{ matrix.testgroups }}/*' From ab1046e3a75c23d1ed0c22030d406054aaae7c63 Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Fri, 8 Dec 2023 15:19:34 -0800 Subject: [PATCH 12/13] Fix the typo Signed-off-by: Ryan Liang --- .github/workflows/integration-tests-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests-workflow.yml b/.github/workflows/integration-tests-workflow.yml index 5eab13d0a..27c30da8c 100644 --- a/.github/workflows/integration-tests-workflow.yml +++ b/.github/workflows/integration-tests-workflow.yml @@ -160,7 +160,7 @@ jobs: run: | npm config delete script-shell - - name: Run Cypress tests for test gourp of ${{ matrix.testgroups }} + - name: Run Cypress tests for test group of ${{ matrix.testgroups }} run: | cd ./OpenSearch-Dashboards/plugins/dashboards-observability yarn cypress:run --browser chrome --headless --spec '.cypress/integration/${{ matrix.testgroups }}/*' From e6af95b0cee45dac691506de425e1eb904f2c2ed Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Fri, 8 Dec 2023 15:23:00 -0800 Subject: [PATCH 13/13] Fix the group naming Signed-off-by: Ryan Liang --- .github/workflows/integration-tests-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests-workflow.yml b/.github/workflows/integration-tests-workflow.yml index 27c30da8c..17ee358bf 100644 --- a/.github/workflows/integration-tests-workflow.yml +++ b/.github/workflows/integration-tests-workflow.yml @@ -25,7 +25,7 @@ jobs: java: [11] testgroups: [ app_analytics_test, - notebook, + notebooks_test, datasources_test, event_analytics_test, integrations_test,