generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 131
[MDS]Add FT for TSVB support with MDS #1333
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
Open
yujin-emma
wants to merge
6
commits into
opensearch-project:main
Choose a base branch
from
yujin-emma:tsvb-ft-pr
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e18aca7
Add FT for TSVB support with MDS
amznyja 09f87be
Fix the data source to use no auth
yujin-emma a876a80
Update mds_tsvb.spec.js
yujin-emma 91bf46e
Merge branch 'main' into tsvb-ft-pr
yujin-emma 8017a4e
Merge branch 'main' into tsvb-ft-pr
yujin-emma 73d7b12
Merge branch 'main' into tsvb-ft-pr
SuZhou-Joe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
20,000 changes: 20,000 additions & 0 deletions
20,000
cypress/fixtures/dashboard/opensearch_dashboards/vis_type_tsvb/metrics.data.txt
Large diffs are not rendered by default.
Oops, something went wrong.
79 changes: 79 additions & 0 deletions
79
...tion/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_tsvb/mds_tsvb.spec.js
This file contains hidden or 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,79 @@ | ||
| /* | ||
| * Copyright OpenSearch Contributors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import { CURRENT_TENANT } from '../../../../../utils/commands'; | ||
| import { DS_NO_AUTH_LABEL } from '../../../../../utils/dashboards/datasource-management-dashboards-plugin/constants'; | ||
| import { | ||
| TSVB_INDEX_ID, | ||
| TSVB_PATH_INDEX_DATA, | ||
| TSVB_CREATE_URL, | ||
| VIS_APP_PATH, | ||
| TSVB_INDEX_START_TIME, | ||
| TSVB_INDEX_END_TIME, | ||
| TSVB_INDEX_PATTERN, | ||
| TSVB_VIS_TYPE, | ||
| } from '../../../../../utils/dashboards/vis_type_tsvb/constants'; | ||
|
|
||
| if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) { | ||
| before(() => { | ||
| CURRENT_TENANT.newTenant = 'global'; | ||
| cy.fleshTenantSettings(); | ||
| cy.deleteIndex(TSVB_INDEX_ID); | ||
| cy.bulkUploadDocs(TSVB_PATH_INDEX_DATA); | ||
|
|
||
| // Dashboards requires an index pattern to continue to the Create Visualization stage | ||
| cy.deleteIndexPattern(TSVB_INDEX_PATTERN); | ||
|
|
||
| cy.wait(1000); | ||
| cy.deleteSavedObjectByType(TSVB_VIS_TYPE, TSVB_INDEX_ID); | ||
|
|
||
| cy.createIndexPattern(TSVB_INDEX_PATTERN, { | ||
| title: TSVB_INDEX_PATTERN, | ||
| timeFieldName: 'timestamp', | ||
| }); | ||
|
|
||
| cy.deleteDataSourceIndexNoAuth(TSVB_INDEX_ID); | ||
| cy.deleteAllDataSources(); | ||
|
|
||
| cy.createDataSourceNoAuth(); | ||
| cy.bulkUploadDocsToDataSourceNoAuth(TSVB_PATH_INDEX_DATA); | ||
| // Visit the page | ||
| cy.log('create a new tsvb visualization: ', TSVB_CREATE_URL); | ||
| cy.visit(TSVB_CREATE_URL); | ||
| cy.url().should('contain', VIS_APP_PATH); | ||
| cy.setTopNavDate(TSVB_INDEX_START_TIME, TSVB_INDEX_END_TIME); | ||
|
|
||
| // Wait for page to load | ||
| cy.waitForLoader(); | ||
| }); | ||
|
|
||
| after(() => { | ||
| cy.deleteIndex(TSVB_INDEX_ID); | ||
| cy.deleteIndexPattern(TSVB_INDEX_PATTERN); | ||
|
|
||
| cy.deleteDataSourceIndexNoAuth(TSVB_INDEX_ID); | ||
| cy.deleteAllDataSources(); | ||
| }); | ||
|
|
||
| describe('TSVB Visualization (MDS is enabled)', () => { | ||
| [ | ||
| { | ||
| dataSourceName: DS_NO_AUTH_LABEL, | ||
| canvasExists: 'exist', | ||
| }, | ||
| ].forEach(({ dataSourceName, canvasExists }) => { | ||
| it(`should query data from ${dataSourceName} and resulting visualization should ${canvasExists}`, () => { | ||
| cy.contains('button', 'Panel options').click(); | ||
| cy.contains('label', 'Data source'); | ||
| // Click on the dropdown to open it | ||
| cy.get('[data-test-subj="dataSourceSelectorComboBox"]').click(); | ||
| cy.contains('[role="option"]', dataSourceName).click(); | ||
| // use the default index for query data | ||
| cy.tsvbSaveVisualization(); | ||
| cy.get('canvas').should(canvasExists); | ||
| }); | ||
| }); | ||
| }); | ||
| } |
57 changes: 57 additions & 0 deletions
57
...egration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_tsvb/tsvb.spec.js
This file contains hidden or 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,57 @@ | ||
| /* | ||
| * Copyright OpenSearch Contributors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import { CURRENT_TENANT } from '../../../../../utils/commands'; | ||
| import { | ||
| TSVB_INDEX_ID, | ||
| TSVB_PATH_INDEX_DATA, | ||
| TSVB_CREATE_URL, | ||
| VIS_APP_PATH, | ||
| TSVB_INDEX_START_TIME, | ||
| TSVB_INDEX_END_TIME, | ||
| TSVB_INDEX_PATTERN, | ||
| TSVB_VIS_TYPE, | ||
| } from '../../../../../utils/dashboards/vis_type_tsvb/constants'; | ||
|
|
||
| if (!Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) { | ||
| before(() => { | ||
| CURRENT_TENANT.newTenant = 'global'; | ||
| cy.fleshTenantSettings(); | ||
| cy.deleteIndex(TSVB_INDEX_ID); | ||
| cy.bulkUploadDocs(TSVB_PATH_INDEX_DATA); | ||
|
|
||
| // Dashboards requires an index pattern to continue to the Create Visualization stage | ||
| cy.deleteIndexPattern(TSVB_INDEX_PATTERN); | ||
|
|
||
| cy.wait(1000); | ||
| cy.deleteSavedObjectByType(TSVB_VIS_TYPE, TSVB_INDEX_ID); | ||
|
|
||
| cy.createIndexPattern(TSVB_INDEX_PATTERN, { | ||
| title: TSVB_INDEX_PATTERN, | ||
| timeFieldName: 'timestamp', | ||
| }); | ||
| // Visit the page | ||
| cy.log('create a new tsvb visualization: ', TSVB_CREATE_URL); | ||
| cy.visit(TSVB_CREATE_URL); | ||
| cy.url().should('contain', VIS_APP_PATH); | ||
| cy.setTopNavDate(TSVB_INDEX_START_TIME, TSVB_INDEX_END_TIME); | ||
|
|
||
| // Wait for page to load | ||
| cy.waitForLoader(); | ||
| }); | ||
|
|
||
| after(() => { | ||
| cy.deleteIndex(TSVB_INDEX_ID); | ||
| cy.deleteIndexPattern(TSVB_INDEX_PATTERN); | ||
| }); | ||
|
|
||
| describe('TSVB Visualization (MDS is disabled)', () => { | ||
| it(`should create new tsvb visulization`, () => { | ||
| cy.contains('button', 'Panel options').click(); | ||
| cy.tsvbSaveVisualization(); | ||
| cy.get('canvas').should('exist'); | ||
| }); | ||
| }); | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,13 @@ | ||
| /* | ||
| * Copyright OpenSearch Contributors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| import { TSVB_INDEX_PATTERN } from './constants'; | ||
|
|
||
| Cypress.Commands.add('tsvbSaveVisualization', () => { | ||
| cy.contains('button', 'Save').click(); | ||
| // Type in a random name into the input field | ||
| cy.get('[data-test-subj="savedObjectTitle"]').type(TSVB_INDEX_PATTERN); | ||
| // Click the button with data-test-subj="confirmSaveSavedObjectButton" | ||
| cy.get('[data-test-subj="confirmSaveSavedObjectButton"]').click(); | ||
| }); |
This file contains hidden or 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,23 @@ | ||
| /* | ||
| * Copyright OpenSearch Contributors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| import { BASE_PATH } from '../../base_constants'; | ||
|
|
||
| // Data | ||
| export const TSVB_INDEX_DATA = 'metrics.data.txt'; | ||
| export const TSVB_PATH_FIXTURE = | ||
| 'dashboard/opensearch_dashboards/vis_type_tsvb/'; | ||
| export const TSVB_PATH_INDEX_DATA = TSVB_PATH_FIXTURE + TSVB_INDEX_DATA; | ||
|
|
||
| // Update the constants | ||
| export const TSVB_INDEX_START_TIME = 'May 16, 2010 @ 00:00:00.000'; | ||
| export const TSVB_INDEX_END_TIME = 'May 16, 2024 @ 00:00:00.000'; | ||
| export const TSVB_INDEX_ID = 'vis-metrics'; | ||
| export const TSVB_INDEX_PATTERN = 'index-pattern-vis-metrics'; | ||
|
|
||
| export const TSVB_VIS_TYPE = 'visualization'; | ||
|
|
||
| // App URL Paths | ||
| export const VIS_APP_PATH = '/app/visualize'; | ||
| export const TSVB_CREATE_URL = `${BASE_PATH}${VIS_APP_PATH}#/create?type=metrics`; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.