Skip to content

Commit

Permalink
[ftr] split serverless config to speedup test run on CI (#168195)
Browse files Browse the repository at this point in the history
## Summary

After [164798](#164798) was merged
CI singnificantly slowed down because f these FTR groups:

```
x-pack/test_serverless/functional/test_suites/security/common_configs/config.group2.ts: 75.6 minutes
x-pack/test_serverless/functional/test_suites/search/common_configs/config.group2.ts: 75 minutes
x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group2.ts: 74.7 minutes
```

This PR splits each group into 3.
  • Loading branch information
dmlemeshko authored Oct 6, 2023
1 parent 6c5603c commit d05349b
Show file tree
Hide file tree
Showing 28 changed files with 179 additions and 25 deletions.
6 changes: 6 additions & 0 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -412,16 +412,22 @@ enabled:
- x-pack/test_serverless/functional/test_suites/observability/config.examples.ts
- x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group1.ts
- x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group2.ts
- x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group3.ts
- x-pack/test_serverless/functional/test_suites/observability/common_configs/config.group4.ts
- x-pack/test_serverless/functional/test_suites/observability/config.screenshots.ts
- x-pack/test_serverless/functional/test_suites/search/config.ts
- x-pack/test_serverless/functional/test_suites/search/config.examples.ts
- x-pack/test_serverless/functional/test_suites/search/config.screenshots.ts
- x-pack/test_serverless/functional/test_suites/search/common_configs/config.group1.ts
- x-pack/test_serverless/functional/test_suites/search/common_configs/config.group2.ts
- x-pack/test_serverless/functional/test_suites/search/common_configs/config.group3.ts
- x-pack/test_serverless/functional/test_suites/search/common_configs/config.group4.ts
- x-pack/test_serverless/functional/test_suites/security/config.ts
- x-pack/test_serverless/functional/test_suites/security/config.examples.ts
- x-pack/test_serverless/functional/test_suites/security/common_configs/config.group1.ts
- x-pack/test_serverless/functional/test_suites/security/common_configs/config.group2.ts
- x-pack/test_serverless/functional/test_suites/security/common_configs/config.group3.ts
- x-pack/test_serverless/functional/test_suites/security/common_configs/config.group4.ts
- x-pack/performance/journeys/ecommerce_dashboard.ts
- x-pack/performance/journeys/ecommerce_dashboard_map_only.ts
- x-pack/performance/journeys/flight_dashboard.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext
const log = getService('log');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['timePicker']);
const PageObjects = getPageObjects(['timePicker', 'svlCommonPage']);
const config = getService('config');
let remoteEsArchiver;

Expand Down Expand Up @@ -53,19 +53,21 @@ export default ({ getService, loadTestFile, getPageObjects }: FtrProviderContext
}

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);
await PageObjects.svlCommonPage.login();
// changing the timepicker default here saves us from having to set it in Discover (~8s)
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
});

