Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TEST] add more osd namespacing #9358

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1c68dd4
add more osd namespacing
angle943 Feb 8, 2025
34a25e1
Merge branch 'main' into more-osd-namespacing
angle943 Feb 8, 2025
41ecc41
fix imports
angle943 Feb 8, 2025
fa36370
fix some flakiness in neo
angle943 Feb 8, 2025
9a38abf
add back in workspace_plugin commands
angle943 Feb 10, 2025
af265c2
Merge branch 'main' into more-osd-namespacing
ananzh Feb 10, 2025
520e19c
couple more changes
angle943 Feb 11, 2025
25d3a6e
Merge branch 'main' into more-osd-namespacing
angle943 Feb 11, 2025
762741f
couple more changes
angle943 Feb 12, 2025
2d619a2
Merge branch 'main' into more-osd-namespacing
angle943 Feb 12, 2025
3858d1b
fix some namespace issue when rebasing to include caching.spec.js
angle943 Feb 12, 2025
63f6921
adding more changes
angle943 Feb 12, 2025
00db6f7
adding more changes
angle943 Feb 13, 2025
3ad025e
more change
angle943 Feb 13, 2025
2bb9ba6
more changes
angle943 Feb 13, 2025
caa0410
Merge branch 'main' into more-osd-namespacing
angle943 Feb 14, 2025
be314d2
more changes
angle943 Feb 14, 2025
0fd5419
more changes
angle943 Feb 14, 2025
8007094
more changes
angle943 Feb 14, 2025
0899297
more changes
angle943 Feb 14, 2025
465e64b
more changes
angle943 Feb 14, 2025
aa32f01
more changes and try adding retries
angle943 Feb 14, 2025
2d9929a
more changes
angle943 Feb 14, 2025
10187a9
Merge branch 'main' into more-osd-namespacing
angle943 Feb 14, 2025
cc95d70
more changes
angle943 Feb 14, 2025
6cdb2a2
more changes
angle943 Feb 14, 2025
729f07e
more changes
angle943 Feb 15, 2025
8b50d41
Merge branch 'main' into more-osd-namespacing
angle943 Feb 15, 2025
2d83c3a
more changes
angle943 Feb 15, 2025
72e9b32
more changes
angle943 Feb 15, 2025
7c78f9a
Merge branch 'main' into more-osd-namespacing
angle943 Feb 17, 2025
2603b08
more changes
angle943 Feb 17, 2025
7d57fe0
Merge branch 'main' into more-osd-namespacing
angle943 Feb 17, 2025
aa69290
more changes
angle943 Feb 17, 2025
632e891
more changes
angle943 Feb 18, 2025
687cb54
more changes
angle943 Feb 18, 2025
fe5f34c
more changes
angle943 Feb 18, 2025
b421bdf
Merge branch 'main' into more-osd-namespacing
angle943 Feb 18, 2025
3f03b33
more changes
angle943 Feb 19, 2025
60a90f8
more changes
angle943 Feb 19, 2025
8a9b164
Merge branch 'main' into more-osd-namespacing
angle943 Feb 19, 2025
b63e3d9
Merge branch 'main' into more-osd-namespacing
angle943 Feb 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ import webpackPreprocessor from '@cypress/webpack-preprocessor';
// TODO: import { paste } from 'copy-paste';

