From 483edea966bfdd0d801ad28d5b681ca008a45ec8 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Thu, 27 Apr 2023 20:14:41 +0200 Subject: [PATCH] [lens] split x-pack/test/functional/apps/lens/group3/config.ts into smaller groups (#155860) ## Summary Re-grouping lens functional tests into 6 groups since 2 groups often cross the 35+ min runtime. Also, we have retry in place so pipeline might have +40 minutes run if any of test fails. image x-pack/test/functional/apps/lens/group1/config.ts 18m 42s x-pack/test/functional/apps/lens/group2/config.ts 19m 26s x-pack/test/functional/apps/lens/group3/config.ts 18m 26s x-pack/test/functional/apps/lens/group4/config.ts 18m 40s x-pack/test/functional/apps/lens/group5/config.ts 17m 55s x-pack/test/functional/apps/lens/group6/config.ts 19m 24s --------- Co-authored-by: Jon --- .buildkite/ftr_configs.yml | 3 + x-pack/plugins/lens/readme.md | 3 +- .../test/functional/apps/lens/group1/index.ts | 15 +--- .../{group1 => group2}/field_formatters.ts | 0 .../lens/{group1 => group2}/fields_list.ts | 0 .../test/functional/apps/lens/group2/index.ts | 45 +++------- .../lens/{group1 => group2}/layer_actions.ts | 0 .../apps/lens/{group1 => group2}/partition.ts | 0 .../{group1 => group2}/persistent_context.ts | 0 .../apps/lens/{group1 => group2}/table.ts | 0 .../{group1 => group2}/table_dashboard.ts | 0 .../text_based_languages.ts | 0 .../{group2 => group3}/add_to_dashboard.ts | 0 .../lens/{group2 => group3}/epoch_millis.ts | 0 .../test/functional/apps/lens/group3/index.ts | 25 ++---- .../lens/{group2 => group3}/runtime_fields.ts | 0 .../apps/lens/{group2 => group3}/terms.ts | 0 .../lens/{group3 => group4}/chart_data.ts | 0 .../apps/lens/{group3 => group4}/colors.ts | 0 .../functional/apps/lens/group4/config.ts | 17 ++++ .../apps/lens/{group2 => group4}/dashboard.ts | 0 .../test/functional/apps/lens/group4/index.ts | 85 ++++++++++++++++++ .../apps/lens/{group2 => group4}/share.ts | 0 .../show_underlying_data.ts | 0 .../show_underlying_data_dashboard.ts | 0 .../lens/{group3 => group4}/time_shift.ts | 0 .../apps/lens/{group2 => group4}/tsdb.ts | 0 .../functional/apps/lens/group5/config.ts | 17 ++++ .../lens/{group3 => group5}/drag_and_drop.ts | 0 .../apps/lens/{group3 => group5}/formula.ts | 0 .../apps/lens/{group3 => group5}/gauge.ts | 0 .../apps/lens/{group3 => group5}/geo_field.ts | 0 .../apps/lens/{group3 => group5}/heatmap.ts | 0 .../test/functional/apps/lens/group5/index.ts | 81 +++++++++++++++++ .../lens/{group3 => group6}/annotations.ts | 0 .../functional/apps/lens/group6/config.ts | 17 ++++ .../{group3 => group6}/disable_auto_apply.ts | 0 .../lens/{group3 => group6}/error_handling.ts | 0 .../test/functional/apps/lens/group6/index.ts | 88 +++++++++++++++++++ .../apps/lens/{group3 => group6}/inspector.ts | 0 .../lens/{group3 => group6}/legacy_metric.ts | 0 .../lens/{group3 => group6}/lens_reporting.ts | 0 .../lens/{group3 => group6}/lens_tagging.ts | 0 .../apps/lens/{group3 => group6}/metric.ts | 0 .../apps/lens/{group3 => group6}/no_data.ts | 0 .../{group3 => group6}/reference_lines.ts | 0 .../apps/lens/{group3 => group6}/rollup.ts | 0 47 files changed, 333 insertions(+), 63 deletions(-) rename x-pack/test/functional/apps/lens/{group1 => group2}/field_formatters.ts (100%) rename x-pack/test/functional/apps/lens/{group1 => group2}/fields_list.ts (100%) rename x-pack/test/functional/apps/lens/{group1 => group2}/layer_actions.ts (100%) rename x-pack/test/functional/apps/lens/{group1 => group2}/partition.ts (100%) rename x-pack/test/functional/apps/lens/{group1 => group2}/persistent_context.ts (100%) rename x-pack/test/functional/apps/lens/{group1 => group2}/table.ts (100%) rename x-pack/test/functional/apps/lens/{group1 => group2}/table_dashboard.ts (100%) rename x-pack/test/functional/apps/lens/{group1 => group2}/text_based_languages.ts (100%) rename x-pack/test/functional/apps/lens/{group2 => group3}/add_to_dashboard.ts (100%) rename x-pack/test/functional/apps/lens/{group2 => group3}/epoch_millis.ts (100%) rename x-pack/test/functional/apps/lens/{group2 => group3}/runtime_fields.ts (100%) rename x-pack/test/functional/apps/lens/{group2 => group3}/terms.ts (100%) rename x-pack/test/functional/apps/lens/{group3 => group4}/chart_data.ts (100%) rename x-pack/test/functional/apps/lens/{group3 => group4}/colors.ts (100%) create mode 100644 x-pack/test/functional/apps/lens/group4/config.ts rename x-pack/test/functional/apps/lens/{group2 => group4}/dashboard.ts (100%) create mode 100644 x-pack/test/functional/apps/lens/group4/index.ts rename x-pack/test/functional/apps/lens/{group2 => group4}/share.ts (100%) rename x-pack/test/functional/apps/lens/{group2 => group4}/show_underlying_data.ts (100%) rename x-pack/test/functional/apps/lens/{group2 => group4}/show_underlying_data_dashboard.ts (100%) rename x-pack/test/functional/apps/lens/{group3 => group4}/time_shift.ts (100%) rename x-pack/test/functional/apps/lens/{group2 => group4}/tsdb.ts (100%) create mode 100644 x-pack/test/functional/apps/lens/group5/config.ts rename x-pack/test/functional/apps/lens/{group3 => group5}/drag_and_drop.ts (100%) rename x-pack/test/functional/apps/lens/{group3 => group5}/formula.ts (100%) rename x-pack/test/functional/apps/lens/{group3 => group5}/gauge.ts (100%) rename x-pack/test/functional/apps/lens/{group3 => group5}/geo_field.ts (100%) rename x-pack/test/functional/apps/lens/{group3 => group5}/heatmap.ts (100%) create mode 100644 x-pack/test/functional/apps/lens/group5/index.ts rename x-pack/test/functional/apps/lens/{group3 => group6}/annotations.ts (100%) create mode 100644 x-pack/test/functional/apps/lens/group6/config.ts rename x-pack/test/functional/apps/lens/{group3 => group6}/disable_auto_apply.ts (100%) rename x-pack/test/functional/apps/lens/{group3 => group6}/error_handling.ts (100%) create mode 100644 x-pack/test/functional/apps/lens/group6/index.ts rename x-pack/test/functional/apps/lens/{group3 => group6}/inspector.ts (100%) rename x-pack/test/functional/apps/lens/{group3 => group6}/legacy_metric.ts (100%) rename x-pack/test/functional/apps/lens/{group3 => group6}/lens_reporting.ts (100%) rename x-pack/test/functional/apps/lens/{group3 => group6}/lens_tagging.ts (100%) rename x-pack/test/functional/apps/lens/{group3 => group6}/metric.ts (100%) rename x-pack/test/functional/apps/lens/{group3 => group6}/no_data.ts (100%) rename x-pack/test/functional/apps/lens/{group3 => group6}/reference_lines.ts (100%) rename x-pack/test/functional/apps/lens/{group3 => group6}/rollup.ts (100%) diff --git a/.buildkite/ftr_configs.yml b/.buildkite/ftr_configs.yml index 1c466c001cb97..6c0ee435b5e20 100644 --- a/.buildkite/ftr_configs.yml +++ b/.buildkite/ftr_configs.yml @@ -252,6 +252,9 @@ enabled: - x-pack/test/functional/apps/lens/group1/config.ts - x-pack/test/functional/apps/lens/group2/config.ts - x-pack/test/functional/apps/lens/group3/config.ts + - x-pack/test/functional/apps/lens/group4/config.ts + - x-pack/test/functional/apps/lens/group5/config.ts + - x-pack/test/functional/apps/lens/group6/config.ts - x-pack/test/functional/apps/lens/open_in_lens/tsvb/config.ts - x-pack/test/functional/apps/lens/open_in_lens/agg_based/config.ts - x-pack/test/functional/apps/lens/open_in_lens/dashboard/config.ts diff --git a/x-pack/plugins/lens/readme.md b/x-pack/plugins/lens/readme.md index b3768ba0b2540..334ab844c4308 100644 --- a/x-pack/plugins/lens/readme.md +++ b/x-pack/plugins/lens/readme.md @@ -229,7 +229,8 @@ Run all tests from the `x-pack` root directory - Run `node scripts/functional_tests_server` - Run `node ../scripts/functional_test_runner.js --config ./test/functional/apps/lens/group1/config.ts` - Run `node ../scripts/functional_test_runner.js --config ./test/functional/apps/lens/group2/config.ts` - - Run `node ../scripts/functional_test_runner.js --config ./test/functional/apps/lens/group3/config.ts` + - ... + - Run `node ../scripts/functional_test_runner.js --config ./test/functional/apps/lens/group6/config.ts` - API Functional tests: - Run `node scripts/functional_tests_server` - Run `node ../scripts/functional_test_runner.js --config ./test/api_integration/config.ts --grep=Lens` diff --git a/x-pack/test/functional/apps/lens/group1/index.ts b/x-pack/test/functional/apps/lens/group1/index.ts index a129a66c519d9..67d4e8023e4fc 100644 --- a/x-pack/test/functional/apps/lens/group1/index.ts +++ b/x-pack/test/functional/apps/lens/group1/index.ts @@ -37,7 +37,7 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext }; let indexPatternString: string; before(async () => { - await log.debug('Starting lens before method'); + log.debug('Starting lens before method'); await browser.setWindowSize(1280, 1200); await kibanaServer.savedObjects.cleanStandardList(); try { @@ -74,16 +74,9 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext if (config.get('esTestCluster.ccs')) { loadTestFile(require.resolve('./smokescreen')); } else { - loadTestFile(require.resolve('./smokescreen')); - loadTestFile(require.resolve('./ad_hoc_data_view')); - loadTestFile(require.resolve('./partition')); - loadTestFile(require.resolve('./persistent_context')); - loadTestFile(require.resolve('./table_dashboard')); - loadTestFile(require.resolve('./table')); - loadTestFile(require.resolve('./text_based_languages')); - loadTestFile(require.resolve('./fields_list')); - loadTestFile(require.resolve('./layer_actions')); - loadTestFile(require.resolve('./field_formatters')); + // total run time ~16 min + loadTestFile(require.resolve('./smokescreen')); // 12m 12s + loadTestFile(require.resolve('./ad_hoc_data_view')); // 3m 40s } }); }; diff --git a/x-pack/test/functional/apps/lens/group1/field_formatters.ts b/x-pack/test/functional/apps/lens/group2/field_formatters.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group1/field_formatters.ts rename to x-pack/test/functional/apps/lens/group2/field_formatters.ts diff --git a/x-pack/test/functional/apps/lens/group1/fields_list.ts b/x-pack/test/functional/apps/lens/group2/fields_list.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group1/fields_list.ts rename to x-pack/test/functional/apps/lens/group2/fields_list.ts diff --git a/x-pack/test/functional/apps/lens/group2/index.ts b/x-pack/test/functional/apps/lens/group2/index.ts index 277b415a9ab49..18302745362ab 100644 --- a/x-pack/test/functional/apps/lens/group2/index.ts +++ b/x-pack/test/functional/apps/lens/group2/index.ts @@ -14,22 +14,14 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext const esArchiver = getService('esArchiver'); const kibanaServer = getService('kibanaServer'); const PageObjects = getPageObjects(['timePicker']); - const config = getService('config'); - let remoteEsArchiver; describe('lens app - group 2', () => { const esArchive = 'x-pack/test/functional/es_archives/logstash_functional'; const localIndexPatternString = 'logstash-*'; - const remoteIndexPatternString = 'ftr-remote:logstash-*'; const localFixtures = { lensBasic: 'x-pack/test/functional/fixtures/kbn_archiver/lens/lens_basic.json', lensDefault: 'x-pack/test/functional/fixtures/kbn_archiver/lens/default', }; - - const remoteFixtures = { - lensBasic: 'x-pack/test/functional/fixtures/kbn_archiver/lens/ccs/lens_basic.json', - lensDefault: 'x-pack/test/functional/fixtures/kbn_archiver/lens/ccs/default', - }; let esNode: EsArchiver; let fixtureDirs: { lensBasic: string; @@ -37,21 +29,12 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext }; let indexPatternString: string; before(async () => { - await log.debug('Starting lens before method'); + log.debug('Starting lens before method'); await browser.setWindowSize(1280, 1200); await kibanaServer.savedObjects.cleanStandardList(); - try { - config.get('esTestCluster.ccs'); - remoteEsArchiver = getService('remoteEsArchiver' as 'esArchiver'); - esNode = remoteEsArchiver; - fixtureDirs = remoteFixtures; - indexPatternString = remoteIndexPatternString; - } catch (error) { - esNode = esArchiver; - fixtureDirs = localFixtures; - indexPatternString = localIndexPatternString; - } - + esNode = esArchiver; + fixtureDirs = localFixtures; + indexPatternString = localIndexPatternString; await esNode.load(esArchive); // changing the timepicker default here saves us from having to set it in Discover (~8s) await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); @@ -64,21 +47,21 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext }); after(async () => { - await esArchiver.unload(esArchive); + await esNode.unload(esArchive); await PageObjects.timePicker.resetDefaultAbsoluteRangeViaUiSettings(); await kibanaServer.importExport.unload(fixtureDirs.lensBasic); await kibanaServer.importExport.unload(fixtureDirs.lensDefault); await kibanaServer.savedObjects.cleanStandardList(); }); - loadTestFile(require.resolve('./add_to_dashboard')); - loadTestFile(require.resolve('./runtime_fields')); - loadTestFile(require.resolve('./dashboard')); - loadTestFile(require.resolve('./terms')); - loadTestFile(require.resolve('./epoch_millis')); - loadTestFile(require.resolve('./show_underlying_data')); - loadTestFile(require.resolve('./show_underlying_data_dashboard')); - loadTestFile(require.resolve('./share')); - loadTestFile(require.resolve('./tsdb')); + // total run time ~ 16m 20s + loadTestFile(require.resolve('./partition')); // 1m 40s + loadTestFile(require.resolve('./persistent_context')); // 1m + loadTestFile(require.resolve('./table_dashboard')); // 3m 10s + loadTestFile(require.resolve('./table')); // 1m 40s + loadTestFile(require.resolve('./text_based_languages')); // 3m 40s + loadTestFile(require.resolve('./fields_list')); // 2m 7s + loadTestFile(require.resolve('./layer_actions')); // 1m 45s + loadTestFile(require.resolve('./field_formatters')); // 1m 30s }); }; diff --git a/x-pack/test/functional/apps/lens/group1/layer_actions.ts b/x-pack/test/functional/apps/lens/group2/layer_actions.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group1/layer_actions.ts rename to x-pack/test/functional/apps/lens/group2/layer_actions.ts diff --git a/x-pack/test/functional/apps/lens/group1/partition.ts b/x-pack/test/functional/apps/lens/group2/partition.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group1/partition.ts rename to x-pack/test/functional/apps/lens/group2/partition.ts diff --git a/x-pack/test/functional/apps/lens/group1/persistent_context.ts b/x-pack/test/functional/apps/lens/group2/persistent_context.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group1/persistent_context.ts rename to x-pack/test/functional/apps/lens/group2/persistent_context.ts diff --git a/x-pack/test/functional/apps/lens/group1/table.ts b/x-pack/test/functional/apps/lens/group2/table.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group1/table.ts rename to x-pack/test/functional/apps/lens/group2/table.ts diff --git a/x-pack/test/functional/apps/lens/group1/table_dashboard.ts b/x-pack/test/functional/apps/lens/group2/table_dashboard.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group1/table_dashboard.ts rename to x-pack/test/functional/apps/lens/group2/table_dashboard.ts diff --git a/x-pack/test/functional/apps/lens/group1/text_based_languages.ts b/x-pack/test/functional/apps/lens/group2/text_based_languages.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group1/text_based_languages.ts rename to x-pack/test/functional/apps/lens/group2/text_based_languages.ts diff --git a/x-pack/test/functional/apps/lens/group2/add_to_dashboard.ts b/x-pack/test/functional/apps/lens/group3/add_to_dashboard.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group2/add_to_dashboard.ts rename to x-pack/test/functional/apps/lens/group3/add_to_dashboard.ts diff --git a/x-pack/test/functional/apps/lens/group2/epoch_millis.ts b/x-pack/test/functional/apps/lens/group3/epoch_millis.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group2/epoch_millis.ts rename to x-pack/test/functional/apps/lens/group3/epoch_millis.ts diff --git a/x-pack/test/functional/apps/lens/group3/index.ts b/x-pack/test/functional/apps/lens/group3/index.ts index 315d905f300e9..aa2112f248f71 100644 --- a/x-pack/test/functional/apps/lens/group3/index.ts +++ b/x-pack/test/functional/apps/lens/group3/index.ts @@ -71,25 +71,10 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext await kibanaServer.savedObjects.cleanStandardList(); }); - loadTestFile(require.resolve('./colors')); - loadTestFile(require.resolve('./chart_data')); - loadTestFile(require.resolve('./time_shift')); - loadTestFile(require.resolve('./drag_and_drop')); - loadTestFile(require.resolve('./disable_auto_apply')); - loadTestFile(require.resolve('./geo_field')); - loadTestFile(require.resolve('./formula')); - loadTestFile(require.resolve('./heatmap')); - loadTestFile(require.resolve('./gauge')); - loadTestFile(require.resolve('./metric')); - loadTestFile(require.resolve('./legacy_metric')); - loadTestFile(require.resolve('./reference_lines')); - loadTestFile(require.resolve('./annotations')); - loadTestFile(require.resolve('./inspector')); - loadTestFile(require.resolve('./error_handling')); - loadTestFile(require.resolve('./lens_tagging')); - loadTestFile(require.resolve('./lens_reporting')); - // keep these two last in the group in this order because they are messing with the default saved objects - loadTestFile(require.resolve('./rollup')); - loadTestFile(require.resolve('./no_data')); + // total run time ~16 min + loadTestFile(require.resolve('./add_to_dashboard')); // 12m 50s + loadTestFile(require.resolve('./runtime_fields')); // 1m + loadTestFile(require.resolve('./terms')); // 1m 35s + loadTestFile(require.resolve('./epoch_millis')); // 30s }); }; diff --git a/x-pack/test/functional/apps/lens/group2/runtime_fields.ts b/x-pack/test/functional/apps/lens/group3/runtime_fields.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group2/runtime_fields.ts rename to x-pack/test/functional/apps/lens/group3/runtime_fields.ts diff --git a/x-pack/test/functional/apps/lens/group2/terms.ts b/x-pack/test/functional/apps/lens/group3/terms.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group2/terms.ts rename to x-pack/test/functional/apps/lens/group3/terms.ts diff --git a/x-pack/test/functional/apps/lens/group3/chart_data.ts b/x-pack/test/functional/apps/lens/group4/chart_data.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/chart_data.ts rename to x-pack/test/functional/apps/lens/group4/chart_data.ts diff --git a/x-pack/test/functional/apps/lens/group3/colors.ts b/x-pack/test/functional/apps/lens/group4/colors.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/colors.ts rename to x-pack/test/functional/apps/lens/group4/colors.ts diff --git a/x-pack/test/functional/apps/lens/group4/config.ts b/x-pack/test/functional/apps/lens/group4/config.ts new file mode 100644 index 0000000000000..d927f93adeffd --- /dev/null +++ b/x-pack/test/functional/apps/lens/group4/config.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FtrConfigProviderContext } from '@kbn/test'; + +export default async function ({ readConfigFile }: FtrConfigProviderContext) { + const functionalConfig = await readConfigFile(require.resolve('../../../config.base.js')); + + return { + ...functionalConfig.getAll(), + testFiles: [require.resolve('.')], + }; +} diff --git a/x-pack/test/functional/apps/lens/group2/dashboard.ts b/x-pack/test/functional/apps/lens/group4/dashboard.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group2/dashboard.ts rename to x-pack/test/functional/apps/lens/group4/dashboard.ts diff --git a/x-pack/test/functional/apps/lens/group4/index.ts b/x-pack/test/functional/apps/lens/group4/index.ts new file mode 100644 index 0000000000000..13cfa3fe421e1 --- /dev/null +++ b/x-pack/test/functional/apps/lens/group4/index.ts @@ -0,0 +1,85 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EsArchiver } from '@kbn/es-archiver'; +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext) => { + const browser = getService('browser'); + const log = getService('log'); + const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); + const PageObjects = getPageObjects(['timePicker']); + const config = getService('config'); + let remoteEsArchiver; + + describe('lens app - group 4', () => { + const esArchive = 'x-pack/test/functional/es_archives/logstash_functional'; + const localIndexPatternString = 'logstash-*'; + const remoteIndexPatternString = 'ftr-remote:logstash-*'; + const localFixtures = { + lensBasic: 'x-pack/test/functional/fixtures/kbn_archiver/lens/lens_basic.json', + lensDefault: 'x-pack/test/functional/fixtures/kbn_archiver/lens/default', + }; + + const remoteFixtures = { + lensBasic: 'x-pack/test/functional/fixtures/kbn_archiver/lens/ccs/lens_basic.json', + lensDefault: 'x-pack/test/functional/fixtures/kbn_archiver/lens/ccs/default', + }; + let esNode: EsArchiver; + let fixtureDirs: { + lensBasic: string; + lensDefault: string; + }; + let indexPatternString: string; + before(async () => { + await log.debug('Starting lens before method'); + await browser.setWindowSize(1280, 1200); + await kibanaServer.savedObjects.cleanStandardList(); + try { + config.get('esTestCluster.ccs'); + remoteEsArchiver = getService('remoteEsArchiver' as 'esArchiver'); + esNode = remoteEsArchiver; + fixtureDirs = remoteFixtures; + indexPatternString = remoteIndexPatternString; + } catch (error) { + esNode = esArchiver; + fixtureDirs = localFixtures; + indexPatternString = localIndexPatternString; + } + + await esNode.load(esArchive); + // changing the timepicker default here saves us from having to set it in Discover (~8s) + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); + await kibanaServer.uiSettings.update({ + defaultIndex: indexPatternString, + 'dateFormat:tz': 'UTC', + }); + await kibanaServer.importExport.load(fixtureDirs.lensBasic); + await kibanaServer.importExport.load(fixtureDirs.lensDefault); + }); + + after(async () => { + await esArchiver.unload(esArchive); + await PageObjects.timePicker.resetDefaultAbsoluteRangeViaUiSettings(); + await kibanaServer.importExport.unload(fixtureDirs.lensBasic); + await kibanaServer.importExport.unload(fixtureDirs.lensDefault); + await kibanaServer.savedObjects.cleanStandardList(); + }); + + // total run time ~16m 30s + loadTestFile(require.resolve('./colors')); // 1m 2s + loadTestFile(require.resolve('./chart_data')); // 1m 10s + loadTestFile(require.resolve('./time_shift')); // 1m + loadTestFile(require.resolve('./dashboard')); // 6m 45s + loadTestFile(require.resolve('./show_underlying_data')); // 2m + loadTestFile(require.resolve('./show_underlying_data_dashboard')); // 2m 10s + loadTestFile(require.resolve('./share')); // 1m 20s + // keep it last in the group + loadTestFile(require.resolve('./tsdb')); // 1m + }); +}; diff --git a/x-pack/test/functional/apps/lens/group2/share.ts b/x-pack/test/functional/apps/lens/group4/share.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group2/share.ts rename to x-pack/test/functional/apps/lens/group4/share.ts diff --git a/x-pack/test/functional/apps/lens/group2/show_underlying_data.ts b/x-pack/test/functional/apps/lens/group4/show_underlying_data.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group2/show_underlying_data.ts rename to x-pack/test/functional/apps/lens/group4/show_underlying_data.ts diff --git a/x-pack/test/functional/apps/lens/group2/show_underlying_data_dashboard.ts b/x-pack/test/functional/apps/lens/group4/show_underlying_data_dashboard.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group2/show_underlying_data_dashboard.ts rename to x-pack/test/functional/apps/lens/group4/show_underlying_data_dashboard.ts diff --git a/x-pack/test/functional/apps/lens/group3/time_shift.ts b/x-pack/test/functional/apps/lens/group4/time_shift.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/time_shift.ts rename to x-pack/test/functional/apps/lens/group4/time_shift.ts diff --git a/x-pack/test/functional/apps/lens/group2/tsdb.ts b/x-pack/test/functional/apps/lens/group4/tsdb.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group2/tsdb.ts rename to x-pack/test/functional/apps/lens/group4/tsdb.ts diff --git a/x-pack/test/functional/apps/lens/group5/config.ts b/x-pack/test/functional/apps/lens/group5/config.ts new file mode 100644 index 0000000000000..d927f93adeffd --- /dev/null +++ b/x-pack/test/functional/apps/lens/group5/config.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FtrConfigProviderContext } from '@kbn/test'; + +export default async function ({ readConfigFile }: FtrConfigProviderContext) { + const functionalConfig = await readConfigFile(require.resolve('../../../config.base.js')); + + return { + ...functionalConfig.getAll(), + testFiles: [require.resolve('.')], + }; +} diff --git a/x-pack/test/functional/apps/lens/group3/drag_and_drop.ts b/x-pack/test/functional/apps/lens/group5/drag_and_drop.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/drag_and_drop.ts rename to x-pack/test/functional/apps/lens/group5/drag_and_drop.ts diff --git a/x-pack/test/functional/apps/lens/group3/formula.ts b/x-pack/test/functional/apps/lens/group5/formula.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/formula.ts rename to x-pack/test/functional/apps/lens/group5/formula.ts diff --git a/x-pack/test/functional/apps/lens/group3/gauge.ts b/x-pack/test/functional/apps/lens/group5/gauge.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/gauge.ts rename to x-pack/test/functional/apps/lens/group5/gauge.ts diff --git a/x-pack/test/functional/apps/lens/group3/geo_field.ts b/x-pack/test/functional/apps/lens/group5/geo_field.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/geo_field.ts rename to x-pack/test/functional/apps/lens/group5/geo_field.ts diff --git a/x-pack/test/functional/apps/lens/group3/heatmap.ts b/x-pack/test/functional/apps/lens/group5/heatmap.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/heatmap.ts rename to x-pack/test/functional/apps/lens/group5/heatmap.ts diff --git a/x-pack/test/functional/apps/lens/group5/index.ts b/x-pack/test/functional/apps/lens/group5/index.ts new file mode 100644 index 0000000000000..5dabfd4a71499 --- /dev/null +++ b/x-pack/test/functional/apps/lens/group5/index.ts @@ -0,0 +1,81 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EsArchiver } from '@kbn/es-archiver'; +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext) => { + const browser = getService('browser'); + const log = getService('log'); + const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); + const PageObjects = getPageObjects(['timePicker']); + const config = getService('config'); + let remoteEsArchiver; + + describe('lens app - group 5', () => { + const esArchive = 'x-pack/test/functional/es_archives/logstash_functional'; + const localIndexPatternString = 'logstash-*'; + const remoteIndexPatternString = 'ftr-remote:logstash-*'; + const localFixtures = { + lensBasic: 'x-pack/test/functional/fixtures/kbn_archiver/lens/lens_basic.json', + lensDefault: 'x-pack/test/functional/fixtures/kbn_archiver/lens/default', + }; + + const remoteFixtures = { + lensBasic: 'x-pack/test/functional/fixtures/kbn_archiver/lens/ccs/lens_basic.json', + lensDefault: 'x-pack/test/functional/fixtures/kbn_archiver/lens/ccs/default', + }; + let esNode: EsArchiver; + let fixtureDirs: { + lensBasic: string; + lensDefault: string; + }; + let indexPatternString: string; + before(async () => { + log.debug('Starting lens before method'); + await browser.setWindowSize(1280, 1200); + await kibanaServer.savedObjects.cleanStandardList(); + try { + config.get('esTestCluster.ccs'); + remoteEsArchiver = getService('remoteEsArchiver' as 'esArchiver'); + esNode = remoteEsArchiver; + fixtureDirs = remoteFixtures; + indexPatternString = remoteIndexPatternString; + } catch (error) { + esNode = esArchiver; + fixtureDirs = localFixtures; + indexPatternString = localIndexPatternString; + } + + await esNode.load(esArchive); + // changing the timepicker default here saves us from having to set it in Discover (~8s) + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); + await kibanaServer.uiSettings.update({ + defaultIndex: indexPatternString, + 'dateFormat:tz': 'UTC', + }); + await kibanaServer.importExport.load(fixtureDirs.lensBasic); + await kibanaServer.importExport.load(fixtureDirs.lensDefault); + }); + + after(async () => { + await esArchiver.unload(esArchive); + await PageObjects.timePicker.resetDefaultAbsoluteRangeViaUiSettings(); + await kibanaServer.importExport.unload(fixtureDirs.lensBasic); + await kibanaServer.importExport.unload(fixtureDirs.lensDefault); + await kibanaServer.savedObjects.cleanStandardList(); + }); + + // total run time ~ 16m + loadTestFile(require.resolve('./drag_and_drop')); // 7m 40s + loadTestFile(require.resolve('./geo_field')); // 26s + loadTestFile(require.resolve('./formula')); // 5m 52s + loadTestFile(require.resolve('./heatmap')); // 51s + loadTestFile(require.resolve('./gauge')); // 1m 17s + }); +}; diff --git a/x-pack/test/functional/apps/lens/group3/annotations.ts b/x-pack/test/functional/apps/lens/group6/annotations.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/annotations.ts rename to x-pack/test/functional/apps/lens/group6/annotations.ts diff --git a/x-pack/test/functional/apps/lens/group6/config.ts b/x-pack/test/functional/apps/lens/group6/config.ts new file mode 100644 index 0000000000000..d927f93adeffd --- /dev/null +++ b/x-pack/test/functional/apps/lens/group6/config.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FtrConfigProviderContext } from '@kbn/test'; + +export default async function ({ readConfigFile }: FtrConfigProviderContext) { + const functionalConfig = await readConfigFile(require.resolve('../../../config.base.js')); + + return { + ...functionalConfig.getAll(), + testFiles: [require.resolve('.')], + }; +} diff --git a/x-pack/test/functional/apps/lens/group3/disable_auto_apply.ts b/x-pack/test/functional/apps/lens/group6/disable_auto_apply.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/disable_auto_apply.ts rename to x-pack/test/functional/apps/lens/group6/disable_auto_apply.ts diff --git a/x-pack/test/functional/apps/lens/group3/error_handling.ts b/x-pack/test/functional/apps/lens/group6/error_handling.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/error_handling.ts rename to x-pack/test/functional/apps/lens/group6/error_handling.ts diff --git a/x-pack/test/functional/apps/lens/group6/index.ts b/x-pack/test/functional/apps/lens/group6/index.ts new file mode 100644 index 0000000000000..bc59c2878805e --- /dev/null +++ b/x-pack/test/functional/apps/lens/group6/index.ts @@ -0,0 +1,88 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EsArchiver } from '@kbn/es-archiver'; +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext) => { + const browser = getService('browser'); + const log = getService('log'); + const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); + const PageObjects = getPageObjects(['timePicker']); + const config = getService('config'); + let remoteEsArchiver; + + describe('lens app - group 6', () => { + const esArchive = 'x-pack/test/functional/es_archives/logstash_functional'; + const localIndexPatternString = 'logstash-*'; + const remoteIndexPatternString = 'ftr-remote:logstash-*'; + const localFixtures = { + lensBasic: 'x-pack/test/functional/fixtures/kbn_archiver/lens/lens_basic.json', + lensDefault: 'x-pack/test/functional/fixtures/kbn_archiver/lens/default', + }; + + const remoteFixtures = { + lensBasic: 'x-pack/test/functional/fixtures/kbn_archiver/lens/ccs/lens_basic.json', + lensDefault: 'x-pack/test/functional/fixtures/kbn_archiver/lens/ccs/default', + }; + let esNode: EsArchiver; + let fixtureDirs: { + lensBasic: string; + lensDefault: string; + }; + let indexPatternString: string; + before(async () => { + log.debug('Starting lens before method'); + await browser.setWindowSize(1280, 1200); + await kibanaServer.savedObjects.cleanStandardList(); + try { + config.get('esTestCluster.ccs'); + remoteEsArchiver = getService('remoteEsArchiver' as 'esArchiver'); + esNode = remoteEsArchiver; + fixtureDirs = remoteFixtures; + indexPatternString = remoteIndexPatternString; + } catch (error) { + esNode = esArchiver; + fixtureDirs = localFixtures; + indexPatternString = localIndexPatternString; + } + + await esNode.load(esArchive); + // changing the timepicker default here saves us from having to set it in Discover (~8s) + await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings(); + await kibanaServer.uiSettings.update({ + defaultIndex: indexPatternString, + 'dateFormat:tz': 'UTC', + }); + await kibanaServer.importExport.load(fixtureDirs.lensBasic); + await kibanaServer.importExport.load(fixtureDirs.lensDefault); + }); + + after(async () => { + await esArchiver.unload(esArchive); + await PageObjects.timePicker.resetDefaultAbsoluteRangeViaUiSettings(); + await kibanaServer.importExport.unload(fixtureDirs.lensBasic); + await kibanaServer.importExport.unload(fixtureDirs.lensDefault); + await kibanaServer.savedObjects.cleanStandardList(); + }); + + // total run time ~16m + loadTestFile(require.resolve('./metric')); // 4m 7s + loadTestFile(require.resolve('./legacy_metric')); // 29s + loadTestFile(require.resolve('./disable_auto_apply')); // 1m 6s + loadTestFile(require.resolve('./reference_lines')); // 1m + loadTestFile(require.resolve('./annotations')); // 1m + loadTestFile(require.resolve('./inspector')); // 1m 19s + loadTestFile(require.resolve('./error_handling')); // 1m 8s + loadTestFile(require.resolve('./lens_tagging')); // 1m 9s + loadTestFile(require.resolve('./lens_reporting')); // 3m + // keep these two last in the group in this order because they are messing with the default saved objects + loadTestFile(require.resolve('./rollup')); // 1m 30s + loadTestFile(require.resolve('./no_data')); // 36s + }); +}; diff --git a/x-pack/test/functional/apps/lens/group3/inspector.ts b/x-pack/test/functional/apps/lens/group6/inspector.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/inspector.ts rename to x-pack/test/functional/apps/lens/group6/inspector.ts diff --git a/x-pack/test/functional/apps/lens/group3/legacy_metric.ts b/x-pack/test/functional/apps/lens/group6/legacy_metric.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/legacy_metric.ts rename to x-pack/test/functional/apps/lens/group6/legacy_metric.ts diff --git a/x-pack/test/functional/apps/lens/group3/lens_reporting.ts b/x-pack/test/functional/apps/lens/group6/lens_reporting.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/lens_reporting.ts rename to x-pack/test/functional/apps/lens/group6/lens_reporting.ts diff --git a/x-pack/test/functional/apps/lens/group3/lens_tagging.ts b/x-pack/test/functional/apps/lens/group6/lens_tagging.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/lens_tagging.ts rename to x-pack/test/functional/apps/lens/group6/lens_tagging.ts diff --git a/x-pack/test/functional/apps/lens/group3/metric.ts b/x-pack/test/functional/apps/lens/group6/metric.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/metric.ts rename to x-pack/test/functional/apps/lens/group6/metric.ts diff --git a/x-pack/test/functional/apps/lens/group3/no_data.ts b/x-pack/test/functional/apps/lens/group6/no_data.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/no_data.ts rename to x-pack/test/functional/apps/lens/group6/no_data.ts diff --git a/x-pack/test/functional/apps/lens/group3/reference_lines.ts b/x-pack/test/functional/apps/lens/group6/reference_lines.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/reference_lines.ts rename to x-pack/test/functional/apps/lens/group6/reference_lines.ts diff --git a/x-pack/test/functional/apps/lens/group3/rollup.ts b/x-pack/test/functional/apps/lens/group6/rollup.ts similarity index 100% rename from x-pack/test/functional/apps/lens/group3/rollup.ts rename to x-pack/test/functional/apps/lens/group6/rollup.ts