Skip to content

Commit

Permalink
[ftr tests] split x-pack functional_with_es_ssl config (#150416)
Browse files Browse the repository at this point in the history
## Summary

Splitting config as it takes over 40 minutes into smaller ones to
speedup CI

```
The following "Functional Tests" configs have durations that exceed the maximum amount of time desired for a single CI job. This is not an error, and if you don't own any of these configs then you can ignore this warning.If you own any of these configs please split them up ASAP and ask Operations if you have questions about how to do that.

x-pack/test/functional_with_es_ssl/config.ts: 40.6 minutes
```

Quick tests execution time
[analysis](https://buildkite.com/elastic/kibana-pull-request/builds/105995#01862b40-f797-4537-9e05-a56453173b6d):

/apps/triggers_actions_ui ~ 13 min
09:01:15 CEST - 09:14:10 CEST

/apps/discover ~ 6 min
09:14:10 CEST - 09:20:21 CEST

/apps/uptime. ~ 2 min
09:20:21 CEST - 09:22:08 CEST

/apps/ml ~1 min
09:22:08 CEST - 09:22:57 CEST

/apps/cases ~ 17 min
09:23:02 CEST - 09:40:19 CEST

Splitting into 3 groups:
x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/config.ts
12m 46s
x-pack/test/functional_with_es_ssl/apps/cases/config.ts 18m 07s
x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/config.ts 10m
38s

Splitting cases/config into 2 groups:
x-pack/test/functional_with_es_ssl/apps/cases/group1/config.ts 10m 18s
x-pack/test/functional_with_es_ssl/apps/cases/group2/config.ts 8m 58s
  • Loading branch information
dmlemeshko authored Feb 8, 2023
1 parent 0648296 commit c190a5f
Show file tree
Hide file tree
Showing 23 changed files with 137 additions and 42 deletions.
6 changes: 5 additions & 1 deletion .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ disabled:
- x-pack/test/functional_enterprise_search/base_config.ts
- x-pack/test/localization/config.base.ts
- test/server_integration/config.base.js
- x-pack/test/functional_with_es_ssl/config.base.ts

# QA suites that are run out-of-band
- x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js
Expand Down Expand Up @@ -180,7 +181,10 @@ enabled:
- x-pack/test/functional_embedded/config.ts
- x-pack/test/functional_enterprise_search/without_host_configured.config.ts
- x-pack/test/functional_execution_context/config.ts
- x-pack/test/functional_with_es_ssl/config.ts
- x-pack/test/functional_with_es_ssl/apps/cases/group1/config.ts
- x-pack/test/functional_with_es_ssl/apps/cases/group2/config.ts
- x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/config.ts
- x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/config.ts
- x-pack/test/functional/apps/advanced_settings/config.ts
- x-pack/test/functional/apps/aiops/config.ts
- x-pack/test/functional/apps/api_keys/config.ts
Expand Down
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/src/plugins/saved_search/ @elastic/kibana-data-discovery
/x-pack/plugins/discover_enhanced/ @elastic/kibana-data-discovery
/x-pack/test/functional/apps/discover/ @elastic/kibana-data-discovery
/x-pack/test/functional_with_es_ssl/apps/discover/ @elastic/kibana-data-discovery
/x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/discover/ @elastic/kibana-data-discovery
/test/functional/apps/discover/ @elastic/kibana-data-discovery
/test/functional/apps/context/ @elastic/kibana-data-discovery
/test/api_integration/apis/unified_field_list/ @elastic/kibana-data-discovery
Expand Down Expand Up @@ -184,7 +184,7 @@
# Uptime
/x-pack/plugins/synthetics @elastic/uptime
/x-pack/plugins/ux @elastic/uptime
/x-pack/test/functional_with_es_ssl/apps/uptime @elastic/uptime
/x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/uptime/ @elastic/uptime
/x-pack/test/functional/apps/uptime @elastic/uptime
/x-pack/test/functional/es_archives/uptime @elastic/uptime
/x-pack/test/functional/services/uptime @elastic/uptime
Expand Down Expand Up @@ -244,7 +244,7 @@
/x-pack/test/functional/es_archives/ml/ @elastic/ml-ui
/x-pack/test/functional/services/ml/ @elastic/ml-ui
/x-pack/test/functional_basic/apps/ml/ @elastic/ml-ui
/x-pack/test/functional_with_es_ssl/apps/ml/ @elastic/ml-ui
/x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/ml/ @elastic/ml-ui
/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/ml_rule_types/ @elastic/ml-ui
/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/transform_rule_types/ @elastic/ml-ui
/x-pack/test/screenshot_creation/apps/ml_docs @elastic/ml-ui
Expand Down
20 changes: 20 additions & 0 deletions x-pack/test/functional_with_es_ssl/apps/cases/group1/config.ts
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 baseConfig = await readConfigFile(require.resolve('../../../config.base.ts'));

return {
...baseConfig.getAll(),
testFiles: [require.resolve('.')],
junit: {
reportName: 'Chrome X-Pack UI Functional Tests with ES SSL - Cases - group 1',
},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
import expect from '@kbn/expect';
import { v4 as uuidv4 } from 'uuid';
import { CaseSeverity } from '@kbn/cases-plugin/common/api';
import { FtrProviderContext } from '../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
import {
createUsersAndRoles,
deleteUsersAndRoles,
} from '../../../cases_api_integration/common/lib/authentication';
import { users, roles, casesAllUser, casesAllUser2 } from './common';
} from '../../../../cases_api_integration/common/lib/authentication';
import { users, roles, casesAllUser, casesAllUser2 } from '../common';

export default ({ getService, getPageObject }: FtrProviderContext) => {
describe('Create case', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
* 2.0.
*/

import { FtrProviderContext } from '../../ftr_provider_context';
import { users, roles, casesReadDeleteUser, casesAllUser, casesNoDeleteUser } from './common';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { users, roles, casesReadDeleteUser, casesAllUser, casesNoDeleteUser } from '../common';
import {
createUsersAndRoles,
deleteUsersAndRoles,
} from '../../../cases_api_integration/common/lib/authentication';
} from '../../../../cases_api_integration/common/lib/authentication';

export default ({ getPageObjects, getService }: FtrProviderContext) => {
const PageObjects = getPageObjects(['security', 'header']);
Expand Down
16 changes: 16 additions & 0 deletions x-pack/test/functional_with_es_ssl/apps/cases/group1/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* 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 }: FtrProviderContext) => {
describe('Cases - group 1', function () {
loadTestFile(require.resolve('./create_case_form'));
loadTestFile(require.resolve('./view_case'));
loadTestFile(require.resolve('./deletion'));
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import expect from '@kbn/expect';
import { v4 as uuidv4 } from 'uuid';
import { CaseStatuses } from '@kbn/cases-plugin/common';
import { CaseSeverity } from '@kbn/cases-plugin/common/api';
import { FtrProviderContext } from '../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
import {
createUsersAndRoles,
deleteUsersAndRoles,
} from '../../../cases_api_integration/common/lib/authentication';
import { users, roles, casesAllUser, casesAllUser2 } from './common';
} from '../../../../cases_api_integration/common/lib/authentication';
import { users, roles, casesAllUser, casesAllUser2 } from '../common';

export default ({ getPageObject, getService }: FtrProviderContext) => {
const header = getPageObject('header');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
deleteAllCaseItems,
findCases,
getCase,
} from '../../../cases_api_integration/common/lib/utils';
import { FtrProviderContext } from '../../ftr_provider_context';
} from '../../../../cases_api_integration/common/lib/utils';
import { FtrProviderContext } from '../../../ftr_provider_context';

const createLogStashDataView = async (
supertest: SuperTest.SuperTest<SuperTest.Test>
Expand Down
20 changes: 20 additions & 0 deletions x-pack/test/functional_with_es_ssl/apps/cases/group2/config.ts
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 baseConfig = await readConfigFile(require.resolve('../../../config.base.ts'));

return {
...baseConfig.getAll(),
testFiles: [require.resolve('.')],
junit: {
reportName: 'Chrome X-Pack UI Functional Tests with ES SSL - Cases - group 2',
},
};
}
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 ({ getPageObject, getService }: FtrProviderContext) => {
const common = getPageObject('common');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@
* 2.0.
*/

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

export default ({ loadTestFile }: FtrProviderContext) => {
describe('Cases', function () {
loadTestFile(require.resolve('./create_case_form'));
loadTestFile(require.resolve('./view_case'));
loadTestFile(require.resolve('./list_view'));
loadTestFile(require.resolve('./configure'));
loadTestFile(require.resolve('./attachment_framework'));
loadTestFile(require.resolve('./deletion'));
loadTestFile(require.resolve('./upgrade'));
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import { CaseStatuses } from '@kbn/cases-plugin/common';
import { CaseSeverity } from '@kbn/cases-plugin/common/api';
import { SeverityAll } from '@kbn/cases-plugin/common/ui';
import { UserProfile } from '@kbn/user-profile-components';
import { FtrProviderContext } from '../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
import {
createUsersAndRoles,
deleteUsersAndRoles,
} from '../../../cases_api_integration/common/lib/authentication';
import { users, roles, casesAllUser, casesAllUser2 } from './common';
} from '../../../../cases_api_integration/common/lib/authentication';
import { users, roles, casesAllUser, casesAllUser2 } from '../common';

export default ({ getPageObject, getService }: FtrProviderContext) => {
const header = getPageObject('header');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import expect from '@kbn/expect';
import {
getExternalServiceSimulatorPath,
ExternalServiceSimulator,
} from '../../../alerting_api_integration/common/plugins/actions_simulators/server/plugin';
import { FtrProviderContext } from '../../ftr_provider_context';
} from '../../../../alerting_api_integration/common/plugins/actions_simulators/server/plugin';
import { FtrProviderContext } from '../../../ftr_provider_context';

export default ({ getPageObject, getService }: FtrProviderContext) => {
const cases = getService('cases');
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* 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';
import { resolve } from 'path';

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

return {
...baseConfig.getAll(),
testFiles: [
resolve(__dirname, './discover'),
resolve(__dirname, './uptime'),
resolve(__dirname, './ml'),
],
junit: {
reportName: 'Chrome X-Pack UI Functional Tests with ES SSL - Discover, Uptime, ML',
},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { FtrProviderContext } from '../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';

export default ({ loadTestFile, getService }: FtrProviderContext) => {
describe('Discover alerting', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

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

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

import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { DATAFEED_STATE } from '@kbn/ml-plugin/common/constants/states';
import { FtrProviderContext } from '../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';

function createTestJobAndDatafeed() {
const timestamp = Date.now();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

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

export default ({ loadTestFile, getService }: FtrProviderContext) => {
const ml = getService('ml');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import expect from '@kbn/expect';
import { setTimeout as setTimeoutAsync } from 'timers/promises';

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

export default ({ getPageObjects, getService }: FtrProviderContext) => {
describe('uptime alerts', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

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

const ARCHIVE = 'x-pack/test/functional/es_archives/uptime/full_heartbeat';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import expect from '@kbn/expect';
import { MonitorStatusTranslations } from '@kbn/synthetics-plugin/common/translations';
import { FtrProviderContext } from '../../ftr_provider_context';
import { deleteUptimeSettingsObject } from '../../../functional/apps/uptime';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { deleteUptimeSettingsObject } from '../../../../functional/apps/uptime';

export default ({ getPageObjects, getService }: FtrProviderContext) => {
describe('uptime simple status alert', () => {
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 baseConfig = await readConfigFile(require.resolve('../../config.base.ts'));

return {
...baseConfig.getAll(),
testFiles: [require.resolve('.')],
junit: {
reportName: 'Chrome X-Pack UI Functional Tests with ES SSL - Triggers Actions UI',
},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import Fs from 'fs';
import { resolve, join } from 'path';
import { join } from 'path';
import { CA_CERT_PATH } from '@kbn/dev-utils';
import { FtrConfigProviderContext } from '@kbn/test';
import { pageObjects } from './page_objects';
Expand Down Expand Up @@ -51,14 +51,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
...xpackFunctionalConfig.getAll(),
servers,
pageObjects,
// list paths to the files that contain your plugins tests
testFiles: [
resolve(__dirname, './apps/triggers_actions_ui'),
resolve(__dirname, './apps/discover'),
resolve(__dirname, './apps/uptime'),
resolve(__dirname, './apps/ml'),
resolve(__dirname, './apps/cases'),
],
// Don't list paths to the files that contain your plugins tests here
apps: {
...xpackFunctionalConfig.get('apps'),
triggersActions: {
Expand Down

0 comments on commit c190a5f

Please sign in to comment.