From 306eb5cd83ce915e8b18c7a5ea617a1a2603ec41 Mon Sep 17 00:00:00 2001 From: Matt Kime Date: Mon, 13 Jul 2020 14:03:32 -0500 Subject: [PATCH 1/5] move test to xpack --- .../_create_index_pattern_wizard.js | 36 ------------ .../management/create_index_pattern_wizard.js | 57 +++++++++++++++++++ .../test/functional/apps/management/index.js | 13 +++++ 3 files changed, 70 insertions(+), 36 deletions(-) create mode 100644 x-pack/test/functional/apps/management/create_index_pattern_wizard.js create mode 100644 x-pack/test/functional/apps/management/index.js diff --git a/test/functional/apps/management/_create_index_pattern_wizard.js b/test/functional/apps/management/_create_index_pattern_wizard.js index 97f2641b51d13..160b052e70d30 100644 --- a/test/functional/apps/management/_create_index_pattern_wizard.js +++ b/test/functional/apps/management/_create_index_pattern_wizard.js @@ -51,42 +51,6 @@ export default function ({ getService, getPageObjects }) { }); }); - describe('data streams', () => { - it('can be an index pattern', async () => { - await es.transport.request({ - path: '/_index_template/generic-logs', - method: 'PUT', - body: { - index_patterns: ['logs-*', 'test_data_stream'], - template: { - mappings: { - properties: { - '@timestamp': { - type: 'date', - }, - }, - }, - }, - data_stream: { - timestamp_field: '@timestamp', - }, - }, - }); - - await es.transport.request({ - path: '/_data_stream/test_data_stream', - method: 'PUT', - }); - - await PageObjects.settings.createIndexPattern('test_data_stream', false); - - await es.transport.request({ - path: '/_data_stream/test_data_stream', - method: 'DELETE', - }); - }); - }); - describe('index alias', () => { it('can be an index pattern', async () => { await es.transport.request({ diff --git a/x-pack/test/functional/apps/management/create_index_pattern_wizard.js b/x-pack/test/functional/apps/management/create_index_pattern_wizard.js new file mode 100644 index 0000000000000..7346af4f89b85 --- /dev/null +++ b/x-pack/test/functional/apps/management/create_index_pattern_wizard.js @@ -0,0 +1,57 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +export default function ({ getService, getPageObjects }) { + const kibanaServer = getService('kibanaServer'); + const es = getService('legacyEs'); + const PageObjects = getPageObjects(['settings', 'common']); + + // Flaky: https://github.com/elastic/kibana/issues/71501 + describe('"Create Index Pattern" wizard', function () { + before(async function () { + // delete .kibana index and then wait for Kibana to re-create it + await kibanaServer.uiSettings.replace({}); + await PageObjects.settings.navigateTo(); + await PageObjects.settings.clickKibanaIndexPatterns(); + }); + + describe('data streams', () => { + it('can be an index pattern', async () => { + await es.transport.request({ + path: '/_index_template/generic-logs', + method: 'PUT', + body: { + index_patterns: ['logs-*', 'test_data_stream'], + template: { + mappings: { + properties: { + '@timestamp': { + type: 'date', + }, + }, + }, + }, + data_stream: { + timestamp_field: '@timestamp', + }, + }, + }); + + await es.transport.request({ + path: '/_data_stream/test_data_stream', + method: 'PUT', + }); + + await PageObjects.settings.createIndexPattern('test_data_stream', false); + + await es.transport.request({ + path: '/_data_stream/test_data_stream', + method: 'DELETE', + }); + }); + }); + }); +} diff --git a/x-pack/test/functional/apps/management/index.js b/x-pack/test/functional/apps/management/index.js new file mode 100644 index 0000000000000..de73264c0c78d --- /dev/null +++ b/x-pack/test/functional/apps/management/index.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +export default function ({ loadTestFile }) { + describe('management', function () { + this.tags(['ciGroup2']); + + loadTestFile(require.resolve('./create_index_patten_wizard')); + }); +} From 0d3c5f582e9034cb30174e619ed3b87e80795d02 Mon Sep 17 00:00:00 2001 From: Matthew Kime Date: Mon, 13 Jul 2020 15:56:21 -0500 Subject: [PATCH 2/5] remove comment --- .../functional/apps/management/create_index_pattern_wizard.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x-pack/test/functional/apps/management/create_index_pattern_wizard.js b/x-pack/test/functional/apps/management/create_index_pattern_wizard.js index 7346af4f89b85..f401339aa46be 100644 --- a/x-pack/test/functional/apps/management/create_index_pattern_wizard.js +++ b/x-pack/test/functional/apps/management/create_index_pattern_wizard.js @@ -8,8 +8,7 @@ export default function ({ getService, getPageObjects }) { const kibanaServer = getService('kibanaServer'); const es = getService('legacyEs'); const PageObjects = getPageObjects(['settings', 'common']); - - // Flaky: https://github.com/elastic/kibana/issues/71501 + describe('"Create Index Pattern" wizard', function () { before(async function () { // delete .kibana index and then wait for Kibana to re-create it From a05337ea0e60cc324a9a10ca2d8f24544f1036d9 Mon Sep 17 00:00:00 2001 From: Matt Kime Date: Mon, 13 Jul 2020 16:01:17 -0500 Subject: [PATCH 3/5] add management to xpack functional tests --- .../functional/apps/management/create_index_pattern_wizard.js | 2 +- x-pack/test/functional/config.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/management/create_index_pattern_wizard.js b/x-pack/test/functional/apps/management/create_index_pattern_wizard.js index f401339aa46be..ee77062e49661 100644 --- a/x-pack/test/functional/apps/management/create_index_pattern_wizard.js +++ b/x-pack/test/functional/apps/management/create_index_pattern_wizard.js @@ -8,7 +8,7 @@ export default function ({ getService, getPageObjects }) { const kibanaServer = getService('kibanaServer'); const es = getService('legacyEs'); const PageObjects = getPageObjects(['settings', 'common']); - + describe('"Create Index Pattern" wizard', function () { before(async function () { // delete .kibana index and then wait for Kibana to re-create it diff --git a/x-pack/test/functional/config.js b/x-pack/test/functional/config.js index ad65f82d6dfe1..5c13e430ae2ca 100644 --- a/x-pack/test/functional/config.js +++ b/x-pack/test/functional/config.js @@ -57,6 +57,7 @@ export default async function ({ readConfigFile }) { resolve(__dirname, './apps/remote_clusters'), resolve(__dirname, './apps/transform'), resolve(__dirname, './apps/reporting_management'), + resolve(__dirname, './apps/management'), // This license_management file must be last because it is destructive. resolve(__dirname, './apps/license_management'), From 7ca2eca14dc6b4576d5137b656e13acc1d457055 Mon Sep 17 00:00:00 2001 From: Matt Kime Date: Mon, 13 Jul 2020 17:58:22 -0500 Subject: [PATCH 4/5] fix file path --- x-pack/test/functional/apps/management/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/management/index.js b/x-pack/test/functional/apps/management/index.js index de73264c0c78d..19c68a2da9d9b 100644 --- a/x-pack/test/functional/apps/management/index.js +++ b/x-pack/test/functional/apps/management/index.js @@ -8,6 +8,6 @@ export default function ({ loadTestFile }) { describe('management', function () { this.tags(['ciGroup2']); - loadTestFile(require.resolve('./create_index_patten_wizard')); + loadTestFile(require.resolve('./create_index_pattern_wizard')); }); } From 298bd7cb9cc9a11713f0383c6d23a03dfff1798a Mon Sep 17 00:00:00 2001 From: Matthew Kime Date: Wed, 15 Jul 2020 16:31:11 -0500 Subject: [PATCH 5/5] Update create_index_pattern_wizard.js --- .../functional/apps/management/create_index_pattern_wizard.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/x-pack/test/functional/apps/management/create_index_pattern_wizard.js b/x-pack/test/functional/apps/management/create_index_pattern_wizard.js index ee77062e49661..187124f9edc12 100644 --- a/x-pack/test/functional/apps/management/create_index_pattern_wizard.js +++ b/x-pack/test/functional/apps/management/create_index_pattern_wizard.js @@ -33,9 +33,7 @@ export default function ({ getService, getPageObjects }) { }, }, }, - data_stream: { - timestamp_field: '@timestamp', - }, + data_stream: {}, }, });