[8.7] [functional tests] split security and spaces ftr configs (#156350) (#156467)

# Backport

This will backport the following commits from `main` to `8.7`:
- [[functional tests] split security and spaces ftr configs
(#156350)](https://github.com/elastic/kibana/pull/156350)

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

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

<!--BACKPORT [{"author":{"name":"Dzmitry
Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2023-05-03T06:57:57Z","message":"[functional
tests] split security and spaces ftr configs (#156350)\n\n##
Summary\r\n\r\nSplitting ftr configs to speed up ftr tests run on CI
\r\n\r\n```\r\nThe following \"Functional Tests\" configs have durations
that exceed the maximum amount of time desired for a single CI job.
\r\nThis 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\r\nconfigs please
split them up ASAP and ask Operations if you have questions about how to
do
that.\r\n\r\nx-pack/test/spaces_api_integration/security_and_spaces/config_basic.ts:
38.2
minutes\r\nx-pack/test/spaces_api_integration/security_and_spaces/config_trial.ts:
38.2 minutes\r\n```\r\n\r\nAfter
split:\r\nx-pack/test/spaces_api_integration/security_and_spaces/config_basic.ts\r\n20m
29s\r\n\r\nx-pack/test/spaces_api_integration/security_and_spaces/copy_to_space_config_basic.ts\r\n20m
52s\r\nx-pack/test/spaces_api_integration/security_and_spaces/config_trial.ts\r\n19m
57s\r\n\r\nx-pack/test/spaces_api_integration/security_and_spaces/copy_to_space_config_trial.ts\r\n21m
5s\r\n\r\nRebalancing it with other configs should speedup CI by at
least
few\r\nminutes","sha":"424eae3f4d0f55f684a5b3c3b46847eb723233c9","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":156350,"url":"https://github.com/elastic/kibana/pull/156350","mergeCommit":{"message":"[functional
tests] split security and spaces ftr configs (#156350)\n\n##
Summary\r\n\r\nSplitting ftr configs to speed up ftr tests run on CI
\r\n\r\n```\r\nThe following \"Functional Tests\" configs have durations
that exceed the maximum amount of time desired for a single CI job.
\r\nThis 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\r\nconfigs please
split them up ASAP and ask Operations if you have questions about how to
do
that.\r\n\r\nx-pack/test/spaces_api_integration/security_and_spaces/config_basic.ts:
38.2
minutes\r\nx-pack/test/spaces_api_integration/security_and_spaces/config_trial.ts:
38.2 minutes\r\n```\r\n\r\nAfter
split:\r\nx-pack/test/spaces_api_integration/security_and_spaces/config_basic.ts\r\n20m
29s\r\n\r\nx-pack/test/spaces_api_integration/security_and_spaces/copy_to_space_config_basic.ts\r\n20m
52s\r\nx-pack/test/spaces_api_integration/security_and_spaces/config_trial.ts\r\n19m
57s\r\n\r\nx-pack/test/spaces_api_integration/security_and_spaces/copy_to_space_config_trial.ts\r\n21m
5s\r\n\r\nRebalancing it with other configs should speedup CI by at
least
few\r\nminutes","sha":"424eae3f4d0f55f684a5b3c3b46847eb723233c9"}},"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/156350","number":156350,"mergeCommit":{"message":"[functional
tests] split security and spaces ftr configs (#156350)\n\n##
Summary\r\n\r\nSplitting ftr configs to speed up ftr tests run on CI
\r\n\r\n```\r\nThe following \"Functional Tests\" configs have durations
that exceed the maximum amount of time desired for a single CI job.
\r\nThis 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\r\nconfigs please
split them up ASAP and ask Operations if you have questions about how to
do
that.\r\n\r\nx-pack/test/spaces_api_integration/security_and_spaces/config_basic.ts:
38.2
minutes\r\nx-pack/test/spaces_api_integration/security_and_spaces/config_trial.ts:
38.2 minutes\r\n```\r\n\r\nAfter
split:\r\nx-pack/test/spaces_api_integration/security_and_spaces/config_basic.ts\r\n20m
29s\r\n\r\nx-pack/test/spaces_api_integration/security_and_spaces/copy_to_space_config_basic.ts\r\n20m
52s\r\nx-pack/test/spaces_api_integration/security_and_spaces/config_trial.ts\r\n19m
57s\r\n\r\nx-pack/test/spaces_api_integration/security_and_spaces/copy_to_space_config_trial.ts\r\n21m
5s\r\n\r\nRebalancing it with other configs should speedup CI by at
least
few\r\nminutes","sha":"424eae3f4d0f55f684a5b3c3b46847eb723233c9"}}]}]
BACKPORT-->

Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
This commit is contained in:
Kibana Machine 2023-05-03 04:36:42 -04:00 committed by GitHub
parent f227215b1f
commit 6cff858b71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 70 additions and 16 deletions

View file

@ -345,7 +345,9 @@ enabled:
- x-pack/test/security_solution_endpoint/config.ts
- x-pack/test/session_view/basic/config.ts
- x-pack/test/spaces_api_integration/security_and_spaces/config_basic.ts
- x-pack/test/spaces_api_integration/security_and_spaces/copy_to_space_config_basic.ts
- x-pack/test/spaces_api_integration/security_and_spaces/config_trial.ts
- x-pack/test/spaces_api_integration/security_and_spaces/copy_to_space_config_trial.ts
- x-pack/test/spaces_api_integration/spaces_only/config.ts
- x-pack/test/timeline/security_and_spaces/config_trial.ts
- x-pack/test/ui_capabilities/security_and_spaces/config.ts

View file

@ -13,10 +13,11 @@ import { FtrConfigProviderContext } from '@kbn/test';
interface CreateTestConfigOptions {
license: string;
disabledPlugins?: string[];
testFiles?: string[];
}
export function createTestConfig(name: string, options: CreateTestConfigOptions) {
const { license, disabledPlugins = [] } = options;
const { license, disabledPlugins = [], testFiles } = options;
return async ({ readConfigFile }: FtrConfigProviderContext) => {
const config = {
@ -32,7 +33,7 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions)
};
return {
testFiles: [require.resolve(`../${name}/apis/`)],
testFiles: testFiles ?? [require.resolve(`../${name}/apis/`)],
servers: config.xpack.api.get('servers'),
services: {
es: config.kibana.api.get('services.es'),

View file

@ -5,10 +5,10 @@
* 2.0.
*/
import { AUTHENTICATION } from '../../common/lib/authentication';
import { SPACES } from '../../common/lib/spaces';
import { copyToSpaceTestSuiteFactory } from '../../common/suites/copy_to_space';
import { FtrProviderContext } from '../../common/ftr_provider_context';
import { AUTHENTICATION } from '../../../common/lib/authentication';
import { SPACES } from '../../../common/lib/spaces';
import { copyToSpaceTestSuiteFactory } from '../../../common/suites/copy_to_space';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
// eslint-disable-next-line import/no-default-export
export default function copyToSpaceSpacesAndSecuritySuite(context: FtrProviderContext) {

View file

@ -0,0 +1,23 @@
/*
* 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 { createUsersAndRoles } from '../../../common/lib/create_users_and_roles';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
// eslint-disable-next-line import/no-default-export
export default function ({ loadTestFile, getService }: FtrProviderContext) {
const es = getService('es');
const supertest = getService('supertest');
describe('copy to space with security', function () {
before(async () => {
await createUsersAndRoles(es, supertest);
});
loadTestFile(require.resolve('./copy_to_space')); // ~ 19m 20s
});
}

View file

@ -18,15 +18,15 @@ export default function ({ loadTestFile, getService }: FtrProviderContext) {
await createUsersAndRoles(es, supertest);
});
loadTestFile(require.resolve('./copy_to_space'));
loadTestFile(require.resolve('./resolve_copy_to_space_conflicts'));
loadTestFile(require.resolve('./create'));
loadTestFile(require.resolve('./delete'));
loadTestFile(require.resolve('./get_all'));
loadTestFile(require.resolve('./get_shareable_references'));
loadTestFile(require.resolve('./get'));
loadTestFile(require.resolve('./update'));
loadTestFile(require.resolve('./update_objects_spaces'));
loadTestFile(require.resolve('./disable_legacy_url_aliases'));
// total runtime ~ 17m
loadTestFile(require.resolve('./resolve_copy_to_space_conflicts')); // ~ 10m
loadTestFile(require.resolve('./create')); // ~ 2m
loadTestFile(require.resolve('./delete')); // ~ 1m 20s
loadTestFile(require.resolve('./get_all')); // ~ 50s
loadTestFile(require.resolve('./get_shareable_references')); // ~ 30s
loadTestFile(require.resolve('./get')); // ~ 30s
loadTestFile(require.resolve('./update')); // ~ 30s
loadTestFile(require.resolve('./update_objects_spaces')); // ~ 1m
loadTestFile(require.resolve('./disable_legacy_url_aliases')); // ~ 30s
});
}

View file

@ -0,0 +1,14 @@
/*
* 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 { createTestConfig } from '../common/config';
// eslint-disable-next-line import/no-default-export
export default createTestConfig('security_and_spaces', {
license: 'basic',
testFiles: [require.resolve('./apis/copy_to_space')],
});

View file

@ -0,0 +1,14 @@
/*
* 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 { createTestConfig } from '../common/config';
// eslint-disable-next-line import/no-default-export
export default createTestConfig('security_and_spaces', {
license: 'trial',
testFiles: [require.resolve('./apis/copy_to_space')],
});