Skip to content

Commit

Permalink
[ftr] split dashboard_elements/config to speedup CI run (#160550)
Browse files Browse the repository at this point in the history
## Summary

Splitting FTR config as it consistently takes over 37 minutes to run.

This PR splits it into 5 smaller configs:

- test/functional/apps/dashboard_elements/controls/common/config.ts 15m
24s
-
test/functional/apps/dashboard_elements/controls/options_list/config.ts
17m 38s
- test/functional/apps/dashboard_elements/image_embeddable/config.ts 2m
14s
- test/functional/apps/dashboard_elements/input_control_vis/config.ts 4m
41s
- test/functional/apps/dashboard_elements/markdown/config.ts 1m 24s
  • Loading branch information
dmlemeshko authored Jun 28, 2023
1 parent 1223c3f commit 599bbac
Show file tree
Hide file tree
Showing 17 changed files with 137 additions and 53 deletions.
6 changes: 5 additions & 1 deletion .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ enabled:
- test/functional/apps/bundles/config.ts
- test/functional/apps/console/config.ts
- test/functional/apps/context/config.ts
- test/functional/apps/dashboard_elements/config.ts
- test/functional/apps/dashboard_elements/controls/common/config.ts
- test/functional/apps/dashboard_elements/controls/options_list/config.ts
- test/functional/apps/dashboard_elements/image_embeddable/config.ts
- test/functional/apps/dashboard_elements/input_control_vis/config.ts
- test/functional/apps/dashboard_elements/markdown/config.ts
- test/functional/apps/dashboard/group1/config.ts
- test/functional/apps/dashboard/group2/config.ts
- test/functional/apps/dashboard/group3/config.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@
import { FtrConfigProviderContext } from '@kbn/test';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(require.resolve('../../config.base.js'));
const functionalConfig = await readConfigFile(require.resolve('../../../../config.base.js'));

return {
...functionalConfig.getAll(),
testFiles: [require.resolve('.')],
junit: {
reportName: 'Dashboard Elements - Controls tests',
},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { pick } from 'lodash';
import expect from '@kbn/expect';
import { OPTIONS_LIST_CONTROL } from '@kbn/controls-plugin/common';

import { OPTIONS_LIST_ANIMAL_SOUND_SUGGESTIONS } from '../../../page_objects/dashboard_page_controls';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { OPTIONS_LIST_ANIMAL_SOUND_SUGGESTIONS } from '../../../../page_objects/dashboard_page_controls';
import { FtrProviderContext } from '../../../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { OPTIONS_LIST_CONTROL } from '@kbn/controls-plugin/common';
import expect from '@kbn/expect';

import { FtrProviderContext } from '../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { FtrProviderContext } from '../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../ftr_provider_context';

export default function ({ loadTestFile, getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
Expand Down Expand Up @@ -47,7 +47,6 @@ export default function ({ loadTestFile, getService, getPageObjects }: FtrProvid
before(setup);
after(teardown);
loadTestFile(require.resolve('./control_group_settings'));
loadTestFile(require.resolve('./options_list'));
loadTestFile(require.resolve('./range_slider'));
loadTestFile(require.resolve('./time_slider'));
loadTestFile(require.resolve('./control_group_chaining'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { RANGE_SLIDER_CONTROL } from '@kbn/controls-plugin/common';
import expect from '@kbn/expect';

import { FtrProviderContext } from '../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import expect from '@kbn/expect';
import { OPTIONS_LIST_CONTROL, RANGE_SLIDER_CONTROL } from '@kbn/controls-plugin/common';

import { FtrProviderContext } from '../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { RANGE_SLIDER_CONTROL } from '@kbn/controls-plugin/common';
import expect from '@kbn/expect';

import { FtrProviderContext } from '../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

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('.')],
junit: {
reportName: 'Dashboard Elements - Controls Options List tests',
},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,22 @@ export const OPTIONS_LIST_DASHBOARD_NAME = 'Test Options List Control';

export default function ({ loadTestFile, getService, getPageObjects }: FtrProviderContext) {
const elasticChart = getService('elasticChart');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const security = getService('security');

const { timePicker, dashboard, common } = getPageObjects(['timePicker', 'dashboard', 'common']);

const setup = async () => {
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/dashboard/current/data');
await kibanaServer.savedObjects.cleanStandardList();
await kibanaServer.importExport.load(
'test/functional/fixtures/kbn_archiver/dashboard/current/kibana'
);
await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader', 'animals']);
await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
});

await common.navigateToApp('dashboard');
await dashboard.gotoDashboardLandingPage();
Expand All @@ -31,7 +41,9 @@ export default function ({ loadTestFile, getService, getPageObjects }: FtrProvid
};

const teardown = async () => {
await esArchiver.unload('test/functional/fixtures/es_archiver/dashboard/current/data');
await security.testUser.restoreDefaults();
await kibanaServer.savedObjects.cleanStandardList();
};

describe('Options list control', async () => {
Expand Down
21 changes: 21 additions & 0 deletions test/functional/apps/dashboard_elements/image_embeddable/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

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('.')],
junit: {
reportName: 'Dashboard Elements - Image Embeddable tests',
},
};
}
40 changes: 0 additions & 40 deletions test/functional/apps/dashboard_elements/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

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('.')],
junit: {
reportName: 'Dashboard Elements - Input Controls tests',
},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,26 @@

import { FtrProviderContext } from '../../../ftr_provider_context';

export default function ({ loadTestFile }: FtrProviderContext) {
export default function ({ getService, loadTestFile }: FtrProviderContext) {
const browser = getService('browser');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');

describe('input controls', function () {
before(async () => {
await browser.setWindowSize(1280, 800);
await kibanaServer.savedObjects.cleanStandardList();

await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/long_window_logstash');
});

after(async () => {
await kibanaServer.savedObjects.cleanStandardList();
await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
await esArchiver.unload('test/functional/fixtures/es_archiver/long_window_logstash');
});

loadTestFile(require.resolve('./input_control_options'));
loadTestFile(require.resolve('./dynamic_options'));
loadTestFile(require.resolve('./chained_controls'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import expect from '@kbn/expect';

import { FtrProviderContext } from '../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['visualize', 'visEditor', 'visChart', 'header']);
Expand Down
21 changes: 21 additions & 0 deletions test/functional/apps/dashboard_elements/markdown/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

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('./_markdown_vis')],
junit: {
reportName: 'Dashboard Elements - Markdown tests',
},
};
}
6 changes: 5 additions & 1 deletion test/functional/firefox/dashboard.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {

testFiles: [
require.resolve('../apps/dashboard/group4/dashboard_save'),
require.resolve('../apps/dashboard_elements'),
require.resolve('../apps/dashboard_elements/controls/common'),
require.resolve('../apps/dashboard_elements/controls/options_list'),
require.resolve('../apps/dashboard_elements/image_embeddable'),
require.resolve('../apps/dashboard_elements/input_control_vis'),
require.resolve('../apps/dashboard_elements/markdown/_markdown_vis.ts'),
],

junit: {
Expand Down

0 comments on commit 599bbac

Please sign in to comment.