after(async () => {
await esArchiver.unload(esArchive);
await PageObjects.timePicker.resetDefaultAbsoluteRangeViaUiSettings();
await PageObjects.svlCommonPage.forceLogout();
await kibanaServer.importExport.unload(fixtureDirs.lensBasic);
await kibanaServer.importExport.unload(fixtureDirs.lensDefault);
await kibanaServer.savedObjects.cleanStandardList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@
* 2.0.
*/

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

export default ({ loadTestFile, getPageObject }: FtrProviderContext) => {
const svlCommonPage = getPageObject('svlCommonPage');

describe('Visualizations', function () {
describe('Visualizations - Group 2', function () {
before(async () => {
await svlCommonPage.login();
});

loadTestFile(require.resolve('./group1'));
after(async () => {
await svlCommonPage.forceLogout();
});

loadTestFile(require.resolve('./open_in_lens/agg_based'));
loadTestFile(require.resolve('./open_in_lens/tsvb'));
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const { lens, timePicker, dashboard } = getPageObjects(['lens', 'timePicker', 'dashboard']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const { lens, timePicker, dashboard } = getPageObjects(['lens', 'timePicker', 'dashboard']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const { lens, timePicker, dashboard } = getPageObjects(['lens', 'timePicker', 'dashboard']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { EsArchiver } from '@kbn/es-archiver';
import { FtrProviderContext } from '../../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../../../ftr_provider_context';

export default function ({ loadTestFile, getService, getPageObjects }: FtrProviderContext) {
const browser = getService('browser');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const { lens, timePicker, dashboard } = getPageObjects(['lens', 'timePicker', 'dashboard']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const { lens, timePicker, dashboard } = getPageObjects(['lens', 'timePicker', 'dashboard']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const { lens, timePicker, dashboard } = getPageObjects(['lens', 'timePicker', 'dashboard']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const { lens, timePicker, dashboard } = getPageObjects(['lens', 'timePicker', 'dashboard']);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* 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 { FtrProviderContext } from '../../../../ftr_provider_context';

export default ({ loadTestFile, getPageObject }: FtrProviderContext) => {
const svlCommonPage = getPageObject('svlCommonPage');

describe('Visualizations - Group 3', function () {
before(async () => {
await svlCommonPage.login();
});

after(async () => {
await svlCommonPage.forceLogout();
});

loadTestFile(require.resolve('./open_in_lens/tsvb'));
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const { lens, timePicker, dashboard, canvas } = getPageObjects([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const { lens, timePicker, dashboard } = getPageObjects(['lens', 'timePicker', 'dashboard']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { EsArchiver } from '@kbn/es-archiver';
import { FtrProviderContext } from '../../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../../../ftr_provider_context';

export default function ({ loadTestFile, getService, getPageObjects }: FtrProviderContext) {
const browser = getService('browser');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const { lens, timePicker, dashboard } = getPageObjects(['lens', 'timePicker', 'dashboard']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const { lens, timePicker, dashboard } = getPageObjects(['lens', 'timePicker', 'dashboard']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const { lens, timePicker, dashboard } = getPageObjects(['lens', 'timePicker', 'dashboard']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../../../ftr_provider_context';
import { FtrProviderContext } from '../../../../../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const { lens, timePicker, dashboard } = getPageObjects(['lens', 'timePicker', 'dashboard']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {

return {
...baseTestConfig.getAll(),
testFiles: [require.resolve('../../common/visualizations')],
testFiles: [require.resolve('../../common/visualizations/group1')],
junit: {
reportName: 'Serverless Observability Functional Tests - Common Group 2',
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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 baseTestConfig = await readConfigFile(require.resolve('../config.ts'));

return {
...baseTestConfig.getAll(),
testFiles: [require.resolve('../../common/visualizations/group2')],
junit: {
reportName: 'Serverless Observability Functional Tests - Common Group 3',
},
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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 baseTestConfig = await readConfigFile(require.resolve('../config.ts'));

return {
...baseTestConfig.getAll(),
testFiles: [require.resolve('../../common/visualizations/group3')],
junit: {
reportName: 'Serverless Observability Functional Tests - Common Group 4',
},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {

return {
...baseTestConfig.getAll(),
testFiles: [require.resolve('../../common/visualizations')],
testFiles: [require.resolve('../../common/visualizations/group1')],
junit: {
reportName: 'Serverless Search Functional Tests - Common Group 2',
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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 baseTestConfig = await readConfigFile(require.resolve('../config.ts'));

return {
...baseTestConfig.getAll(),
testFiles: [require.resolve('../../common/visualizations/group2')],
junit: {
reportName: 'Serverless Search Functional Tests - Common Group 2',
},
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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 baseTestConfig = await readConfigFile(require.resolve('../config.ts'));

return {
...baseTestConfig.getAll(),
testFiles: [require.resolve('../../common/visualizations/group3')],
junit: {
reportName: 'Serverless Search Functional Tests - Common Group 2',
},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {

return {
...baseTestConfig.getAll(),
testFiles: [require.resolve('../../common/visualizations')],
testFiles: [require.resolve('../../common/visualizations/group1')],
junit: {
reportName: 'Serverless Security Functional Tests - Common Group 2',
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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 baseTestConfig = await readConfigFile(require.resolve('../config.ts'));

return {
...baseTestConfig.getAll(),
testFiles: [require.resolve('../../common/visualizations/group2')],
junit: {
reportName: 'Serverless Security Functional Tests - Common Group 3',
},
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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 baseTestConfig = await readConfigFile(require.resolve('../config.ts'));

return {
...baseTestConfig.getAll(),
testFiles: [require.resolve('../../common/visualizations/group3')],
junit: {
reportName: 'Serverless Security Functional Tests - Common Group 4',
},
};
}

0 comments on commit d05349b

Please sign in to comment.