Skip to content

Commit 7618ab3

Browse files
[Tests] Set default tenancy to global for data explorer tests (#959) (#962)
Signed-off-by: manasvinibs <[email protected]> (cherry picked from commit e7647a1) Co-authored-by: Manasvini B Suryanarayana <[email protected]>
1 parent e4f67a1 commit 7618ab3

21 files changed

+47
-2
lines changed

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/aaa_before.spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6+
import { CURRENT_TENANT } from '../../../../../utils/commands';
7+
68
/// <reference types="cypress" />
79

810
describe('Before', () => {
911
before(() => {
12+
CURRENT_TENANT.newTenant = 'global';
1013
cy.deleteAllIndices();
1114
cy.deleteSavedObjectByType('index-pattern');
1215
});

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import {
77
TestFixtureHandler,
88
MiscUtils,
99
} from '@opensearch-dashboards-test/opensearch-dashboards-test-library';
10+
import { CURRENT_TENANT } from '../../../../../utils/commands';
11+
1012
const testFixtureHandler = new TestFixtureHandler(
1113
cy,
1214
Cypress.env('openSearchUrl')
@@ -18,6 +20,7 @@ describe('date_nanos', () => {
1820
const fromTime = 'Sep 21, 2019 @ 20:31:44.000';
1921
const toTime = 'Sep 23, 2019 @ 03:31:44.000';
2022
before(() => {
23+
CURRENT_TENANT.newTenant = 'global';
2124
// import date nanos
2225
testFixtureHandler.importJSONMapping(
2326
'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/date_nanos/mappings.json.txt'
@@ -29,7 +32,6 @@ describe('date_nanos', () => {
2932
cy.setAdvancedSetting({
3033
defaultIndex: 'date-nanos',
3134
});
32-
3335
miscUtils.visitPage('app/data-explorer/discover#/');
3436
cy.waitForLoader();
3537

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos_mixed.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
TestFixtureHandler,
88
MiscUtils,
99
} from '@opensearch-dashboards-test/opensearch-dashboards-test-library';
10+
import { CURRENT_TENANT } from '../../../../../utils/commands';
1011

1112
const miscUtils = new MiscUtils(cy);
1213
const testFixtureHandler = new TestFixtureHandler(
@@ -16,6 +17,7 @@ const testFixtureHandler = new TestFixtureHandler(
1617

1718
describe('date_nanos_mixed', () => {
1819
before(() => {
20+
CURRENT_TENANT.newTenant = 'global';
1921
//import date nanos
2022
testFixtureHandler.importJSONMapping(
2123
'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/date_nanos_mix/mappings.json.txt'
@@ -27,7 +29,6 @@ describe('date_nanos_mixed', () => {
2729
cy.setAdvancedSetting({
2830
defaultIndex: 'timestamp-*',
2931
});
30-
3132
miscUtils.visitPage('app/data-explorer/discover#/');
3233
cy.waitForLoader();
3334

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
DE_DEFAULT_END_TIME,
1212
DE_DEFAULT_START_TIME,
1313
} from '../../../../../utils/constants';
14+
import { CURRENT_TENANT } from '../../../../../utils/commands';
1415

1516
const miscUtils = new MiscUtils(cy);
1617
const testFixtureHandler = new TestFixtureHandler(
@@ -25,6 +26,7 @@ const indexSet = [
2526

2627
describe('discover app', { scrollBehavior: false }, () => {
2728
before(() => {
29+
CURRENT_TENANT.newTenant = 'global';
2830
// import logstash functional
2931
testFixtureHandler.importJSONDocIfNeeded(
3032
indexSet,

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_histogram.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
TestFixtureHandler,
88
MiscUtils,
99
} from '@opensearch-dashboards-test/opensearch-dashboards-test-library';
10+
import { CURRENT_TENANT } from '../../../../../utils/commands';
1011

1112
const miscUtils = new MiscUtils(cy);
1213
const testFixtureHandler = new TestFixtureHandler(
@@ -21,6 +22,7 @@ const indexSet = [
2122

2223
describe('discover histogram', { scrollBehavior: false }, () => {
2324
before(() => {
25+
CURRENT_TENANT.newTenant = 'global';
2426
cy.log('load opensearch-dashboards index with default index pattern');
2527

2628
// import long window logstash index pattern

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/doc_navigation.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
MiscUtils,
88
TestFixtureHandler,
99
} from '@opensearch-dashboards-test/opensearch-dashboards-test-library';
10+
import { CURRENT_TENANT } from '../../../../../utils/commands';
1011

1112
const miscUtils = new MiscUtils(cy);
1213
const testFixtureHandler = new TestFixtureHandler(
@@ -21,6 +22,7 @@ const indexSet = [
2122

2223
describe('doc link in discover', () => {
2324
beforeEach(() => {
25+
CURRENT_TENANT.newTenant = 'global';
2426
// import logstash functional
2527
testFixtureHandler.importJSONDocIfNeeded(
2628
indexSet,

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/doc_table.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
MiscUtils,
88
TestFixtureHandler,
99
} from '@opensearch-dashboards-test/opensearch-dashboards-test-library';
10+
import { CURRENT_TENANT } from '../../../../../utils/commands';
1011

1112
const miscUtils = new MiscUtils(cy);
1213
const testFixtureHandler = new TestFixtureHandler(
@@ -21,6 +22,7 @@ const indexSet = [
2122

2223
describe('discover doc table', () => {
2324
before(() => {
25+
CURRENT_TENANT.newTenant = 'global';
2426
// import logstash functional
2527
testFixtureHandler.importJSONDocIfNeeded(
2628
indexSet,

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/errors.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
DE_DEFAULT_END_TIME,
1212
DE_DEFAULT_START_TIME,
1313
} from '../../../../../utils/constants';
14+
import { CURRENT_TENANT } from '../../../../../utils/commands';
1415

1516
const miscUtils = new MiscUtils(cy);
1617
const testFixtureHandler = new TestFixtureHandler(
@@ -20,6 +21,7 @@ const testFixtureHandler = new TestFixtureHandler(
2021

2122
describe('errors', () => {
2223
before(() => {
24+
CURRENT_TENANT.newTenant = 'global';
2325
// import invalid_scripted_field
2426
testFixtureHandler.importJSONMapping(
2527
'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/invalid_scripted_field/mappings.json.txt'

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/field_data.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
TestFixtureHandler,
88
MiscUtils,
99
} from '@opensearch-dashboards-test/opensearch-dashboards-test-library';
10+
import { CURRENT_TENANT } from '../../../../../utils/commands';
1011

1112
const miscUtils = new MiscUtils(cy);
1213
const testFixtureHandler = new TestFixtureHandler(
@@ -21,6 +22,7 @@ const indexSet = [
2122

2223
describe('discover tab', () => {
2324
before(() => {
25+
CURRENT_TENANT.newTenant = 'global';
2426
// import logstash functional
2527
testFixtureHandler.importJSONDocIfNeeded(
2628
indexSet,

cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/field_visualize.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
MiscUtils,
88
TestFixtureHandler,
99
} from '@opensearch-dashboards-test/opensearch-dashboards-test-library';
10+
import { CURRENT_TENANT } from '../../../../../utils/commands';
1011

1112
const miscUtils = new MiscUtils(cy);
1213
const testFixtureHandler = new TestFixtureHandler(
@@ -21,6 +22,7 @@ const indexSet = [
2122

2223
describe('discover field visualize button', () => {
2324
before(() => {
25+
CURRENT_TENANT.newTenant = 'global';
2426
testFixtureHandler.importJSONMapping(
2527
'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/discover/discover.mappings.json.txt'
2628
);

0 commit comments

Comments
 (0)