module.exports = defineConfig({
defaultCommandTimeout: 60000,
experimentalMemoryManagement: true,
defaultCommandTimeout: 15000,
requestTimeout: 60000,
responseTimeout: 60000,
retries: {
runMode: 2,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does retry work, can you explain some?

openMode: 0,
},
viewportWidth: 2000,
viewportHeight: 1320,
env: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { DATASOURCE_NAME, PATHS, INDEX_WITH_TIME_1 } from '../../../../../utils/constants';
import { getRandomizedWorkspaceName } from '../../../../../utils/apps/query_enhancements/shared';
import { prepareTestSuite } from '../../../../../utils/helpers';
import { DATASOURCE_NAME, PATHS, INDEX_WITH_TIME_1 } from '../../../../../../utils/constants';
import { getRandomizedWorkspaceName } from '../../../../../../utils/apps/query_enhancements/shared';
import { prepareTestSuite } from '../../../../../../utils/helpers';

const workspaceName = getRandomizedWorkspaceName();

Expand All @@ -25,7 +25,8 @@ const noIndexPatternTestSuite = () => {
authType: 'no_auth',
});
// Create workspace
cy.deleteAllWorkspaces();
cy.deleteWorkspaceByName(workspaceName);
cy.osd.deleteAllOldWorkspaces();
cy.visit('/app/home');
cy.osd.createInitialWorkspaceWithDataSource(DATASOURCE_NAME, workspaceName);
cy.wait(2000);
Expand All @@ -40,12 +41,12 @@ const noIndexPatternTestSuite = () => {
describe('empty state', () => {
it('no index pattern', function () {
// Go to the Discover page
cy.navigateToWorkSpaceSpecificPage({
cy.osd.navigateToWorkSpaceSpecificPage({
workspaceName: workspaceName,
page: 'discover',
isEnhancement: true,
});
cy.waitForLoader(true);
cy.osd.waitForLoader(true);
cy.getElementByTestId('discoverNoIndexPatterns').should('be.visible');
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
DATASOURCE_NAME,
START_TIME,
END_TIME,
} from '../../../../../utils/apps/constants';
import { PATHS } from '../../../../../utils/constants';
import { getRandomizedWorkspaceName } from '../../../../../utils/apps/query_enhancements/shared';
import { prepareTestSuite } from '../../../../../utils/helpers';
} from '../../../../../../utils/apps/constants';
import { PATHS } from '../../../../../../utils/constants';
import { getRandomizedWorkspaceName } from '../../../../../../utils/apps/query_enhancements/shared';
import { prepareTestSuite } from '../../../../../../utils/helpers';

const workspace = getRandomizedWorkspaceName();

Expand All @@ -31,7 +31,8 @@ const queriesTestSuite = () => {
authType: 'no_auth',
});
// Create workspace and set up index pattern
cy.deleteAllWorkspaces();
cy.deleteWorkspaceByName(workspace);
cy.osd.deleteAllOldWorkspaces();
cy.visit('/app/home');
cy.osd.createInitialWorkspaceWithDataSource(DATASOURCE_NAME, workspace);
// Create and select index pattern for ${INDEX_WITH_TIME_1}*
Expand All @@ -44,7 +45,7 @@ const queriesTestSuite = () => {
isEnhancement: true,
});
// Go to discover page
cy.navigateToWorkSpaceSpecificPage({
cy.osd.navigateToWorkSpaceSpecificPage({
workspaceName: workspace,
page: 'discover',
isEnhancement: true,
Expand All @@ -64,7 +65,7 @@ const queriesTestSuite = () => {

const query = `_id:N9srQ8opwBxGdIoQU3TW`;
cy.setQueryEditor(query);
cy.waitForLoader(true);
cy.osd.waitForLoader(true);
cy.waitForSearch();
cy.verifyHitCount(1);

Expand All @@ -79,7 +80,7 @@ const queriesTestSuite = () => {

const query = `_id:N9srQ8opwBxGdIoQU3TW`;
cy.setQueryEditor(query);
cy.waitForLoader(true);
cy.osd.waitForLoader(true);
cy.waitForSearch();
cy.verifyHitCount(1);

Expand All @@ -92,7 +93,7 @@ const queriesTestSuite = () => {
cy.setQueryLanguage('OpenSearch SQL');

// Default SQL query should be set
cy.waitForLoader(true);
cy.osd.waitForLoader(true);
cy.getElementByTestId(`osdQueryEditor__multiLine`).contains(
`SELECT * FROM ${INDEX_WITH_TIME_1}* LIMIT 10`
);
Expand Down Expand Up @@ -123,7 +124,7 @@ const queriesTestSuite = () => {
cy.setTopNavDate(START_TIME, END_TIME);

// Default PPL query should be set
cy.waitForLoader(true);
cy.osd.waitForLoader(true);
cy.getElementByTestId(`osdQueryEditor__multiLine`).contains(
`source = ${INDEX_WITH_TIME_1}*`
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ import {
QueryLanguages,
PATHS,
DATASOURCE_NAME,
} from '../../../../../utils/constants';
} from '../../../../../../utils/constants';
import {
generateAllTestConfigurations,
getRandomizedWorkspaceName,
setDatePickerDatesAndSearchIfRelevant,
} from '../../../../../utils/apps/query_enhancements/shared';
} from '../../../../../../utils/apps/query_enhancements/shared';
import {
setSearchConfigurations,
verifyDiscoverPageState,
verifySavedSearchInAssetsPage,
postRequestSaveSearch,
updateSavedSearchAndSaveAndVerify,
generateSavedTestConfiguration,
} from '../../../../../utils/apps/query_enhancements/saved';
import { prepareTestSuite } from '../../../../../utils/helpers';
} from '../../../../../../utils/apps/query_enhancements/saved';
import { prepareTestSuite } from '../../../../../../utils/helpers';

const workspaceName = getRandomizedWorkspaceName();

Expand All @@ -50,7 +50,8 @@ const runSavedSearchTests = () => {
authType: 'no_auth',
});
// Create workspace
cy.deleteAllWorkspaces();
cy.deleteWorkspaceByName(workspaceName);
cy.osd.deleteAllOldWorkspaces();
cy.visit('/app/home');
cy.osd.createInitialWorkspaceWithDataSource(DATASOURCE_NAME, workspaceName);
cy.createWorkspaceIndexPatterns({
Expand All @@ -60,6 +61,7 @@ const runSavedSearchTests = () => {
dataSource: DATASOURCE_NAME,
isEnhancement: true,
});
cy.osd.grabDataSourceId(workspaceName, DATASOURCE_NAME);
});

afterEach(() => {
Expand All @@ -71,7 +73,7 @@ const runSavedSearchTests = () => {

generateAllTestConfigurations(generateSavedTestConfiguration).forEach((config) => {
it(`should successfully create a saved search for ${config.testName}`, () => {
cy.navigateToWorkSpaceSpecificPage({
cy.osd.navigateToWorkSpaceSpecificPage({
workspaceName,
page: 'discover',
isEnhancement: true,
Expand Down Expand Up @@ -106,7 +108,7 @@ const runSavedSearchTests = () => {
// using a POST request to create a saved search to load
postRequestSaveSearch(config);

cy.navigateToWorkSpaceSpecificPage({
cy.osd.navigateToWorkSpaceSpecificPage({
workspaceName,
page: 'discover',
isEnhancement: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ import {
INDEX_WITHOUT_TIME_1,
PATHS,
DATASOURCE_NAME,
} from '../../../../../utils/constants';
} from '../../../../../../utils/constants';
import {
getRandomizedWorkspaceName,
getDefaultQuery,
setDatePickerDatesAndSearchIfRelevant,
} from '../../../../../utils/apps/query_enhancements/shared';
import { verifyDiscoverPageState } from '../../../../../utils/apps/query_enhancements/saved';
} from '../../../../../../utils/apps/query_enhancements/shared';
import { verifyDiscoverPageState } from '../../../../../../utils/apps/query_enhancements/saved';
import {
generateSimpleDatasetSelectorTestConfigurations,
validateItemsInSimpleDatasetSelectorDropDown,
} from '../../../../../utils/apps/query_enhancements/simple_dataset_selector';
import { prepareTestSuite } from '../../../../../utils/helpers';
} from '../../../../../../utils/apps/query_enhancements/simple_dataset_selector';
import { prepareTestSuite } from '../../../../../../utils/helpers';

const workspaceName = getRandomizedWorkspaceName();
const noIndexPatterns = 5; // Determines the no of index patterns that should be in the dropdown for filtering test case
Expand All @@ -48,7 +48,8 @@ export const runSimpleDatasetSelectorTests = () => {
authType: 'no_auth',
});
// Create workspace
cy.deleteAllWorkspaces();
cy.deleteWorkspaceByName(workspaceName);
cy.osd.deleteAllOldWorkspaces();
cy.visit('/app/home');
cy.osd.createInitialWorkspaceWithDataSource(DATASOURCE_NAME, workspaceName);
cy.createWorkspaceIndexPatterns({
Expand Down Expand Up @@ -90,7 +91,7 @@ export const runSimpleDatasetSelectorTests = () => {
} Indexpattern when original language was ${
config.language
} from the simple dataset selector`, () => {
cy.navigateToWorkSpaceSpecificPage({
cy.osd.navigateToWorkSpaceSpecificPage({
workspaceName,
page: 'discover',
isEnhancement: true,
Expand Down Expand Up @@ -169,7 +170,7 @@ export const runSimpleDatasetSelectorTests = () => {
});

it('validate filtering index pattern in simple dataset selector', () => {
cy.navigateToWorkSpaceSpecificPage({
cy.osd.navigateToWorkSpaceSpecificPage({
workspaceName,
page: 'discover',
isEnhancement: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ import {
INDEX_WITH_TIME_2,
PATHS,
DatasetTypes,
} from '../../../../../utils/constants';
} from '../../../../../../utils/constants';

import {
generateAllTestConfigurations,
getRandomizedWorkspaceName,
setDatePickerDatesAndSearchIfRelevant,
getDefaultQuery,
} from '../../../../../utils/apps/query_enhancements/shared';
} from '../../../../../../utils/apps/query_enhancements/shared';

import { verifyDiscoverPageState } from '../../../../../utils/apps/query_enhancements/saved';
import { verifyDiscoverPageState } from '../../../../../../utils/apps/query_enhancements/saved';

import {
generateDatasetSelectorTestConfiguration,
verifyBaseState,
setUpBaseState,
} from '../../../../../utils/apps/query_enhancements/dataset_selector';
import { prepareTestSuite } from '../../../../../utils/helpers';
} from '../../../../../../utils/apps/query_enhancements/dataset_selector';
import { prepareTestSuite } from '../../../../../../utils/helpers';

const workspaceName = getRandomizedWorkspaceName();

Expand All @@ -52,7 +52,8 @@ export const runDatasetSelectorTests = () => {
authType: 'no_auth',
});
// Create workspace
cy.deleteAllWorkspaces();
cy.deleteWorkspaceByName(workspaceName);
cy.osd.deleteAllOldWorkspaces();
cy.visit('/app/home');
cy.osd.createInitialWorkspaceWithDataSource(DATASOURCE_NAME, workspaceName);
cy.createWorkspaceIndexPatterns({
Expand All @@ -73,7 +74,7 @@ export const runDatasetSelectorTests = () => {

generateAllTestConfigurations(generateDatasetSelectorTestConfiguration).forEach((config) => {
it(`should be able to select and load ${config.testName} dataset-language combination using advanced dataset selector`, () => {
cy.navigateToWorkSpaceSpecificPage({
cy.osd.navigateToWorkSpaceSpecificPage({
workspaceName,
page: 'discover',
isEnhancement: true,
Expand All @@ -98,7 +99,7 @@ export const runDatasetSelectorTests = () => {
});

it(`select the ${config.testName} dataset-language combination and cancelling the workflow restores the original state`, () => {
cy.navigateToWorkSpaceSpecificPage({
cy.osd.navigateToWorkSpaceSpecificPage({
workspaceName,
page: 'discover',
isEnhancement: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ import {
INDEX_WITH_TIME_1,
INDEX_WITH_TIME_2,
QueryLanguages,
SECONDARY_ENGINE,
} from '../../../../../utils/constants';
PATHS,
} from '../../../../../../utils/constants';
import {
generateAllTestConfigurations,
getRandomizedWorkspaceName,
setDatePickerDatesAndSearchIfRelevant,
} from '../../../../../utils/apps/query_enhancements/shared';
} from '../../../../../../utils/apps/query_enhancements/shared';
import {
generateDisplayTestConfiguration,
getLanguageReferenceTestText,
} from '../../../../../utils/apps/query_enhancements/language_specific_display';
import { prepareTestSuite } from '../../../../../utils/helpers';
} from '../../../../../../utils/apps/query_enhancements/language_specific_display';
import { prepareTestSuite } from '../../../../../../utils/helpers';

const workspaceName = getRandomizedWorkspaceName();

Expand All @@ -29,7 +29,7 @@ export const runDisplayTests = () => {
beforeEach(() => {
// Load test data
cy.osd.setupTestData(
SECONDARY_ENGINE.url,
PATHS.SECONDARY_ENGINE,
[
`cypress/fixtures/query_enhancements/data_logs_1/${INDEX_WITH_TIME_1}.mapping.json`,
`cypress/fixtures/query_enhancements/data_logs_1/${INDEX_WITH_TIME_2}.mapping.json`,
Expand All @@ -42,12 +42,13 @@ export const runDisplayTests = () => {
// Add data source
cy.osd.addDataSource({
name: DATASOURCE_NAME,
url: SECONDARY_ENGINE.url,
url: PATHS.SECONDARY_ENGINE,
authType: 'no_auth',
});

// Create workspace
cy.deleteAllWorkspaces();
cy.deleteWorkspaceByName(workspaceName);
cy.osd.deleteAllOldWorkspaces();
cy.visit('/app/home');
cy.osd.createInitialWorkspaceWithDataSource(DATASOURCE_NAME, workspaceName);
cy.createWorkspaceIndexPatterns({
Expand All @@ -68,7 +69,7 @@ export const runDisplayTests = () => {

generateAllTestConfigurations(generateDisplayTestConfiguration).forEach((config) => {
it(`should correctly display all UI components for ${config.testName}`, () => {
cy.navigateToWorkSpaceSpecificPage({
cy.osd.navigateToWorkSpaceSpecificPage({
workspaceName,
page: 'discover',
isEnhancement: true,
Expand All @@ -77,6 +78,7 @@ export const runDisplayTests = () => {
cy.setDataset(config.dataset, DATASOURCE_NAME, config.datasetType);

cy.setQueryLanguage(config.language);

setDatePickerDatesAndSearchIfRelevant(config.language);

// testing the query editor
Expand Down
Loading
Loading