Skip to content

Commit

Permalink
Merge branch 'main' into backport/backport-1399-to-main
Browse files Browse the repository at this point in the history
  • Loading branch information
SuZhou-Joe authored Aug 5, 2024
2 parents 85bae28 + fd249b9 commit 2202791
Show file tree
Hide file tree
Showing 48 changed files with 794 additions and 821 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* -text
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @tianleh @kavilla @ohltyler @CCongWang @ashwin-pc @peterzhuamazon @ananzh @prudhvigodithi @xluo-aws @Hailong-am @SuZhou-Joe @ruanyl @wanglam @raintygao @zhongnansu
* @tianleh @kavilla @ohltyler @CCongWang @ashwin-pc @peterzhuamazon @ananzh @prudhvigodithi @xluo-aws @Hailong-am @SuZhou-Joe @ruanyl @wanglam @raintygao @zhongnansu @yujin-emma
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,14 @@ jobs:
name: Get specs array
run: |
cd spec-detect
source ./test_finder.sh
result="["
## split CI_Groups into array
IFS="," read -a groups <<< "${{ env.CI_GROUPS }}"
for group in "${groups[@]}"; do
item="{\"ciGroup\": \"${group}\", \"specs\": "
IFS="," read -a SPEC_ARRAY <<< "$(npm run -s osd:ciGroup${group})"
FORMATTED_SPEC="\""
for i in "${SPEC_ARRAY[@]}"; do
FORMATTED_SPEC+="cypress/integration/core-opensearch-dashboards/opensearch-dashboards/${i},"
done
FORMATTED_SPEC+="\" }"
specs_of_ci_group=`ci_grouped_specs_finder ${group}`
FORMATTED_SPEC="\"${specs_of_ci_group}\" }"
if [[ "${result}" != "[" ]];
then
result+=","
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This document contains a list of maintainers in this repo. See [opensearch-proje
| Lin Wang | [wanglam](https://github.com/wanglam) | Amazon |
| Tianyu Gao | [raintygao](https://github.com/raintygao) | Amazon |
| Zhongnan Su | [zhongnansu](https://github.com/zhongnansu) | Amazon |
| Emma Jin | [yujin-emma](https://github.com/yujin-emma) | Amazon |

## Emeritus

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"total": 26,
"data": {
"test": {
"test-selection": {
"reserved": false,
"hidden": false,
"allowed_actions": ["data_access"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"total": 26,
"data": {
"test": {
"test-creation": {
"reserved": false,
"hidden": false,
"allowed_actions": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,78 +435,78 @@ describe('discover_advanced_setting', () => {
});
});

describe('modifyColumnsOnSwitch advanced setting', () => {
before(() => {
CURRENT_TENANT.newTenant = 'global';
cy.fleshTenantSettings();
cy.setAdvancedSetting({
'discover:modifyColumnsOnSwitch': false,
});
});

it.skip('check columns still available after switching data sources in legacy table', function () {
miscUtils.visitPage(
`app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))`
);
cy.waitForSearch();
cy.get('[data-test-subj="fieldToggle-agent"]').click();

// Now switching the data sources
cy.get('[data-test-subj="comboBoxSearchInput"]')
.type('nestedindex')
.then(() => {
cy.get('[title="nestedindex*"]')
.trigger('click')
.then(() => {
cy.wait(300);
cy.get('[data-test-subj="docTableHeader-agent"]').should(
'be.visible'
);
cy.get('[data-test-subj="docTableField"]')
.contains('-')
.should('exist');
});
});
after(() => {});
});

/*
*/
describe('modifyColumnsOnSwitch advanced setting', () => {
before(() => {
CURRENT_TENANT.newTenant = 'global';
cy.fleshTenantSettings();
cy.setAdvancedSetting({
'discover:modifyColumnsOnSwitch': false,
});
});

it('check columns still available after switching data sources in new table', function () {
miscUtils.visitPage(
`app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))`
);
cy.waitForSearch();
cy.switchDiscoverTable('new');

cy.get('[data-test-subj="fieldToggle-agent"]').click();
it.skip('check columns still available after switching data sources in legacy table', function () {
miscUtils.visitPage(
`app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))`
);
cy.waitForSearch();
cy.get('[data-test-subj="fieldToggle-agent"]').click();

// Now switching the data sources
cy.get('[data-test-subj="comboBoxSearchInput"]')
.type('nestedindex')
.then(() => {
cy.get('[title="nestedindex*"]')
.trigger('click')
.then(() => {
cy.wait(300);
cy.get('[data-test-subj="docTableHeader-agent"]').should(
'be.visible'
);
cy.get('[data-test-subj="docTableField"]')
.contains('-')
.should('exist');
});
});

// Now switching the data sources
cy.get('[data-test-subj="comboBoxSearchInput"]')
.type('nestedindex')
.then(() => {
cy.waitForSearch();
cy.get('[title="nestedindex*"]')
.trigger('click')
.then(() => {
cy.get('[data-test-subj="dataGridHeaderCell-agent"]').should(
'be.visible'
);
cy.get('[data-test-subj="dataGridRowCell"]')
.contains('-')
.should('exist');
});
});
});
/*
*/
});

after(() => {
cy.setAdvancedSetting({
'discover:modifyColumnsOnSwitch': true,
it('check columns still available after switching data sources in new table', function () {
miscUtils.visitPage(
`app/data-explorer/discover#/?_a=(discover:(metadata:(indexPattern:'logstash-*',view:discover))&_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))`
);
cy.waitForSearch();
cy.switchDiscoverTable('new');

cy.get('[data-test-subj="fieldToggle-agent"]').click();

// Now switching the data sources
cy.get('[data-test-subj="comboBoxSearchInput"]')
.type('nestedindex')
.then(() => {
cy.waitForSearch();
cy.get('[title="nestedindex*"]')
.trigger('click')
.then(() => {
cy.get('[data-test-subj="dataGridHeaderCell-agent"]').should(
'be.visible'
);
cy.wait(2000);
cy.get('[data-test-subj="dataGridRowCell"]')
.contains('-')
.should('exist');
});
});
});
});

after(() => {
cy.deleteIndexPattern('nestedindex');
cy.setAdvancedSetting({
'discover:modifyColumnsOnSwitch': true,
});
cy.deleteSavedObjectByType('index-pattern');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ describe('index pattern without field spec', () => {
testFixtureHandler.clearJSONMapping(
'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/index_pattern_without_timefield/mappings.json.txt'
);
cy.deleteSavedObjectByType('index-pattern');
});

it('should not display a timepicker', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,36 +104,50 @@ describe('table visualization in embedded mode', () => {

it('Should allow to filter in embedded mode', () => {
commonUI.addFilterRangeRetrySelection('age', 'is between', '10', '30');
cy.wait(2000);
cy.reload();
cy.wait(2000);
cy.tbGetTableDataFromVisualization().then((data) => {
expect(data).to.deep.eq(['0', '1,059', '20', '1,114']);
});
commonUI.removeFilter('age');
cy.wait(2000);
cy.reload();
cy.wait(2000);
cy.tbGetTableDataFromVisualization().then((data) => {
expect(data).to.deep.eq(expectedData);
});
});

it('Should filter for value in embedded mode', () => {
cy.tbClickTableCellAction(2, 0, 0, 'filter for', 0, true);
cy.wait(2000);
cy.reload();
cy.wait(2000);
cy.tbGetTableDataFromVisualization().then((data) => {
expect(data).to.deep.eq(['0', '1,059']);
});
commonUI.removeFilter('age');
cy.wait(2000);
cy.reload();
cy.wait(2000);
cy.tbGetTableDataFromVisualization().then((data) => {
expect(data).to.deep.eq(expectedData);
});
cy.wait(2000);
cy.tbClickTableCellAction(2, 0, 0, 'expand', 0, true);
cy.wait(2000);
cy.tbClickFilterFromExpand('filter for');
cy.wait(2000);
cy.reload();
cy.wait(2000);
cy.tbGetTableDataFromVisualization().then((data) => {
expect(data).to.deep.eq(['0', '1,059']);
});
commonUI.removeFilter('age');
cy.wait(2000);
cy.reload();
cy.wait(2000);
cy.tbGetTableDataFromVisualization().then((data) => {
expect(data).to.deep.eq(expectedData);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
after(() => {
// Clean up after all test are run
cy.deleteAllDataSources();
// remove the default data source
cy.setAdvancedSetting({
defaultDataSource: '',
});
});

it('should successfully load the page', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
after(() => {
// Clean up after all test are run
cy.deleteAllDataSources();
// clear cache
cy.clearCache();
// remove the default data source
cy.setAdvancedSetting({
defaultDataSource: '',
});
});

it('should successfully load the page', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
after(() => {
// Clean up after all test are run
cy.deleteAllDataSources();
// remove the default data source
cy.setAdvancedSetting({
defaultDataSource: '',
});
});

it('should successfully load the listing page & have 2 records in table', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
});
after(() => {
// Clean up after all test are run
cy.deleteAllDataSourcesOnUI();
cy.deleteAllDataSources();
// remove the default data source
cy.setAdvancedSetting({
defaultDataSource: '',
});
});
it('The first data source is the default data source', () => {
cy.visitDataSourcesListingPage();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
describe('Create datasources', () => {
before(() => {
// Clean up before creating new data sources for testing
cy.deleteAllDataSources();
cy.createDataSourceNoAuthWithTitle('ds_1');
cy.wait(6000);
});

after(() => {
// Clean up after all test are run
cy.deleteAllDataSources();
// remove the default data source
cy.setAdvancedSetting({
defaultDataSource: '',
});
});

describe('Check datasource contains version decouple related information', () => {
it('check installed plugins and data source version information is showed', () => {
cy.request({
method: 'GET',
url: '/api/saved_objects/_find?type=data-source',
}).then((response) => {
const savedObjects = response.body.saved_objects;
expect(
savedObjects,
'Data sources should exist'
).to.have.length.greaterThan(0);

const dataSource = savedObjects[0];
const { attributes } = dataSource;
expect(attributes).to.have.property('dataSourceVersion');
expect(attributes).to.have.property('installedPlugins');
});
});
});
});
}
Loading

0 comments on commit 2202791

Please sign in to comment.