Skip to content

Commit

Permalink
[Improvement] fix issue with tenancy and test finder (#236)
Browse files Browse the repository at this point in the history
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 <kavilla414@gmail.com>
(cherry picked from commit e355149)
  • Loading branch information
kavilla authored and github-actions[bot] committed Jun 3, 2022
1 parent e1904dc commit aaab6f3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion cypress/utils/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 3 additions & 1 deletion cypress/utils/plugins/reports-dashboards/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions test_finder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit aaab6f3

Please sign in to comment.