Skip to content

Commit

Permalink
[ Security Solution ]Re-organize the Investigations api integration t…
Browse files Browse the repository at this point in the history
…est for MKI (elastic#194707)

## Summary

This is Part 1 of the in resolving the issue :
elastic#183645 .

This PR re-organizes investigations API tests so that they can be run in
Serveless MKI at both `basic/essentials` and `complete` licenses.

## How to test this PR 

Below are the commands that are affected by this change and you can test
the PR by running below commands.

Each commands sets up the test environment and give you a command to run
tests. Please run those tests to see if everything is okay. An example
is shown in below screenshot.

<img width="1916" alt="grafik"
src="https://github.com/user-attachments/assets/fa400450-e4aa-41dc-a1ea-ac21634c46d3">


|Module|Deployment|License|Command|
|--|--|--|--|
|Timelines|ESS|basic|`yarn investigations:basic:timeline:server:ess`|
|Timelines|ESS|Trial|`yarn investigations:timeline:server:ess`|
|Timelines|Serverless|basic|`yarn
investigations:basic:timeline:server:serverless`|
|Timelines|Serverless|Trial|`yarn
investigations:timeline:server:serverless`|
|Saved Objects|ESS|basic|`yarn
investigations:basic:saved-objects:server:ess`|
|Saved Objects|ESS|Trial|`yarn investigations:saved-objects:server:ess`|
|Saved Objects|Serverless|basic|`yarn
investigations:basic:saved-objects:server:serverless`|
|Saved Objects|Serverless|Trial|`yarn
investigations:saved-objects:server:serverless`|

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
logeekal and kibanamachine authored Oct 16, 2024
1 parent fa92a8e commit 2eff6d1
Show file tree
Hide file tree
Showing 29 changed files with 120 additions and 854 deletions.
8 changes: 6 additions & 2 deletions .buildkite/ftr_security_stateful_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,14 @@ enabled:
- x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/explore/users/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/explore/overview/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/saved_objects/basic_license_essentials_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/saved_objects/basic_license_essentials_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/saved_objects/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/saved_objects/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/security_and_spaces/configs/ess.basic.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/security_and_spaces/configs/ess.trial.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/basic_license_essentials_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/basic_license_essentials_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/sources/indices/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/edr_workflows/artifacts/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/edr_workflows/authentication/trial_license_complete_tier/configs/ess.config.ts
Expand Down
19 changes: 19 additions & 0 deletions x-pack/test/security_solution_api_integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
"initialize-server:edr-workflows": "node ./scripts/index.js server edr_workflows trial_license_complete_tier",
"run-tests:edr-workflows": "node ./scripts/index.js runner edr_workflows trial_license_complete_tier",


"initialize-server:investigations:basic_essentials": "node scripts/index.js server investigation basic_license_essentials_tier",
"run-tests:investigations:basic_essentials": "node scripts/index.js runner investigation basic_license_essentials_tier",

"initialize-server:investigations": "node scripts/index.js server investigation trial_license_complete_tier",
"run-tests:investigations": "node scripts/index.js runner investigation trial_license_complete_tier",

Expand Down Expand Up @@ -377,13 +381,28 @@
"investigations:timeline:server:ess": "npm run initialize-server:investigations timeline ess",
"investigations:timeline:runner:ess": "npm run run-tests:investigations timeline ess essEnv",


"investigations:basic:timeline:server:ess": "npm run initialize-server:investigations:basic_essentials timeline ess",
"investigations:basic:timeline:server:serverless": "npm run initialize-server:investigations:basic_essentials timeline serverless",
"investigations:basic:timeline:runner:ess": "npm run run-tests:investigations:basic_essentials timeline ess essEnv",
"investigations:basic:timeline:runner:serverless": "npm run run-tests:investigations:basic_essentials timeline serverless serverlessEnv",
"investigations:basic:timeline:runner:qa:serverless": "npm run run-tests:investigations:basic_essentials timeline serverless qaPeriodicEnv",
"investigations:basic:timeline:runner:qa:serverless:release": "npm run run-tests:investigations:basic_essentials timeline serverless qaEnv",

"investigations:saved-objects:server:serverless": "npm run initialize-server:investigations saved_objects serverless",
"investigations:saved-objects:runner:serverless": "npm run run-tests:investigations saved_objects serverless serverlessEnv",
"investigations:saved-objects:runner:qa:serverless": "npm run run-tests:investigations saved_objects serverless qaPeriodicEnv",
"investigations:saved-objects:runner:qa:serverless:release": "npm run run-tests:investigations saved_objects serverless qaEnv",
"investigations:saved-objects:server:ess": "npm run initialize-server:investigations saved_objects ess",
"investigations:saved-objects:runner:ess": "npm run run-tests:investigations saved_objects ess essEnv",

"investigations:basic:saved-objects:server:serverless": "npm run initialize-server:investigations:basic_essentials saved_objects serverless",
"investigations:basic:saved-objects:runner:serverless": "npm run run-tests:investigations:basic_essentials saved_objects serverless serverlessEnv",
"investigations:basic:saved-objects:runner:qa:serverless": "npm run run-tests:investigations:basic_essentials saved_objects serverless qaPeriodicEnv",
"investigations:basic:saved-objects:runner:qa:serverless:release": "npm run run-tests:investigations:basic_essentials saved_objects serverless qaEnv",
"investigations:basic:saved-objects:server:ess": "npm run initialize-server:investigations:basic_essentials saved_objects ess",
"investigations:basic:saved-objects:runner:ess": "npm run run-tests:investigations:basic_essentials saved_objects ess essEnv",

"explore:hosts:server:serverless": "npm run intialize-server:explore hosts serverless",
"explore:hosts:runner:serverless": "npm run run-tests:explore hosts serverless serverlessEnv",
"explore:hosts:runner:qa:serverless": "npm run run-tests:explore hosts serverless qaPeriodicEnv",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
require.resolve('../../../../../config/ess/config.base.trial')
require.resolve('../../../../../config/ess/config.base.basic')
);

