Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] Cover persistent rules table state by e2e tests #149638

Merged
merged 33 commits into from
Feb 22, 2023

Conversation

maximpn
Copy link
Contributor

@maximpn maximpn commented Jan 26, 2023

Relates to: #140263

Summary

This PR adds Cypress e2e tests to cover persistent rules table state functionality.

Details

It implements a test plan for the persistent rules table state functionality and includes some improvements to the other e2e tests to facilitate writing tests

  • visit() helper function input parameters were changed to match cy.visit(). It allows to pass a query string via qs and use the other fields.
  • added a skip agent installation step in installAwsCloudFrontWithPolicy used in detection_rules/related_integrations.cy.ts. The agent installation screen started appearing after changes to the visit() helper function. It looks like a bug since url app/integrations/detail/aws-1.17.0/overview?integration=cloudfront was concatenated with timeline=... query string inside visit() and cy.visit() finally invoked with app/integrations/detail/aws-1.17.0/overview?integration=cloudfront?timeline=.... Fixing that cause test to fail due to agent installation screen.
  • use default type delay for NOTES_TEXT_AREA in timelines/creation.cy.ts. It looks that zero typing delay caused test flakiness.
  • selectors and helper functions were reorganized to facilitate its usage.

Checklist

@maximpn maximpn added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Feature:Detection Rules Security Solution rules and Detection Engine Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Rule Management Security Detection Rule Management Team labels Jan 26, 2023
@maximpn maximpn self-assigned this Jan 26, 2023
@maximpn maximpn force-pushed the persistent-rules-table-state-e2e branch 2 times, most recently from 0749fd8 to 06c8cec Compare January 29, 2023 08:43
@maximpn maximpn marked this pull request as ready for review January 29, 2023 11:39
@maximpn maximpn requested review from a team as code owners January 29, 2023 11:39
@maximpn maximpn requested a review from xcrzx January 29, 2023 11:39
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

Copy link
Contributor

@e40pud e40pud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Jan 30, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fleet changes LGTM!

@maximpn maximpn force-pushed the persistent-rules-table-state-e2e branch from 664c228 to e2d509b Compare February 7, 2023 15:26
@maximpn maximpn requested review from a team as code owners February 7, 2023 15:26
Copy link
Contributor

@jamster10 jamster10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good on explore

@maximpn maximpn force-pushed the persistent-rules-table-state-e2e branch from 5ced520 to 6255256 Compare February 22, 2023 09:37
@maximpn maximpn requested a review from michaelolo24 February 22, 2023 09:42
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 930.5KB 930.6KB +69.0B
securitySolution 13.8MB 13.8MB +17.0B
total +86.0B

History

  • 💚 Build #109113 succeeded 5ced520ebdc5627f96366a7965e44cca9bd4a513
  • 💚 Build #109024 succeeded ada12da73c456b6a78a752b131086f4c59e69510
  • 💚 Build #108418 succeeded 61ea0103c4dbcba025b4ab5fc5e6f645bf9d6536
  • 💔 Build #108370 failed 1de9895946fe9a83dd63e2b2a7cfd323902838d8
  • 💔 Build #108129 failed 7a47a40b51d0ddbb97b2ae15d27d0c28c040d156
  • 💚 Build #107860 succeeded 457d499ea0b79693bd0bd1206729528fb7478329

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @maximpn

Copy link
Contributor

@michaelolo24 michaelolo24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Investigations changes! 👍🏾 nice work!

@maximpn maximpn merged commit 513a1f0 into elastic:main Feb 22, 2023
@banderror banderror removed the backport:skip This commit does not require backporting label Feb 22, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Feb 22, 2023
maximpn added a commit to maximpn/kibana that referenced this pull request Feb 22, 2023
…lastic#149638)

**Relates to:** elastic#140263

## Summary

This PR adds Cypress e2e tests to cover persistent rules table state functionality.

## Details

It implements a test plan for the persistent rules table state functionality and includes some improvements to the other e2e tests to facilitate writing tests

- `visit()` helper function input parameters were changed to match `cy.visit()`. It allows to pass a query string via `qs` and use the other fields.
- added a skip agent installation step in `installAwsCloudFrontWithPolicy ` used in `detection_rules/related_integrations.cy.ts`. The agent installation screen started appearing after changes to the `visit()` helper function. It looks like a bug since url `app/integrations/detail/aws-1.17.0/overview?integration=cloudfront` was concatenated with `timeline=...` query string inside `visit()` and `cy.visit()` finally invoked with `app/integrations/detail/aws-1.17.0/overview?integration=cloudfront?timeline=...`. Fixing that cause test to fail due to agent installation screen.
- use default type delay for `NOTES_TEXT_AREA` in `timelines/creation.cy.ts`. It looks that zero typing delay caused test flakiness.
- selectors and helper functions were reorganized to facilitate its usage.

### Checklist

- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios

(cherry picked from commit 513a1f0)
@maximpn
Copy link
Contributor Author

maximpn commented Feb 22, 2023

💚 All backports created successfully

Status Branch Result
8.7

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

