Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.11] [Security Solution] Install/Update Prebuilt Rules Test Impleme…
…ntation refactor (#165488) (#169129) # Backport This will backport the following commits from `main` to `8.11`: - [[Security Solution] Install/Update Prebuilt Rules Test Implementation refactor (#165488)](#165488) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Juan Pablo Djeredjian","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-10-17T11:05:49Z","message":"[Security Solution] Install/Update Prebuilt Rules Test Implementation refactor (#165488)\n\nFixes: https://github.com/elastic/kibana/issues/148192\r\n\r\n(Tick the two open checkboxes in that issue when merging this PR)\r\n\r\n## Summary\r\n\r\nThis PR rewrites/refactors Cypress tests for the Installation and\r\nUpgrade of Prebuilt Rules implemented in\r\nhttps://github.com//pull/161687. Most of the changes here\r\naddress feedback received in that PR - answered those comments there.\r\n\r\n- RBAC/Authorization: adds tests scenarios for users with full\r\nprivileges (happy path)\r\n- Gets rid of huge util helpers such as\r\n`assertRuleAvailableForInstallAndInstallOne` and rewrites test cases in\r\na more descriptive way, with step by step actions.\r\n- Gets rid of complex logic in tests and their helpers - removing\r\nif/else logic within them and removing optional flags passed to helpers.\r\n- Fixes `bulkCreateRuleAssets` util and uses it in other helpers to\r\ninstall multiple `security-rule` assets with a single bulk request to\r\nES.\r\n\r\nAdditionally: checked `installation_and_upgrade.md` test plan to make\r\nsure it matches with the test in place. Added\r\n[link](#166215) to a ticket for\r\na to-do task for the sections:\r\n- Rule installation workflow: filtering, sorting, pagination\r\n- Rule upgrade workflow: filtering, sorting, pagination\r\n\r\n## Flaky test runner\r\n\r\n\r\n~~https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3420~~\r\n~~🟢~~\r\n\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3513\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"24c008b4c5026dd543f1b4aded94f3787bce5fb0","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["refactoring","release_note:skip","test-coverage","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","Feature:Prebuilt Detection Rules","v8.11.0","v8.12.0"],"number":165488,"url":"https://github.com/elastic/kibana/pull/165488","mergeCommit":{"message":"[Security Solution] Install/Update Prebuilt Rules Test Implementation refactor (#165488)\n\nFixes: https://github.com/elastic/kibana/issues/148192\r\n\r\n(Tick the two open checkboxes in that issue when merging this PR)\r\n\r\n## Summary\r\n\r\nThis PR rewrites/refactors Cypress tests for the Installation and\r\nUpgrade of Prebuilt Rules implemented in\r\nhttps://github.com//pull/161687. Most of the changes here\r\naddress feedback received in that PR - answered those comments there.\r\n\r\n- RBAC/Authorization: adds tests scenarios for users with full\r\nprivileges (happy path)\r\n- Gets rid of huge util helpers such as\r\n`assertRuleAvailableForInstallAndInstallOne` and rewrites test cases in\r\na more descriptive way, with step by step actions.\r\n- Gets rid of complex logic in tests and their helpers - removing\r\nif/else logic within them and removing optional flags passed to helpers.\r\n- Fixes `bulkCreateRuleAssets` util and uses it in other helpers to\r\ninstall multiple `security-rule` assets with a single bulk request to\r\nES.\r\n\r\nAdditionally: checked `installation_and_upgrade.md` test plan to make\r\nsure it matches with the test in place. Added\r\n[link](#166215) to a ticket for\r\na to-do task for the sections:\r\n- Rule installation workflow: filtering, sorting, pagination\r\n- Rule upgrade workflow: filtering, sorting, pagination\r\n\r\n## Flaky test runner\r\n\r\n\r\n~~https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3420~~\r\n~~🟢~~\r\n\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3513\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"24c008b4c5026dd543f1b4aded94f3787bce5fb0"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"8.11","label":"v8.11.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/165488","number":165488,"mergeCommit":{"message":"[Security Solution] Install/Update Prebuilt Rules Test Implementation refactor (#165488)\n\nFixes: https://github.com/elastic/kibana/issues/148192\r\n\r\n(Tick the two open checkboxes in that issue when merging this PR)\r\n\r\n## Summary\r\n\r\nThis PR rewrites/refactors Cypress tests for the Installation and\r\nUpgrade of Prebuilt Rules implemented in\r\nhttps://github.com//pull/161687. Most of the changes here\r\naddress feedback received in that PR - answered those comments there.\r\n\r\n- RBAC/Authorization: adds tests scenarios for users with full\r\nprivileges (happy path)\r\n- Gets rid of huge util helpers such as\r\n`assertRuleAvailableForInstallAndInstallOne` and rewrites test cases in\r\na more descriptive way, with step by step actions.\r\n- Gets rid of complex logic in tests and their helpers - removing\r\nif/else logic within them and removing optional flags passed to helpers.\r\n- Fixes `bulkCreateRuleAssets` util and uses it in other helpers to\r\ninstall multiple `security-rule` assets with a single bulk request to\r\nES.\r\n\r\nAdditionally: checked `installation_and_upgrade.md` test plan to make\r\nsure it matches with the test in place. Added\r\n[link](#166215) to a ticket for\r\na to-do task for the sections:\r\n- Rule installation workflow: filtering, sorting, pagination\r\n- Rule upgrade workflow: filtering, sorting, pagination\r\n\r\n## Flaky test runner\r\n\r\n\r\n~~https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3420~~\r\n~~🟢~~\r\n\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3513\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"24c008b4c5026dd543f1b4aded94f3787bce5fb0"}}]}] BACKPORT-->
- Loading branch information