return {
Expand All @@ -20,9 +20,9 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
`--xpack.securitySolution.enableExperimental=${JSON.stringify([])}`,
],
},
testFiles: [require.resolve('../tests/trial')],
testFiles: [require.resolve('../../tests')],
junit: {
reportName: 'Timeline Integration Tests - ESS Env - Trial License',
reportName: 'Saved Objects Integration Tests - ESS Env - Basic License',
},
};
}
Original file line number Diff line number Diff line change
@@ -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 { createTestConfig } from '../../../../../config/serverless/config.base';

export default createTestConfig({
kbnTestServerArgs: [
`--xpack.securitySolution.enableExperimental=${JSON.stringify([])}`,
`--xpack.securitySolutionServerless.productTypes=${JSON.stringify([
{ product_line: 'security', product_tier: 'essentials' },
{ product_line: 'endpoint', product_tier: 'essentials' },
{ product_line: 'cloud', product_tier: 'essentials' },
])}`,
],
testFiles: [require.resolve('../../tests')],
junit: {
reportName: 'Saved Objects Integration Tests - Serverless Env - Complete Tier',
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
`--xpack.securitySolution.enableExperimental=${JSON.stringify([])}`,
],
},
testFiles: [require.resolve('..')],
testFiles: [require.resolve('../../tests')],
junit: {
reportName: 'Saved Objects Integration Tests - ESS Env - Basic License',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default createTestConfig({
{ product_line: 'cloud', product_tier: 'complete' },
])}`,
],
testFiles: [require.resolve('..')],
testFiles: [require.resolve('../../tests')],
junit: {
reportName: 'Saved Objects Integration Tests - Serverless Env - Complete Tier',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
`--xpack.securitySolution.enableExperimental=${JSON.stringify([])}`,
],
},
testFiles: [require.resolve('../tests/basic')],
testFiles: [require.resolve('../../tests')],
junit: {
reportName: 'Timeline Integration Tests - ESS Env - Basic License',
},
Expand Down
Original file line number Diff line number Diff line change
@@ -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 { createTestConfig } from '../../../../../config/serverless/config.base';

export default createTestConfig({
kbnTestServerArgs: [
`--xpack.securitySolution.enableExperimental=${JSON.stringify([])}`,
`--xpack.securitySolutionServerless.productTypes=${JSON.stringify([
{ product_line: 'security', product_tier: 'essentials' },
{ product_line: 'endpoint', product_tier: 'essentials' },
{ product_line: 'cloud', product_tier: 'essentials' },
])}`,
],
testFiles: [require.resolve('../../tests')],
junit: {
reportName: 'Timeline Integration Tests - Serverless Env - Essentials Tier',
},
});
Loading

0 comments on commit 2eff6d1

Please sign in to comment.