Skip to content

[8.19] [Security Solution] Refactor prebuilt rules integration tests (#219831)#222052

Merged
maximpn merged 1 commit intoelastic:8.19from
maximpn:backport/8.19/pr-219831
May 30, 2025
Merged

[8.19] [Security Solution] Refactor prebuilt rules integration tests (#219831)#222052
maximpn merged 1 commit intoelastic:8.19from
maximpn:backport/8.19/pr-219831

Conversation

@maximpn
Copy link
Copy Markdown
Contributor

@maximpn maximpn commented May 30, 2025

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

…c#219831)

**Related Epic:** elastic#179907

## Summary

This PR refactors prebuilt rules integration tests structure to streamline the implementation of test plans targeted [Prebuilt Rules Customization Milestone 4](elastic#179907).

## Details

Existing integration tests structure have prebuilt rules related integration tests scattered around rules management area. Due to historical reasons and pace of the prebuilt rules customization development some old tests were updated, some new were added as random spots as well as some new tests structure was suggested.

This PR moves files and some tests around to the following structure

- `test_suites/detection_response/rules_management/prebuilt_rules` is the root folder for prebuilt rules related integration tests
- `customization_disabled` subfolder contains prebuilt rules integration tests covering scenarios when users have **insufficient** for customization license level (basic/essentials)
- `customization_enabled` subfolder contains  prebuilt rules integration tests covering scenarios when users have **sufficient** for customization license level
- `customization_disabled` and `customization_enabled` subfoldera have test suites grouped by sub domains
  - `prebuilt_rules_package` - contains integration tests related to detection rules Fleet package installation and updating, bootstrap is also belong to here
  - `install_prebuilt_rules` - contains tests related to prebuilt rules installation from prebuilt rule assets
  - `upgrade_prebuilt_rules` - contains tests related to prebuilt rules upgrade workflow
  - `customization` - contains tests related to prebuilt rules customization including `is_customized` calculation
  - `import_export` - contains tests related to exporting and importing customized and non-customized prebuilt rules
  - `status` - contain status endpoints related tests

(cherry picked from commit 3ea69af)

# Conflicts:
#	.buildkite/ftr_security_serverless_configs.yml
#	x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/customization_enabled/is_customized_calculation.ts
@maximpn maximpn requested a review from kibanamachine as a code owner May 30, 2025 13:25
@maximpn maximpn added the backport This PR is a backport of another PR label May 30, 2025
@maximpn maximpn enabled auto-merge (squash) May 30, 2025 13:25
@maximpn maximpn merged commit a5e1660 into elastic:8.19 May 30, 2025
12 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #16 / aiops change point detection in cases attaches change point charts to a case

Metrics [docs]

✅ unchanged

@maximpn maximpn deleted the backport/8.19/pr-219831 branch May 30, 2025 18:11
maximpn added a commit that referenced this pull request Jul 3, 2025
…219831) (#226383)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Security Solution] Refactor prebuilt rules integration tests
(#219831)](#219831)

<!--- Backport version: 10.0.1 -->

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

<!--BACKPORT [{"author":{"name":"Maxim
Palenov","email":"maxim.palenov@elastic.co"},"sourceCommit":{"committedDate":"2025-05-30T10:23:45Z","message":"[Security
Solution] Refactor prebuilt rules integration tests
(#219831)\n\n**Related Epic:**
https://github.com/elastic/kibana/issues/179907\n\n## Summary\n\nThis PR
refactors prebuilt rules integration tests structure to streamline the
implementation of test plans targeted [Prebuilt Rules Customization
Milestone 4](https://github.com/elastic/kibana/issues/179907).\n\n##
Details\n\nExisting integration tests structure have prebuilt rules
related integration tests scattered around rules management area. Due to
historical reasons and pace of the prebuilt rules customization
development some old tests were updated, some new were added as random
spots as well as some new tests structure was suggested.\n\nThis PR
moves files and some tests around to the following structure\n\n-
`test_suites/detection_response/rules_management/prebuilt_rules` is the
root folder for prebuilt rules related integration tests\n-
`customization_disabled` subfolder contains prebuilt rules integration
tests covering scenarios when users have **insufficient** for
customization license level (basic/essentials)\n-
`customization_enabled` subfolder contains prebuilt rules integration
tests covering scenarios when users have **sufficient** for
customization license level\n- `customization_disabled` and
`customization_enabled` subfoldera have test suites grouped by sub
domains\n - `prebuilt_rules_package` - contains integration tests
related to detection rules Fleet package installation and updating,
bootstrap is also belong to here\n - `install_prebuilt_rules` - contains
tests related to prebuilt rules installation from prebuilt rule assets\n
- `upgrade_prebuilt_rules` - contains tests related to prebuilt rules
upgrade workflow\n - `customization` - contains tests related to
prebuilt rules customization including `is_customized` calculation\n -
`import_export` - contains tests related to exporting and importing
customized and non-customized prebuilt rules\n - `status` - contain
status endpoints related
tests","sha":"3ea69afa83b692e5d82a0a7bb6d8cd0be014022c","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","refactoring","release_note:skip","impact:high","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v9.1.0","v8.19.0"],"title":"[Security
Solution] Refactor prebuilt rules integration
tests","number":219831,"url":"https://github.com/elastic/kibana/pull/219831","mergeCommit":{"message":"[Security
Solution] Refactor prebuilt rules integration tests
(#219831)\n\n**Related Epic:**
https://github.com/elastic/kibana/issues/179907\n\n## Summary\n\nThis PR
refactors prebuilt rules integration tests structure to streamline the
implementation of test plans targeted [Prebuilt Rules Customization
Milestone 4](https://github.com/elastic/kibana/issues/179907).\n\n##
Details\n\nExisting integration tests structure have prebuilt rules
related integration tests scattered around rules management area. Due to
historical reasons and pace of the prebuilt rules customization
development some old tests were updated, some new were added as random
spots as well as some new tests structure was suggested.\n\nThis PR
moves files and some tests around to the following structure\n\n-
`test_suites/detection_response/rules_management/prebuilt_rules` is the
root folder for prebuilt rules related integration tests\n-
`customization_disabled` subfolder contains prebuilt rules integration
tests covering scenarios when users have **insufficient** for
customization license level (basic/essentials)\n-
`customization_enabled` subfolder contains prebuilt rules integration
tests covering scenarios when users have **sufficient** for
customization license level\n- `customization_disabled` and
`customization_enabled` subfoldera have test suites grouped by sub
domains\n - `prebuilt_rules_package` - contains integration tests
related to detection rules Fleet package installation and updating,
bootstrap is also belong to here\n - `install_prebuilt_rules` - contains
tests related to prebuilt rules installation from prebuilt rule assets\n
- `upgrade_prebuilt_rules` - contains tests related to prebuilt rules
upgrade workflow\n - `customization` - contains tests related to
prebuilt rules customization including `is_customized` calculation\n -
`import_export` - contains tests related to exporting and importing
customized and non-customized prebuilt rules\n - `status` - contain
status endpoints related
tests","sha":"3ea69afa83b692e5d82a0a7bb6d8cd0be014022c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/219831","number":219831,"mergeCommit":{"message":"[Security
Solution] Refactor prebuilt rules integration tests
(#219831)\n\n**Related Epic:**
https://github.com/elastic/kibana/issues/179907\n\n## Summary\n\nThis PR
refactors prebuilt rules integration tests structure to streamline the
implementation of test plans targeted [Prebuilt Rules Customization
Milestone 4](https://github.com/elastic/kibana/issues/179907).\n\n##
Details\n\nExisting integration tests structure have prebuilt rules
related integration tests scattered around rules management area. Due to
historical reasons and pace of the prebuilt rules customization
development some old tests were updated, some new were added as random
spots as well as some new tests structure was suggested.\n\nThis PR
moves files and some tests around to the following structure\n\n-
`test_suites/detection_response/rules_management/prebuilt_rules` is the
root folder for prebuilt rules related integration tests\n-
`customization_disabled` subfolder contains prebuilt rules integration
tests covering scenarios when users have **insufficient** for
customization license level (basic/essentials)\n-
`customization_enabled` subfolder contains prebuilt rules integration
tests covering scenarios when users have **sufficient** for
customization license level\n- `customization_disabled` and
`customization_enabled` subfoldera have test suites grouped by sub
domains\n - `prebuilt_rules_package` - contains integration tests
related to detection rules Fleet package installation and updating,
bootstrap is also belong to here\n - `install_prebuilt_rules` - contains
tests related to prebuilt rules installation from prebuilt rule assets\n
- `upgrade_prebuilt_rules` - contains tests related to prebuilt rules
upgrade workflow\n - `customization` - contains tests related to
prebuilt rules customization including `is_customized` calculation\n -
`import_export` - contains tests related to exporting and importing
customized and non-customized prebuilt rules\n - `status` - contain
status endpoints related
tests","sha":"3ea69afa83b692e5d82a0a7bb6d8cd0be014022c"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/222052","number":222052,"state":"MERGED","mergeCommit":{"sha":"a5e16606a45a62c0064d4f8d796277e0b3457e28","message":"[8.19]
[Security Solution] Refactor prebuilt rules integration tests (#219831)
(#222052)\n\n# Backport\n\nThis will backport the following commits from
`main` to `8.19`:\n- [[Security Solution] Refactor prebuilt rules
integration
tests\n(#219831)](https://github.com/elastic/kibana/pull/219831)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n"}}]}]
BACKPORT-->
maximpn added a commit that referenced this pull request Jul 3, 2025
…219831) (#226385)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Security Solution] Refactor prebuilt rules integration tests
(#219831)](#219831)

<!--- Backport version: 10.0.1 -->

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

<!--BACKPORT [{"author":{"name":"Maxim
Palenov","email":"maxim.palenov@elastic.co"},"sourceCommit":{"committedDate":"2025-05-30T10:23:45Z","message":"[Security
Solution] Refactor prebuilt rules integration tests
(#219831)\n\n**Related Epic:**
https://github.com/elastic/kibana/issues/179907\n\n## Summary\n\nThis PR
refactors prebuilt rules integration tests structure to streamline the
implementation of test plans targeted [Prebuilt Rules Customization
Milestone 4](https://github.com/elastic/kibana/issues/179907).\n\n##
Details\n\nExisting integration tests structure have prebuilt rules
related integration tests scattered around rules management area. Due to
historical reasons and pace of the prebuilt rules customization
development some old tests were updated, some new were added as random
spots as well as some new tests structure was suggested.\n\nThis PR
moves files and some tests around to the following structure\n\n-
`test_suites/detection_response/rules_management/prebuilt_rules` is the
root folder for prebuilt rules related integration tests\n-
`customization_disabled` subfolder contains prebuilt rules integration
tests covering scenarios when users have **insufficient** for
customization license level (basic/essentials)\n-
`customization_enabled` subfolder contains prebuilt rules integration
tests covering scenarios when users have **sufficient** for
customization license level\n- `customization_disabled` and
`customization_enabled` subfoldera have test suites grouped by sub
domains\n - `prebuilt_rules_package` - contains integration tests
related to detection rules Fleet package installation and updating,
bootstrap is also belong to here\n - `install_prebuilt_rules` - contains
tests related to prebuilt rules installation from prebuilt rule assets\n
- `upgrade_prebuilt_rules` - contains tests related to prebuilt rules
upgrade workflow\n - `customization` - contains tests related to
prebuilt rules customization including `is_customized` calculation\n -
`import_export` - contains tests related to exporting and importing
customized and non-customized prebuilt rules\n - `status` - contain
status endpoints related
tests","sha":"3ea69afa83b692e5d82a0a7bb6d8cd0be014022c","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","refactoring","release_note:skip","impact:high","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v9.1.0","v8.19.0"],"title":"[Security
Solution] Refactor prebuilt rules integration
tests","number":219831,"url":"https://github.com/elastic/kibana/pull/219831","mergeCommit":{"message":"[Security
Solution] Refactor prebuilt rules integration tests
(#219831)\n\n**Related Epic:**
https://github.com/elastic/kibana/issues/179907\n\n## Summary\n\nThis PR
refactors prebuilt rules integration tests structure to streamline the
implementation of test plans targeted [Prebuilt Rules Customization
Milestone 4](https://github.com/elastic/kibana/issues/179907).\n\n##
Details\n\nExisting integration tests structure have prebuilt rules
related integration tests scattered around rules management area. Due to
historical reasons and pace of the prebuilt rules customization
development some old tests were updated, some new were added as random
spots as well as some new tests structure was suggested.\n\nThis PR
moves files and some tests around to the following structure\n\n-
`test_suites/detection_response/rules_management/prebuilt_rules` is the
root folder for prebuilt rules related integration tests\n-
`customization_disabled` subfolder contains prebuilt rules integration
tests covering scenarios when users have **insufficient** for
customization license level (basic/essentials)\n-
`customization_enabled` subfolder contains prebuilt rules integration
tests covering scenarios when users have **sufficient** for
customization license level\n- `customization_disabled` and
`customization_enabled` subfoldera have test suites grouped by sub
domains\n - `prebuilt_rules_package` - contains integration tests
related to detection rules Fleet package installation and updating,
bootstrap is also belong to here\n - `install_prebuilt_rules` - contains
tests related to prebuilt rules installation from prebuilt rule assets\n
- `upgrade_prebuilt_rules` - contains tests related to prebuilt rules
upgrade workflow\n - `customization` - contains tests related to
prebuilt rules customization including `is_customized` calculation\n -
`import_export` - contains tests related to exporting and importing
customized and non-customized prebuilt rules\n - `status` - contain
status endpoints related
tests","sha":"3ea69afa83b692e5d82a0a7bb6d8cd0be014022c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/219831","number":219831,"mergeCommit":{"message":"[Security
Solution] Refactor prebuilt rules integration tests
(#219831)\n\n**Related Epic:**
https://github.com/elastic/kibana/issues/179907\n\n## Summary\n\nThis PR
refactors prebuilt rules integration tests structure to streamline the
implementation of test plans targeted [Prebuilt Rules Customization
Milestone 4](https://github.com/elastic/kibana/issues/179907).\n\n##
Details\n\nExisting integration tests structure have prebuilt rules
related integration tests scattered around rules management area. Due to
historical reasons and pace of the prebuilt rules customization
development some old tests were updated, some new were added as random
spots as well as some new tests structure was suggested.\n\nThis PR
moves files and some tests around to the following structure\n\n-
`test_suites/detection_response/rules_management/prebuilt_rules` is the
root folder for prebuilt rules related integration tests\n-
`customization_disabled` subfolder contains prebuilt rules integration
tests covering scenarios when users have **insufficient** for
customization license level (basic/essentials)\n-
`customization_enabled` subfolder contains prebuilt rules integration
tests covering scenarios when users have **sufficient** for
customization license level\n- `customization_disabled` and
`customization_enabled` subfoldera have test suites grouped by sub
domains\n - `prebuilt_rules_package` - contains integration tests
related to detection rules Fleet package installation and updating,
bootstrap is also belong to here\n - `install_prebuilt_rules` - contains
tests related to prebuilt rules installation from prebuilt rule assets\n
- `upgrade_prebuilt_rules` - contains tests related to prebuilt rules
upgrade workflow\n - `customization` - contains tests related to
prebuilt rules customization including `is_customized` calculation\n -
`import_export` - contains tests related to exporting and importing
customized and non-customized prebuilt rules\n - `status` - contain
status endpoints related
tests","sha":"3ea69afa83b692e5d82a0a7bb6d8cd0be014022c"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/222052","number":222052,"state":"MERGED","mergeCommit":{"sha":"a5e16606a45a62c0064d4f8d796277e0b3457e28","message":"[8.19]
[Security Solution] Refactor prebuilt rules integration tests (#219831)
(#222052)\n\n# Backport\n\nThis will backport the following commits from
`main` to `8.19`:\n- [[Security Solution] Refactor prebuilt rules
integration
tests\n(#219831)](https://github.com/elastic/kibana/pull/219831)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants