Skip to content

Commit

Permalink
[8.7] [lens] split x-pack/test/functional/apps/lens/group3/config.ts …
Browse files Browse the repository at this point in the history
…into smaller groups (#155860) (#156290)

# Backport

This will backport the following commits from `main` to `8.7`:
- [[lens] split x-pack/test/functional/apps/lens/group3/config.ts into
smaller groups (#155860)](#155860)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dzmitry
Lemechko","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-04-27T18:14:41Z","message":"[lens]
split x-pack/test/functional/apps/lens/group3/config.ts into smaller
groups (#155860)\n\n## Summary\r\n\r\n\r\nRe-grouping lens functional
tests into 6 groups since 2 groups often\r\ncross the 35+ min runtime.
Also, we have retry in place so pipeline\r\nmight have +40 minutes run
if any of test fails.\r\n\r\n<img width=\"1354\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/10977896/234843379-aec47a81-22dc-4ecf-aee5-b1d489b3b31f.png\">\r\n\r\nx-pack/test/functional/apps/lens/group1/config.ts
18m 42s\r\nx-pack/test/functional/apps/lens/group2/config.ts 19m
26s\r\nx-pack/test/functional/apps/lens/group3/config.ts 18m
26s\r\nx-pack/test/functional/apps/lens/group4/config.ts 18m
40s\r\nx-pack/test/functional/apps/lens/group5/config.ts 17m
55s\r\nx-pack/test/functional/apps/lens/group6/config.ts 19m
24s\r\n\r\n---------\r\n\r\nCo-authored-by: Jon
<[email protected]>","sha":"483edea966bfdd0d801ad28d5b681ca008a45ec8","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v8.8.0","v8.7.2","v8.9.0"],"number":155860,"url":"https://github.com/elastic/kibana/pull/155860","mergeCommit":{"message":"[lens]
split x-pack/test/functional/apps/lens/group3/config.ts into smaller
groups (#155860)\n\n## Summary\r\n\r\n\r\nRe-grouping lens functional
tests into 6 groups since 2 groups often\r\ncross the 35+ min runtime.
Also, we have retry in place so pipeline\r\nmight have +40 minutes run
if any of test fails.\r\n\r\n<img width=\"1354\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/10977896/234843379-aec47a81-22dc-4ecf-aee5-b1d489b3b31f.png\">\r\n\r\nx-pack/test/functional/apps/lens/group1/config.ts
18m 42s\r\nx-pack/test/functional/apps/lens/group2/config.ts 19m
26s\r\nx-pack/test/functional/apps/lens/group3/config.ts 18m
26s\r\nx-pack/test/functional/apps/lens/group4/config.ts 18m
40s\r\nx-pack/test/functional/apps/lens/group5/config.ts 17m
55s\r\nx-pack/test/functional/apps/lens/group6/config.ts 19m
24s\r\n\r\n---------\r\n\r\nCo-authored-by: Jon
<[email protected]>","sha":"483edea966bfdd0d801ad28d5b681ca008a45ec8"}},"sourceBranch":"main","suggestedTargetBranches":["8.7"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/156075","number":156075,"state":"MERGED","mergeCommit":{"sha":"1a79030dbf17b08eb893e3bd7812e7b849a668bc","message":"[8.8]
[lens] split x-pack/test/functional/apps/lens/group3/config.ts into
smaller groups (#155860) (#156075)\n\n# Backport\n\nThis will backport
the following commits from `main` to `8.8`:\n- [[lens] split
x-pack/test/functional/apps/lens/group3/config.ts into\nsmaller groups
(#155860)](https://github.com/elastic/kibana/pull/155860)\n\n<!---
Backport version: 8.9.7 -->\n\n### Questions ?\nPlease refer to the
[Backport
tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT
[{\"author\":{\"name\":\"Dzmitry\nLemechko\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2023-04-27T18:14:41Z\",\"message\":\"[lens]\nsplit
x-pack/test/functional/apps/lens/group3/config.ts into smaller\ngroups
(#155860)\\n\\n## Summary\\r\\n\\r\\n\\r\\nRe-grouping lens
functional\ntests into 6 groups since 2 groups often\\r\\ncross the 35+
min runtime.\nAlso, we have retry in place so pipeline\\r\\nmight have
+40 minutes run\nif any of test fails.\\r\\n\\r\\n<img
width=\\\"1354\\\"\nalt=\\\"image\\\"\\r\\nsrc=\\\"https://user-images.githubusercontent.com/10977896/234843379-aec47a81-22dc-4ecf-aee5-b1d489b3b31f.png\\\">\\r\\n\\r\\nx-pack/test/functional/apps/lens/group1/config.ts\n18m
42s\\r\\nx-pack/test/functional/apps/lens/group2/config.ts
19m\n26s\\r\\nx-pack/test/functional/apps/lens/group3/config.ts
18m\n26s\\r\\nx-pack/test/functional/apps/lens/group4/config.ts
18m\n40s\\r\\nx-pack/test/functional/apps/lens/group5/config.ts
17m\n55s\\r\\nx-pack/test/functional/apps/lens/group6/config.ts
19m\n24s\\r\\n\\r\\n---------\\r\\n\\r\\nCo-authored-by:
Jon\n<[email protected]>\",\"sha\":\"483edea966bfdd0d801ad28d5b681ca008a45ec8\",\"branchLabelMapping\":{\"^v8.9.0$\":\"main\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"release_note:skip\",\"v8.8.0\",\"v8.7.2\",\"v8.9.0\"],\"number\":155860,\"url\":\"https://github.com/elastic/kibana/pull/155860\",\"mergeCommit\":{\"message\":\"[lens]\nsplit
x-pack/test/functional/apps/lens/group3/config.ts into smaller\ngroups
(#155860)\\n\\n## Summary\\r\\n\\r\\n\\r\\nRe-grouping lens
functional\ntests into 6 groups since 2 groups often\\r\\ncross the 35+
min runtime.\nAlso, we have retry in place so pipeline\\r\\nmight have
+40 minutes run\nif any of test fails.\\r\\n\\r\\n<img
width=\\\"1354\\\"\nalt=\\\"image\\\"\\r\\nsrc=\\\"https://user-images.githubusercontent.com/10977896/234843379-aec47a81-22dc-4ecf-aee5-b1d489b3b31f.png\\\">\\r\\n\\r\\nx-pack/test/functional/apps/lens/group1/config.ts\n18m
42s\\r\\nx-pack/test/functional/apps/lens/group2/config.ts
19m\n26s\\r\\nx-pack/test/functional/apps/lens/group3/config.ts
18m\n26s\\r\\nx-pack/test/functional/apps/lens/group4/config.ts
18m\n40s\\r\\nx-pack/test/functional/apps/lens/group5/config.ts
17m\n55s\\r\\nx-pack/test/functional/apps/lens/group6/config.ts
19m\n24s\\r\\n\\r\\n---------\\r\\n\\r\\nCo-authored-by:
Jon\n<[email protected]>\",\"sha\":\"483edea966bfdd0d801ad28d5b681ca008a45ec8\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[\"8.8\",\"8.7\"],\"targetPullRequestStates\":[{\"branch\":\"8.8\",\"label\":\"v8.8.0\",\"labelRegex\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"},{\"branch\":\"8.7\",\"label\":\"v8.7.2\",\"labelRegex\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"},{\"branch\":\"main\",\"label\":\"v8.9.0\",\"labelRegex\":\"^v8.9.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/155860\",\"number\":155860,\"mergeCommit\":{\"message\":\"[lens]\nsplit
x-pack/test/functional/apps/lens/group3/config.ts into smaller\ngroups
(#155860)\\n\\n## Summary\\r\\n\\r\\n\\r\\nRe-grouping lens
functional\ntests into 6 groups since 2 groups often\\r\\ncross the 35+
min runtime.\nAlso, we have retry in place so pipeline\\r\\nmight have
+40 minutes run\nif any of test fails.\\r\\n\\r\\n<img
width=\\\"1354\\\"\nalt=\\\"image\\\"\\r\\nsrc=\\\"https://user-images.githubusercontent.com/10977896/234843379-aec47a81-22dc-4ecf-aee5-b1d489b3b31f.png\\\">\\r\\n\\r\\nx-pack/test/functional/apps/lens/group1/config.ts\n18m
42s\\r\\nx-pack/test/functional/apps/lens/group2/config.ts
19m\n26s\\r\\nx-pack/test/functional/apps/lens/group3/config.ts
18m\n26s\\r\\nx-pack/test/functional/apps/lens/group4/config.ts
18m\n40s\\r\\nx-pack/test/functional/apps/lens/group5/config.ts
17m\n55s\\r\\nx-pack/test/functional/apps/lens/group6/config.ts
19m\n24s\\r\\n\\r\\n---------\\r\\n\\r\\nCo-authored-by:
Jon\n<[email protected]>\",\"sha\":\"483edea966bfdd0d801ad28d5b681ca008a45ec8\"}}]}]\nBACKPORT-->\n\nCo-authored-by:
Dzmitry Lemechko
<[email protected]>"}},{"branch":"8.7","label":"v8.7.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/155860","number":155860,"mergeCommit":{"message":"[lens]
split x-pack/test/functional/apps/lens/group3/config.ts into smaller
groups (#155860)\n\n## Summary\r\n\r\n\r\nRe-grouping lens functional
tests into 6 groups since 2 groups often\r\ncross the 35+ min runtime.
Also, we have retry in place so pipeline\r\nmight have +40 minutes run
if any of test fails.\r\n\r\n<img width=\"1354\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/10977896/234843379-aec47a81-22dc-4ecf-aee5-b1d489b3b31f.png\">\r\n\r\nx-pack/test/functional/apps/lens/group1/config.ts
18m 42s\r\nx-pack/test/functional/apps/lens/group2/config.ts 19m
26s\r\nx-pack/test/functional/apps/lens/group3/config.ts 18m
26s\r\nx-pack/test/functional/apps/lens/group4/config.ts 18m
40s\r\nx-pack/test/functional/apps/lens/group5/config.ts 17m
55s\r\nx-pack/test/functional/apps/lens/group6/config.ts 19m
24s\r\n\r\n---------\r\n\r\nCo-authored-by: Jon
<[email protected]>","sha":"483edea966bfdd0d801ad28d5b681ca008a45ec8"}}]}]
BACKPORT-->
  • Loading branch information
dmlemeshko authored May 2, 2023
1 parent f5da0d9 commit 87e97e5
Show file tree
Hide file tree
Showing 46 changed files with 332 additions and 62 deletions.
3 changes: 3 additions & 0 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,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
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugins/lens/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,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`
Expand Down
14 changes: 4 additions & 10 deletions x-pack/test/functional/apps/lens/group1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -74,15 +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'));
// total run time ~16 min
loadTestFile(require.resolve('./smokescreen')); // 12m 12s
loadTestFile(require.resolve('./ad_hoc_data_view')); // 3m 40s
}
});
};
44 changes: 13 additions & 31 deletions x-pack/test/functional/apps/lens/group2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,27 @@ 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;
lensDefault: string;
};
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();
Expand All @@ -64,21 +47,20 @@ 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 ~ 15m
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
});
};
25 changes: 5 additions & 20 deletions x-pack/test/functional/apps/lens/group3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
};
17 changes: 17 additions & 0 deletions x-pack/test/functional/apps/lens/group4/config.ts
Original file line number Diff line number Diff line change
@@ -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('.')],
};
}
85 changes: 85 additions & 0 deletions x-pack/test/functional/apps/lens/group4/index.ts
Original file line number Diff line number Diff line change
@@ -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
});
};
17 changes: 17 additions & 0 deletions x-pack/test/functional/apps/lens/group5/config.ts
Original file line number Diff line number Diff line change
@@ -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('.')],
};
}
81 changes: 81 additions & 0 deletions x-pack/test/functional/apps/lens/group5/index.ts
Original file line number Diff line number Diff line change
@@ -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
});
};
17 changes: 17 additions & 0 deletions x-pack/test/functional/apps/lens/group6/config.ts
Original file line number Diff line number Diff line change
@@ -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('.')],
};
}
Loading

0 comments on commit 87e97e5

Please sign in to comment.