From 2df08a00c7d2a290c06d01e373131aa6f2c2c9e2 Mon Sep 17 00:00:00 2001 From: Elena Shostak Date: Mon, 23 Dec 2024 22:16:44 +0100 Subject: [PATCH] wip --- .../default_configs/stateful.config.base.ts | 10 ++- .../fixtures/kbn_archiver/default_space.json | 40 +++++------ .../common/fixtures/kbn_archiver/space_1.json | 10 +-- .../common/fixtures/kbn_archiver/space_2.json | 12 ++-- .../common/suites/copy_to_space.agnostic.ts | 66 ++++++++++--------- .../common/suites/create.agnostic.ts | 4 +- .../common/suites/get.agnostic.ts | 4 +- .../security_and_spaces/apis/index.ts | 8 +-- .../stateful.common.config.ts | 7 ++ 9 files changed, 87 insertions(+), 74 deletions(-) diff --git a/x-pack/test/api_integration/deployment_agnostic/default_configs/stateful.config.base.ts b/x-pack/test/api_integration/deployment_agnostic/default_configs/stateful.config.base.ts index 8a6824b7475b8..c2d2fe65c4d83 100644 --- a/x-pack/test/api_integration/deployment_agnostic/default_configs/stateful.config.base.ts +++ b/x-pack/test/api_integration/deployment_agnostic/default_configs/stateful.config.base.ts @@ -39,10 +39,10 @@ export function createStatefulTestConfig { if (options.esServerArgs || options.kbnServerArgs) { - // throw new Error( - // `FTR doesn't provision custom ES/Kibana server arguments into the ESS deployment. - // It may lead to unexpected test failures on Cloud. Please contact #appex-qa.` - // ); + throw new Error( + `FTR doesn't provision custom ES/Kibana server arguments into the ESS deployment. + It may lead to unexpected test failures on Cloud. Please contact #appex-qa.` + ); } // if config is executed on CI or locally @@ -118,7 +118,6 @@ export function createStatefulTestConfig { - const spaces = ['space_2']; - const includeReferences = false; - describe(`multi-namespace types with overwrite=${overwrite} and createNewCopies=${createNewCopies}`, () => { - before(async () => await testDataLoader.createFtrSavedObjectsData(SPACE_DATA_TO_LOAD)); - after(async () => await testDataLoader.deleteFtrSavedObjectsData()); - - const testCases = tests.multiNamespaceTestCases(overwrite, createNewCopies); - testCases.forEach(({ testTitle, objects, statusCode, response }) => { - it(`should return ${statusCode} when ${testTitle}`, async () => { - return supertest - .post(`${getUrlPrefix(spaceId)}/api/spaces/_copy_saved_objects`) - .send({ objects, spaces, includeReferences, createNewCopies, overwrite }) - .expect(statusCode) - .then(response); - }); - }); - }); - }); + // [ + // [false, false], + // [false, true], // createNewCopies enabled + // [true, false], // overwrite enabled + // // we don't specify tese cases with both overwrite and createNewCopies enabled, since overwrite won't matter in that scenario + // ].forEach(([overwrite, createNewCopies]) => { + // const spaces = ['space_2']; + // const includeReferences = false; + // describe(`multi-namespace types with overwrite=${overwrite} and createNewCopies=${createNewCopies}`, () => { + // before(async () => await testDataLoader.createFtrSavedObjectsData(SPACE_DATA_TO_LOAD)); + // after(async () => await testDataLoader.deleteFtrSavedObjectsData()); + + // const testCases = tests.multiNamespaceTestCases(overwrite, createNewCopies); + // testCases.forEach(({ testTitle, objects, statusCode, response }) => { + // it(`should return ${statusCode} when ${testTitle}`, async () => { + // return supertest + // .post(`${getUrlPrefix(spaceId)}/api/spaces/_copy_saved_objects`) + // .send({ objects, spaces, includeReferences, createNewCopies, overwrite }) + // .expect(statusCode) + // .then(response); + // }); + // }); + // }); + // }); }); }; diff --git a/x-pack/test/spaces_api_integration/common/suites/create.agnostic.ts b/x-pack/test/spaces_api_integration/common/suites/create.agnostic.ts index 7e99431fd2a44..9e300b40eecd1 100644 --- a/x-pack/test/spaces_api_integration/common/suites/create.agnostic.ts +++ b/x-pack/test/spaces_api_integration/common/suites/create.agnostic.ts @@ -7,7 +7,7 @@ import type { Agent as SuperTestAgent } from 'supertest'; -import expect from '@kbn/expect'; +import expect from '@kbn/expect/expect'; import type { DeploymentAgnosticFtrProviderContext, @@ -91,9 +91,11 @@ export function createTestSuiteFactory({ getService }: DeploymentAgnosticFtrProv 'inventory', 'logs', 'observabilityCases', + 'observabilityCasesV2', 'securitySolutionAssistant', 'securitySolutionAttackDiscovery', 'securitySolutionCases', + 'securitySolutionCasesV2', 'siem', 'slo', 'uptime', diff --git a/x-pack/test/spaces_api_integration/common/suites/get.agnostic.ts b/x-pack/test/spaces_api_integration/common/suites/get.agnostic.ts index b4630e750e55c..a0a5f1eeb553a 100644 --- a/x-pack/test/spaces_api_integration/common/suites/get.agnostic.ts +++ b/x-pack/test/spaces_api_integration/common/suites/get.agnostic.ts @@ -7,7 +7,7 @@ import type { Agent as SuperTestAgent } from 'supertest'; -import expect from '@kbn/expect'; +import expect from '@kbn/expect/expect'; import { getSupertest, maybeDestroySupertest } from './common'; import type { @@ -91,9 +91,11 @@ export function getTestSuiteFactory(context: DeploymentAgnosticFtrProviderContex 'inventory', 'logs', 'observabilityCases', + 'observabilityCasesV2', 'securitySolutionAssistant', 'securitySolutionAttackDiscovery', 'securitySolutionCases', + 'securitySolutionCasesV2', 'siem', 'slo', 'uptime', diff --git a/x-pack/test/spaces_api_integration/deployment_agnostic/security_and_spaces/apis/index.ts b/x-pack/test/spaces_api_integration/deployment_agnostic/security_and_spaces/apis/index.ts index ef9a70fd961a1..c1911110409c7 100644 --- a/x-pack/test/spaces_api_integration/deployment_agnostic/security_and_spaces/apis/index.ts +++ b/x-pack/test/spaces_api_integration/deployment_agnostic/security_and_spaces/apis/index.ts @@ -21,10 +21,10 @@ export default function ({ loadTestFile, getService }: DeploymentAgnosticFtrProv } }); // loadTestFile(require.resolve('./resolve_copy_to_space_conflicts')); - loadTestFile(require.resolve('./create')); - loadTestFile(require.resolve('./delete')); - loadTestFile(require.resolve('./get_all')); + // loadTestFile(require.resolve('./create')); + // loadTestFile(require.resolve('./delete')); + // loadTestFile(require.resolve('./get_all')); loadTestFile(require.resolve('./get')); - loadTestFile(require.resolve('./update')); + // loadTestFile(require.resolve('./update')); }); } diff --git a/x-pack/test/spaces_api_integration/deployment_agnostic/stateful.common.config.ts b/x-pack/test/spaces_api_integration/deployment_agnostic/stateful.common.config.ts index 6f03cf33d2eaf..67bcdbdaea7ea 100644 --- a/x-pack/test/spaces_api_integration/deployment_agnostic/stateful.common.config.ts +++ b/x-pack/test/spaces_api_integration/deployment_agnostic/stateful.common.config.ts @@ -65,6 +65,13 @@ export function createTestConfig({ // `--plugin-path=${path.resolve(__dirname, '../common/plugins/spaces_test_plugin')}`, ], }, + esTestCluster: { + ...testConfig.esTestCluster, + serverArgs: [ + ...testConfig.esTestCluster.serverArgs, + `xpack.license.self_generated.type=${license}`, + ], + }, }; }; }