From 50ae8c8263a90cf1337f7a8c80d02307b7aa925f Mon Sep 17 00:00:00 2001 From: Kawika Avilla Date: Thu, 15 Apr 2021 13:11:46 -0700 Subject: [PATCH] [Tests] ciGroup2 functional test fixes (#291) This does not fix everything in group 2, there are still failures which I believe are being caused by some data being imported but this fixes an error in the plugins of a incomplete rename of applyOpenSearchResp. node scripts/functional_tests.js --config test/functional/config.js --include ciGroup2 Signed-off-by: Kawika Avilla --- .../public/lib/resolve_saved_objects.test.ts | 12 ++++++------ .../public/lib/resolve_saved_objects.ts | 2 +- .../apps/dashboard/create_and_add_embeddables.js | 2 +- .../apps/dashboard/dashboard_back_button.ts | 2 +- .../apps/dashboard/dashboard_error_handling.ts | 2 +- .../apps/dashboard/dashboard_filter_bar.js | 2 +- .../functional/apps/dashboard/dashboard_filtering.js | 2 +- test/functional/apps/dashboard/dashboard_grid.js | 2 +- test/functional/apps/dashboard/dashboard_options.js | 2 +- .../functional/apps/dashboard/dashboard_query_bar.js | 2 +- .../apps/dashboard/dashboard_saved_query.js | 2 +- .../functional/apps/dashboard/dashboard_snapshots.js | 2 +- .../apps/dashboard/data_shared_attributes.js | 2 +- .../apps/dashboard/edit_embeddable_redirects.js | 2 +- .../functional/apps/dashboard/edit_visualizations.js | 2 +- test/functional/apps/dashboard/embed_mode.js | 2 +- .../apps/dashboard/embeddable_rendering.js | 2 +- test/functional/apps/dashboard/empty_dashboard.js | 2 +- test/functional/apps/dashboard/full_screen_mode.js | 2 +- test/functional/apps/dashboard/legacy_urls.ts | 5 +++-- .../functional/apps/dashboard/panel_expand_toggle.js | 2 +- test/functional/apps/dashboard/time_zones.js | 2 +- .../functional/apps/dashboard/url_field_formatter.ts | 2 +- test/functional/apps/dashboard/view_edit.js | 2 +- 24 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts b/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts index df45baa68607..cff1c6af2caa 100644 --- a/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts +++ b/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.test.ts @@ -100,7 +100,7 @@ describe('resolveSavedObjects', () => { type: 'search', get: async () => { return { - applyESResp: async () => {}, + applyOpenSearchResp: async () => {}, save: async () => { throw new SavedObjectNotFound({ savedObjectType: 'index-pattern', @@ -113,7 +113,7 @@ describe('resolveSavedObjects', () => { type: 'dashboard', get: async () => { return { - applyESResp: async () => {}, + applyOpenSearchResp: async () => {}, save: async () => { throw new SavedObjectNotFound({ savedObjectType: 'index-pattern', @@ -126,7 +126,7 @@ describe('resolveSavedObjects', () => { type: 'visualization', get: async () => { return { - applyESResp: async () => {}, + applyOpenSearchResp: async () => {}, save: async () => { throw new SavedObjectNotFound({ savedObjectType: 'index-pattern', @@ -192,7 +192,7 @@ describe('resolveSavedObjects', () => { type: 'search', get: async () => { return { - applyESResp: async () => {}, + applyOpenSearchResp: async () => {}, save: async () => { throw new SavedObjectNotFound({ savedObjectType: 'search', @@ -205,7 +205,7 @@ describe('resolveSavedObjects', () => { type: 'dashboard', get: async () => { return { - applyESResp: async () => {}, + applyOpenSearchResp: async () => {}, save: async () => { throw new SavedObjectNotFound({ savedObjectType: 'index-pattern', @@ -219,7 +219,7 @@ describe('resolveSavedObjects', () => { get: async () => { return { savedSearchId: '1', - applyESResp: async () => {}, + applyOpenSearchResp: async () => {}, save: async () => { throw new SavedObjectNotFound({ savedObjectType: 'index-pattern', diff --git a/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts b/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts index ceb1a3d57abc..e3980fb60dd7 100644 --- a/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts +++ b/src/plugins/saved_objects_management/public/lib/resolve_saved_objects.ts @@ -147,7 +147,7 @@ async function importIndexPattern( } async function importDocument(obj: SavedObject, doc: SavedObjectsRawDoc, overwriteAll: boolean) { - await obj.applyESResp({ + await obj.applyOpenSearchResp({ references: doc._references || [], ...cloneDeep(doc), }); diff --git a/test/functional/apps/dashboard/create_and_add_embeddables.js b/test/functional/apps/dashboard/create_and_add_embeddables.js index f19ca65ce646..62b9c69d9cc5 100644 --- a/test/functional/apps/dashboard/create_and_add_embeddables.js +++ b/test/functional/apps/dashboard/create_and_add_embeddables.js @@ -45,7 +45,7 @@ export default function ({ getService, getPageObjects }) { describe('create and add embeddables', () => { before(async () => { - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/dashboard_back_button.ts b/test/functional/apps/dashboard/dashboard_back_button.ts index 5cfcea223fb9..0617c9a630da 100644 --- a/test/functional/apps/dashboard/dashboard_back_button.ts +++ b/test/functional/apps/dashboard/dashboard_back_button.ts @@ -41,7 +41,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('dashboard back button', () => { before(async () => { - await opensearchArchiver.loadIfNeeded('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.loadIfNeeded('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/dashboard_error_handling.ts b/test/functional/apps/dashboard/dashboard_error_handling.ts index 154b4a23b921..bf23d6e0c461 100644 --- a/test/functional/apps/dashboard/dashboard_error_handling.ts +++ b/test/functional/apps/dashboard/dashboard_error_handling.ts @@ -43,7 +43,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { */ describe('dashboard error handling', () => { before(async () => { - await opensearchArchiver.loadIfNeeded('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.loadIfNeeded('dashboard/current/opensearch_dashboards'); await PageObjects.common.navigateToApp('dashboard'); }); diff --git a/test/functional/apps/dashboard/dashboard_filter_bar.js b/test/functional/apps/dashboard/dashboard_filter_bar.js index 8a6e2a3255b7..d22254866850 100644 --- a/test/functional/apps/dashboard/dashboard_filter_bar.js +++ b/test/functional/apps/dashboard/dashboard_filter_bar.js @@ -45,7 +45,7 @@ export default function ({ getService, getPageObjects }) { describe('dashboard filter bar', () => { before(async () => { - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/dashboard_filtering.js b/test/functional/apps/dashboard/dashboard_filtering.js index 304e5c65cc35..fb24c342ad21 100644 --- a/test/functional/apps/dashboard/dashboard_filtering.js +++ b/test/functional/apps/dashboard/dashboard_filtering.js @@ -54,7 +54,7 @@ export default function ({ getService, getPageObjects }) { this.tags('includeFirefox'); before(async () => { - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await security.testUser.setRoles([ 'opensearch_dashboards_admin', 'test_logstash_reader', diff --git a/test/functional/apps/dashboard/dashboard_grid.js b/test/functional/apps/dashboard/dashboard_grid.js index 4c153a46b5dd..651fe3d689c4 100644 --- a/test/functional/apps/dashboard/dashboard_grid.js +++ b/test/functional/apps/dashboard/dashboard_grid.js @@ -41,7 +41,7 @@ export default function ({ getService, getPageObjects }) { describe('dashboard grid', function () { before(async () => { - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/dashboard_options.js b/test/functional/apps/dashboard/dashboard_options.js index 58678de79f49..8947763d4fc2 100644 --- a/test/functional/apps/dashboard/dashboard_options.js +++ b/test/functional/apps/dashboard/dashboard_options.js @@ -42,7 +42,7 @@ export default function ({ getService, getPageObjects }) { let originalTitles = []; before(async () => { - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/dashboard_query_bar.js b/test/functional/apps/dashboard/dashboard_query_bar.js index 7214e1256a5c..409e8193c31e 100644 --- a/test/functional/apps/dashboard/dashboard_query_bar.js +++ b/test/functional/apps/dashboard/dashboard_query_bar.js @@ -42,7 +42,7 @@ export default function ({ getService, getPageObjects }) { describe('dashboard query bar', () => { before(async () => { - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/dashboard_saved_query.js b/test/functional/apps/dashboard/dashboard_saved_query.js index 343eb8f27680..c0e671facefc 100644 --- a/test/functional/apps/dashboard/dashboard_saved_query.js +++ b/test/functional/apps/dashboard/dashboard_saved_query.js @@ -43,7 +43,7 @@ export default function ({ getService, getPageObjects }) { describe('dashboard saved queries', function describeIndexTests() { before(async function () { - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/dashboard_snapshots.js b/test/functional/apps/dashboard/dashboard_snapshots.js index d9608257dfee..f0cf5aa7aee4 100644 --- a/test/functional/apps/dashboard/dashboard_snapshots.js +++ b/test/functional/apps/dashboard/dashboard_snapshots.js @@ -43,7 +43,7 @@ export default function ({ getService, getPageObjects, updateBaselines }) { describe('dashboard snapshots', function describeIndexTests() { before(async function () { - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/data_shared_attributes.js b/test/functional/apps/dashboard/data_shared_attributes.js index 4ade191d0a4b..94aed364cc85 100644 --- a/test/functional/apps/dashboard/data_shared_attributes.js +++ b/test/functional/apps/dashboard/data_shared_attributes.js @@ -43,7 +43,7 @@ export default function ({ getService, getPageObjects }) { let originalPanelTitles; before(async () => { - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/edit_embeddable_redirects.js b/test/functional/apps/dashboard/edit_embeddable_redirects.js index 234cadc4263f..778d1b4edf9e 100644 --- a/test/functional/apps/dashboard/edit_embeddable_redirects.js +++ b/test/functional/apps/dashboard/edit_embeddable_redirects.js @@ -41,7 +41,7 @@ export default function ({ getService, getPageObjects }) { describe('edit embeddable redirects', () => { before(async () => { - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/edit_visualizations.js b/test/functional/apps/dashboard/edit_visualizations.js index 2a657081ab54..151ec3f9c18b 100644 --- a/test/functional/apps/dashboard/edit_visualizations.js +++ b/test/functional/apps/dashboard/edit_visualizations.js @@ -64,7 +64,7 @@ export default function ({ getService, getPageObjects }) { describe('edit visualizations from dashboard', () => { before(async () => { - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/embed_mode.js b/test/functional/apps/dashboard/embed_mode.js index d6bb881d704a..4b0b88025ef3 100644 --- a/test/functional/apps/dashboard/embed_mode.js +++ b/test/functional/apps/dashboard/embed_mode.js @@ -50,7 +50,7 @@ export default function ({ getService, getPageObjects }) { ]; before(async () => { - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/embeddable_rendering.js b/test/functional/apps/dashboard/embeddable_rendering.js index 71eaab2ee732..8806d6110c99 100644 --- a/test/functional/apps/dashboard/embeddable_rendering.js +++ b/test/functional/apps/dashboard/embeddable_rendering.js @@ -119,7 +119,7 @@ export default function ({ getService, getPageObjects }) { 'animals', 'test_logstash_reader', ]); - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/empty_dashboard.js b/test/functional/apps/dashboard/empty_dashboard.js index b44d61f7e63d..8d21d0755466 100644 --- a/test/functional/apps/dashboard/empty_dashboard.js +++ b/test/functional/apps/dashboard/empty_dashboard.js @@ -43,7 +43,7 @@ export default function ({ getService, getPageObjects }) { describe('empty dashboard', () => { before(async () => { - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/full_screen_mode.js b/test/functional/apps/dashboard/full_screen_mode.js index c068b54b54cd..4a1ef826eee3 100644 --- a/test/functional/apps/dashboard/full_screen_mode.js +++ b/test/functional/apps/dashboard/full_screen_mode.js @@ -42,7 +42,7 @@ export default function ({ getService, getPageObjects }) { describe('full screen mode', () => { before(async () => { - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/legacy_urls.ts b/test/functional/apps/dashboard/legacy_urls.ts index 0a10bcac9b03..92418fdde784 100644 --- a/test/functional/apps/dashboard/legacy_urls.ts +++ b/test/functional/apps/dashboard/legacy_urls.ts @@ -57,7 +57,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('legacy urls', function describeIndexTests() { before(async function () { await security.testUser.setRoles(['opensearch_dashboards_admin', 'animals']); - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await PageObjects.common.navigateToApp('dashboard'); await PageObjects.dashboard.clickNewDashboard(); await dashboardAddPanel.addVisualization('Rendering-Test:-animal-sounds-pie'); @@ -67,7 +67,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await log.debug(`Current url is ${currentUrl}`); testDashboardId = /#\/view\/(.+)\?/.exec(currentUrl)![1]; opensearchDashboardsLegacyBaseUrl = - currentUrl.substring(0, currentUrl.indexOf('/app/dashboards')) + '/app/kibana'; + currentUrl.substring(0, currentUrl.indexOf('/app/dashboards')) + + '/app/opensearch-dashboards'; opensearchDashboardsVisualizeBaseUrl = currentUrl.substring(0, currentUrl.indexOf('/app/dashboards')) + '/app/visualize'; await log.debug(`id is ${testDashboardId}`); diff --git a/test/functional/apps/dashboard/panel_expand_toggle.js b/test/functional/apps/dashboard/panel_expand_toggle.js index f14c4675af5b..aafc411d459c 100644 --- a/test/functional/apps/dashboard/panel_expand_toggle.js +++ b/test/functional/apps/dashboard/panel_expand_toggle.js @@ -42,7 +42,7 @@ export default function ({ getService, getPageObjects }) { describe('expanding a panel', () => { before(async () => { - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/time_zones.js b/test/functional/apps/dashboard/time_zones.js index 7764268171fd..89f49635482a 100644 --- a/test/functional/apps/dashboard/time_zones.js +++ b/test/functional/apps/dashboard/time_zones.js @@ -49,7 +49,7 @@ export default function ({ getService, getPageObjects }) { this.tags('includeFirefox'); before(async () => { - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/url_field_formatter.ts b/test/functional/apps/dashboard/url_field_formatter.ts index 5e3f11f6ce79..f79222551e9f 100644 --- a/test/functional/apps/dashboard/url_field_formatter.ts +++ b/test/functional/apps/dashboard/url_field_formatter.ts @@ -63,7 +63,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // FLAKY: https://github.com/elastic/kibana/issues/79463 describe.skip('Changing field formatter to Url', () => { before(async function () { - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', }); diff --git a/test/functional/apps/dashboard/view_edit.js b/test/functional/apps/dashboard/view_edit.js index 75543cfdacb0..621cc2ecaebb 100644 --- a/test/functional/apps/dashboard/view_edit.js +++ b/test/functional/apps/dashboard/view_edit.js @@ -43,7 +43,7 @@ export default function ({ getService, getPageObjects }) { describe('dashboard view edit mode', function viewEditModeTests() { before(async () => { - await opensearchArchiver.load('dashboard/current/opensearch-dashboards'); + await opensearchArchiver.load('dashboard/current/opensearch_dashboards'); await opensearchDashboardsServer.uiSettings.replace({ defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', });