From aaab6f337496ca17283c0500d1920cefc4765db3 Mon Sep 17 00:00:00 2001 From: Kawika Avilla Date: Fri, 3 Jun 2022 09:11:13 -0700 Subject: [PATCH] [Improvement] fix issue with tenancy and test finder (#236) Incorrectly merged the verification where I check if option to wait for switching of tenant worked. Switched it back to the expected scenario if the test passed the command it will wait. Also, the test finder for manifest was missing the manifest path so added that while also ensuring the minify OSD tests weren't ran when verifying the distribution because those will fail as expected. Issue: n/a Signed-off-by: Kawika Avilla (cherry picked from commit e355149c90dc1752ff2bbdebd6cc52e9c4b5840d) --- .../integration/plugins/reports-dashboards/01-create.spec.js | 4 +++- .../integration/plugins/reports-dashboards/02-edit.spec.js | 4 +++- cypress/utils/commands.js | 2 +- cypress/utils/plugins/reports-dashboards/constants.js | 4 +++- test_finder.sh | 4 ++-- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/cypress/integration/plugins/reports-dashboards/01-create.spec.js b/cypress/integration/plugins/reports-dashboards/01-create.spec.js index 1bd8d1187..80476154d 100644 --- a/cypress/integration/plugins/reports-dashboards/01-create.spec.js +++ b/cypress/integration/plugins/reports-dashboards/01-create.spec.js @@ -215,7 +215,9 @@ describe('Cypress', () => { }); function visitCreateReportDefinitionPage() { - cy.visit(`${BASE_PATH}/app/reports-dashboards#/`); + cy.visit(`${BASE_PATH}/app/reports-dashboards#/`, { + waitForGetTenant: true, + }); cy.location('pathname', { timeout: 60000 }).should( 'include', '/reports-dashboards' diff --git a/cypress/integration/plugins/reports-dashboards/02-edit.spec.js b/cypress/integration/plugins/reports-dashboards/02-edit.spec.js index 89864cc2b..ec3fe0804 100644 --- a/cypress/integration/plugins/reports-dashboards/02-edit.spec.js +++ b/cypress/integration/plugins/reports-dashboards/02-edit.spec.js @@ -7,7 +7,9 @@ import { BASE_PATH } from '../../../utils/constants'; describe('Cypress', () => { it('Visit edit page, update name and description', () => { - cy.visit(`${BASE_PATH}/app/reports-dashboards#/`); + cy.visit(`${BASE_PATH}/app/reports-dashboards#/`, { + waitForGetTenant: true, + }); cy.location('pathname', { timeout: 60000 }).should( 'include', '/reports-dashboards' diff --git a/cypress/utils/commands.js b/cypress/utils/commands.js index 89ec3c478..b5b41d9f1 100644 --- a/cypress/utils/commands.js +++ b/cypress/utils/commands.js @@ -32,7 +32,7 @@ Cypress.Commands.overwrite('visit', (orig, url, options) => { }; } newOptions.qs = { security_tenant: 'private' }; - if (!waitForGetTenant) { + if (waitForGetTenant) { cy.intercept('GET', '/api/v1/multitenancy/tenant').as('getTenant'); orig(url, newOptions); supressNoRequestOccurred(); diff --git a/cypress/utils/plugins/reports-dashboards/constants.js b/cypress/utils/plugins/reports-dashboards/constants.js index 86f05b05a..8ec10266e 100644 --- a/cypress/utils/plugins/reports-dashboards/constants.js +++ b/cypress/utils/plugins/reports-dashboards/constants.js @@ -6,7 +6,9 @@ import { BASE_PATH } from '../../../utils/constants'; export function visitReportingLandingPage() { - cy.visit(`${BASE_PATH}/app/reports-dashboards#/`); + cy.visit(`${BASE_PATH}/app/reports-dashboards#/`, { + waitForGetTenant: true, + }); cy.location('pathname', { timeout: 60000 }).should( 'include', '/reports-dashboards' diff --git a/test_finder.sh b/test_finder.sh index 651c1fa8c..c1ce35bb7 100755 --- a/test_finder.sh +++ b/test_finder.sh @@ -3,7 +3,7 @@ set -e OSD_BUILD_MANIFEST='../local-test-cluster/opensearch-dashboards-*/manifest.yml' -OSD_TEST_PATH='cypress/integration/core-opensearch-dashboards' +OSD_TEST_PATH='cypress/integration/core-opensearch-dashboards/opensearch-dashboards' OSD_PLUGIN_TEST_PATH='cypress/integration/plugins' # Map component name in opensearch-build repo INPUT_MANIFEST with folder name for tests in functional repo @@ -63,7 +63,7 @@ function get_test_list() { fi elif [ "$TEST_TYPE" = "manifest" ]; then - if grep -q $component_name; then + if grep -q $component_name $OSD_BUILD_MANIFEST; then TEST_FILES_LOCAL+="$TEST_PATH_LOCAL/$test_folder/$TEST_FILES_EXT_LOCAL," fi fi