From ed0075c9ab0c48dc8e7662a7321f7d5d2b827010 Mon Sep 17 00:00:00 2001 From: Tre' Seymour Date: Mon, 30 Aug 2021 09:31:06 +0100 Subject: [PATCH 1/4] [Archive Migration][Partial] discover apps-discover Comes from https://github.com/elastic/kibana/pull/102827 Helps with https://github.com/elastic/kibana/pull/108503 Piggy back off of the work from @tylersmalley Only include the changes under the test/functional/apps/discover folder. --- .../apps/discover/_data_grid_doc_navigation.ts | 11 +++++++++-- test/functional/apps/discover/_doc_navigation.ts | 3 ++- .../apps/discover/_runtime_fields_editor.ts | 4 ++++ test/functional/apps/discover/_sidebar.ts | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/test/functional/apps/discover/_data_grid_doc_navigation.ts b/test/functional/apps/discover/_data_grid_doc_navigation.ts index cf5532aa6d762..73077dcc9749a 100644 --- a/test/functional/apps/discover/_data_grid_doc_navigation.ts +++ b/test/functional/apps/discover/_data_grid_doc_navigation.ts @@ -20,9 +20,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const defaultSettings = { defaultIndex: 'logstash-*', 'doc_table:legacy': false }; describe('discover data grid doc link', function () { - beforeEach(async function () { + before(async () => { await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/discover'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); + }); + + after(async () => { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); + }); + + beforeEach(async function () { await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await kibanaServer.uiSettings.update(defaultSettings); await PageObjects.common.navigateToApp('discover'); diff --git a/test/functional/apps/discover/_doc_navigation.ts b/test/functional/apps/discover/_doc_navigation.ts index 8d156cb305586..b5863645d8a72 100644 --- a/test/functional/apps/discover/_doc_navigation.ts +++ b/test/functional/apps/discover/_doc_navigation.ts @@ -22,7 +22,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('doc link in discover', function contextSize() { before(async () => { await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/discover'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await kibanaServer.uiSettings.update({ 'doc_table:legacy': true, @@ -30,6 +30,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); after(async () => { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover.json'); await kibanaServer.uiSettings.replace({}); }); diff --git a/test/functional/apps/discover/_runtime_fields_editor.ts b/test/functional/apps/discover/_runtime_fields_editor.ts index a77bc4c77568a..d9f2db8f09b28 100644 --- a/test/functional/apps/discover/_runtime_fields_editor.ts +++ b/test/functional/apps/discover/_runtime_fields_editor.ts @@ -39,6 +39,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.common.navigateToApp('discover'); }); + after(async () => { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover.json'); + }); + it('allows adding custom label to existing fields', async function () { const customLabel = 'megabytes'; await PageObjects.discover.editField('bytes'); diff --git a/test/functional/apps/discover/_sidebar.ts b/test/functional/apps/discover/_sidebar.ts index d8701261126c4..2523e0e0a48a2 100644 --- a/test/functional/apps/discover/_sidebar.ts +++ b/test/functional/apps/discover/_sidebar.ts @@ -17,7 +17,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('discover sidebar', function describeIndexTests() { before(async function () { await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/discover'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*', }); @@ -25,6 +25,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.common.navigateToApp('discover'); }); + after(async () => { + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover.json'); + }); + describe('field filtering', function () { it('should reveal and hide the filter form when the toggle is clicked', async function () { await PageObjects.discover.openSidebarFieldFilter(); From 56af5292241c9d805adf226a7b82c67c8036c29a Mon Sep 17 00:00:00 2001 From: Tre' Seymour Date: Mon, 30 Aug 2021 17:51:50 +0100 Subject: [PATCH 2/4] CR fixups, add clean call. --- test/functional/apps/discover/_runtime_fields_editor.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/functional/apps/discover/_runtime_fields_editor.ts b/test/functional/apps/discover/_runtime_fields_editor.ts index d9f2db8f09b28..5cba69adb91f7 100644 --- a/test/functional/apps/discover/_runtime_fields_editor.ts +++ b/test/functional/apps/discover/_runtime_fields_editor.ts @@ -30,17 +30,18 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await fieldEditor.save(); }; - describe('discover integration with runtime fields editor', function describeIndexTests() { + describe('tre suite', function describeIndexTests() { before(async function () { - await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); await kibanaServer.uiSettings.replace(defaultSettings); await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await PageObjects.common.navigateToApp('discover'); }); after(async () => { - await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover.json'); + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); + await kibanaServer.savedObjects.clean({ types: ['saved-search'] }); }); it('allows adding custom label to existing fields', async function () { From f28891001d1a325b9dbcd3f17f83df1dd94d565c Mon Sep 17 00:00:00 2001 From: Tre' Seymour Date: Mon, 30 Aug 2021 17:53:26 +0100 Subject: [PATCH 3/4] Fix suite name --- test/functional/apps/discover/_runtime_fields_editor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/apps/discover/_runtime_fields_editor.ts b/test/functional/apps/discover/_runtime_fields_editor.ts index 5cba69adb91f7..fa42b0ac49617 100644 --- a/test/functional/apps/discover/_runtime_fields_editor.ts +++ b/test/functional/apps/discover/_runtime_fields_editor.ts @@ -30,7 +30,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await fieldEditor.save(); }; - describe('tre suite', function describeIndexTests() { + describe('discover integration with runtime fields editor', function describeIndexTests() { before(async function () { await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); From 07c3328dbe75dcee1a13c44ce2679be02975b704 Mon Sep 17 00:00:00 2001 From: Tre' Seymour Date: Tue, 31 Aug 2021 11:14:49 +0100 Subject: [PATCH 4/4] Cleanup --- test/functional/apps/discover/_doc_navigation.ts | 4 ++-- test/functional/apps/discover/_sidebar.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/functional/apps/discover/_doc_navigation.ts b/test/functional/apps/discover/_doc_navigation.ts index b5863645d8a72..19f61851ef961 100644 --- a/test/functional/apps/discover/_doc_navigation.ts +++ b/test/functional/apps/discover/_doc_navigation.ts @@ -22,7 +22,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('doc link in discover', function contextSize() { before(async () => { await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); await kibanaServer.uiSettings.update({ 'doc_table:legacy': true, @@ -30,7 +30,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); }); after(async () => { - await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover.json'); + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); await kibanaServer.uiSettings.replace({}); }); diff --git a/test/functional/apps/discover/_sidebar.ts b/test/functional/apps/discover/_sidebar.ts index 2523e0e0a48a2..a74f4367e657b 100644 --- a/test/functional/apps/discover/_sidebar.ts +++ b/test/functional/apps/discover/_sidebar.ts @@ -17,7 +17,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('discover sidebar', function describeIndexTests() { before(async function () { await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional'); - await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json'); + await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover'); await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*', }); @@ -26,7 +26,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); after(async () => { - await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover.json'); + await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover'); }); describe('field filtering', function () {