-
Notifications
You must be signed in to change notification settings - Fork 946
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/hide-query-assist-for-unsupported-type
- Loading branch information
Showing
87 changed files
with
4,739 additions
and
1,691 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
feat: | ||
- Refactor the bulk_get handler in permission wrapper when item has permission error ([#8906](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8906)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
feat: | ||
- Add privacy levels to the workspace ([#8907](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8907)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fix: | ||
- DQL autocomplete better parsing and fixes ([#8931](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8931)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
feat: | ||
- Add two-steps loading for associating data sources ([#8999](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8999)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
refactor: | ||
- Update data source details tabs to use small buttons ([#9057](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9057)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
test: | ||
- Add tests for saving search and loading it ([#9112](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9112)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fix: | ||
- 0 rendered in discover when there are no results ([#9153](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9153)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
feat: | ||
- Support to dissociate data connection object since DSM list has supported to display ([#9164](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/9164)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
...-opensearch-dashboards/opensearch-dashboards/apps/query_enhancements/saved_search.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { | ||
INDEX_PATTERN_WITH_TIME, | ||
INDEX_WITH_TIME_1, | ||
INDEX_WITH_TIME_2, | ||
QueryLanguages, | ||
SECONDARY_ENGINE, | ||
} from '../../../../../utils/constants'; | ||
import { | ||
workspaceName, | ||
datasourceName, | ||
generateAllTestConfigurations, | ||
setDatePickerDatesAndSearchIfRelevant, | ||
setSearchConfigurations, | ||
verifyDiscoverPageState, | ||
verifySavedSearchInAssetsPage, | ||
postRequestSaveSearch, | ||
} from './utils/saved_search'; | ||
|
||
export const runSavedSearchTests = () => { | ||
describe('saved search', () => { | ||
beforeEach(() => { | ||
// Load test data | ||
cy.setupTestData( | ||
SECONDARY_ENGINE.url, | ||
[ | ||
`cypress/fixtures/query_enhancements/data-logs-1/${INDEX_WITH_TIME_1}.mapping.json`, | ||
`cypress/fixtures/query_enhancements/data-logs-2/${INDEX_WITH_TIME_2}.mapping.json`, | ||
], | ||
[ | ||
`cypress/fixtures/query_enhancements/data-logs-1/${INDEX_WITH_TIME_1}.data.ndjson`, | ||
`cypress/fixtures/query_enhancements/data-logs-2/${INDEX_WITH_TIME_2}.data.ndjson`, | ||
] | ||
); | ||
// Add data source | ||
cy.addDataSource({ | ||
name: datasourceName, | ||
url: SECONDARY_ENGINE.url, | ||
authType: 'no_auth', | ||
}); | ||
|
||
// Create workspace | ||
cy.deleteWorkspaceByName(workspaceName); | ||
cy.visit('/app/home'); | ||
cy.createInitialWorkspaceWithDataSource(datasourceName, workspaceName); | ||
cy.createWorkspaceIndexPatterns({ | ||
workspaceName: workspaceName, | ||
indexPattern: INDEX_PATTERN_WITH_TIME.replace('*', ''), | ||
timefieldName: 'timestamp', | ||
dataSource: datasourceName, | ||
isEnhancement: true, | ||
}); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.deleteWorkspaceByName(workspaceName); | ||
// // TODO: Modify deleteIndex to handle an array of index and remove hard code | ||
cy.deleteDataSourceByName(datasourceName); | ||
cy.deleteIndex(INDEX_WITH_TIME_1); | ||
cy.deleteIndex(INDEX_WITH_TIME_2); | ||
}); | ||
|
||
generateAllTestConfigurations().forEach((config) => { | ||
it(`should successfully create a saved search for ${config.testName}`, () => { | ||
cy.navigateToWorkSpaceSpecificPage({ | ||
workspaceName, | ||
page: 'discover', | ||
isEnhancement: true, | ||
}); | ||
|
||
cy.setDataset(config.dataset, datasourceName, config.datasetType); | ||
|
||
cy.setQueryLanguage(config.language); | ||
setDatePickerDatesAndSearchIfRelevant(config.language); | ||
|
||
setSearchConfigurations(config); | ||
verifyDiscoverPageState(config); | ||
cy.saveSearch(config.saveName); | ||
|
||
// There is a small chance where if we go to assets page, | ||
// the saved search does not appear. So adding this wait | ||
cy.wait(2000); | ||
|
||
verifySavedSearchInAssetsPage(config); | ||
}); | ||
|
||
// We are starting from various languages | ||
// to guard against: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/9078 | ||
Object.values(QueryLanguages) | ||
.map((queryLanguage) => queryLanguage.name) | ||
.forEach((startingLanguage) => { | ||
// TODO: Remove this line once bugs are fixed | ||
// https://github.com/opensearch-project/OpenSearch-Dashboards/issues/9078 | ||
if (startingLanguage !== config.language) return; | ||
|
||
it(`should successfully load a saved search for ${config.testName} starting from ${startingLanguage}`, () => { | ||
postRequestSaveSearch(config); | ||
|
||
cy.navigateToWorkSpaceSpecificPage({ | ||
workspaceName, | ||
page: 'discover', | ||
isEnhancement: true, | ||
}); | ||
cy.getElementByTestId('discoverNewButton').click(); | ||
|
||
// Intentionally setting INDEX_PATTERN dataset here so that | ||
// we have access to all four languages that INDEX_PATTERN allows. | ||
// This means that we are only testing loading a saved search | ||
// starting from an INDEX_PATTERN dataset, but I think testing where the | ||
// start is a permutation of other dataset is overkill | ||
cy.setIndexPatternAsDataset(INDEX_PATTERN_WITH_TIME, datasourceName); | ||
|
||
cy.setQueryLanguage(startingLanguage); | ||
cy.loadSaveSearch(config.saveName, false); | ||
setDatePickerDatesAndSearchIfRelevant(config.language); | ||
verifyDiscoverPageState(config); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}; | ||
|
||
runSavedSearchTests(); |
Oops, something went wrong.