maximpn added a commit that referenced this pull request Feb 22, 2023
…ests (#149638) (#151875)

# Backport

This will backport the following commits from `main` to `8.7`:
- [[Security Solution] Cover persistent rules table state by e2e tests
(#149638)](#149638)

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

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

<!--BACKPORT [{"author":{"name":"Maxim
Palenov","email":"maxim.palenov@elastic.co"},"sourceCommit":{"committedDate":"2023-02-22T13:46:50Z","message":"[Security
Solution] Cover persistent rules table state by e2e tests
(#149638)\n\n**Relates to:**
https://github.com/elastic/kibana/issues/140263\r\n\r\n##
Summary\r\n\r\nThis PR adds Cypress e2e tests to cover persistent rules
table state functionality.\r\n\r\n## Details\r\n\r\nIt implements a test
plan for the persistent rules table state functionality and includes
some improvements to the other e2e tests to facilitate writing
tests\r\n\r\n- `visit()` helper function input parameters were changed
to match `cy.visit()`. It allows to pass a query string via `qs` and use
the other fields.\r\n- added a skip agent installation step in
`installAwsCloudFrontWithPolicy ` used in
`detection_rules/related_integrations.cy.ts`. The agent installation
screen started appearing after changes to the `visit()` helper function.
It looks like a bug since url
`app/integrations/detail/aws-1.17.0/overview?integration=cloudfront` was
concatenated with `timeline=...` query string inside `visit()` and
`cy.visit()` finally invoked with
`app/integrations/detail/aws-1.17.0/overview?integration=cloudfront?timeline=...`.
Fixing that cause test to fail due to agent installation screen.\r\n-
use default type delay for `NOTES_TEXT_AREA` in
`timelines/creation.cy.ts`. It looks that zero typing delay caused test
flakiness.\r\n- selectors and helper functions were reorganized to
facilitate its usage.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common
scenarios","sha":"513a1f0538b4c3641e87d6665790e8daaa3bb985","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:skip","Team:Fleet","Feature:Detection
Rules","Team:Detections and Resp","Team:
SecuritySolution","Team:Detection
Rules","v8.8.0"],"number":149638,"url":"https://github.com/elastic/kibana/pull/149638","mergeCommit":{"message":"[Security
Solution] Cover persistent rules table state by e2e tests
(#149638)\n\n**Relates to:**
https://github.com/elastic/kibana/issues/140263\r\n\r\n##
Summary\r\n\r\nThis PR adds Cypress e2e tests to cover persistent rules
table state functionality.\r\n\r\n## Details\r\n\r\nIt implements a test
plan for the persistent rules table state functionality and includes
some improvements to the other e2e tests to facilitate writing
tests\r\n\r\n- `visit()` helper function input parameters were changed
to match `cy.visit()`. It allows to pass a query string via `qs` and use
the other fields.\r\n- added a skip agent installation step in
`installAwsCloudFrontWithPolicy ` used in
`detection_rules/related_integrations.cy.ts`. The agent installation
screen started appearing after changes to the `visit()` helper function.
It looks like a bug since url
`app/integrations/detail/aws-1.17.0/overview?integration=cloudfront` was
concatenated with `timeline=...` query string inside `visit()` and
`cy.visit()` finally invoked with
`app/integrations/detail/aws-1.17.0/overview?integration=cloudfront?timeline=...`.
Fixing that cause test to fail due to agent installation screen.\r\n-
use default type delay for `NOTES_TEXT_AREA` in
`timelines/creation.cy.ts`. It looks that zero typing delay caused test
flakiness.\r\n- selectors and helper functions were reorganized to
facilitate its usage.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common
scenarios","sha":"513a1f0538b4c3641e87d6665790e8daaa3bb985"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/149638","number":149638,"mergeCommit":{"message":"[Security
Solution] Cover persistent rules table state by e2e tests
(#149638)\n\n**Relates to:**
https://github.com/elastic/kibana/issues/140263\r\n\r\n##
Summary\r\n\r\nThis PR adds Cypress e2e tests to cover persistent rules
table state functionality.\r\n\r\n## Details\r\n\r\nIt implements a test
plan for the persistent rules table state functionality and includes
some improvements to the other e2e tests to facilitate writing
tests\r\n\r\n- `visit()` helper function input parameters were changed
to match `cy.visit()`. It allows to pass a query string via `qs` and use
the other fields.\r\n- added a skip agent installation step in
`installAwsCloudFrontWithPolicy ` used in
`detection_rules/related_integrations.cy.ts`. The agent installation
screen started appearing after changes to the `visit()` helper function.
It looks like a bug since url
`app/integrations/detail/aws-1.17.0/overview?integration=cloudfront` was
concatenated with `timeline=...` query string inside `visit()` and
`cy.visit()` finally invoked with
`app/integrations/detail/aws-1.17.0/overview?integration=cloudfront?timeline=...`.
Fixing that cause test to fail due to agent installation screen.\r\n-
use default type delay for `NOTES_TEXT_AREA` in
`timelines/creation.cy.ts`. It looks that zero typing delay caused test
flakiness.\r\n- selectors and helper functions were reorganized to
facilitate its usage.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common
scenarios","sha":"513a1f0538b4c3641e87d6665790e8daaa3bb985"}}]}]
BACKPORT-->
@maximpn maximpn deleted the persistent-rules-table-state-e2e branch February 24, 2023 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Detection Rules Security Solution rules and Detection Engine release_note:skip Skip the PR/issue when compiling release notes Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team:Fleet Team label for Observability Data Collection Fleet team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.7.0 v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.