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

[Rule Management] Remove before and after hooks from Cypress tests #175022

Closed
Tracked by #153633 ...
MadameSheema opened this issue Jan 17, 2024 · 5 comments · Fixed by #178891
Closed
Tracked by #153633 ...

[Rule Management] Remove before and after hooks from Cypress tests #175022

MadameSheema opened this issue Jan 17, 2024 · 5 comments · Fixed by #178891
Labels
Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. test

Comments

@MadameSheema
Copy link
Member

Relates to:

#173327
#174247

Get rid of the before and after hooks in favor of the beforeEach and afterEach hooks. Or at least make sure that the code executed in the before and after hook is not prone to fail (i.e. es_archiver).

@MadameSheema MadameSheema added Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Rule Management Security Detection Rule Management Team labels Jan 17, 2024
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management)

@banderror
Copy link
Contributor

@MadameSheema What's the difference between this ticket and #175098? It looks like both are related to test retries on CI/CD and before*/after* hooks.

@elasticmachine
Copy link
Contributor

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

@MadameSheema
Copy link
Member Author

@MadameSheema What's the difference between this ticket and #175098? It looks like both are related to test retries on CI/CD and before*/after* hooks.

Are related but are different. I've seen some tests where we are not cleaning the data that we are generating or modifying. In CI/CD each spec file is executed the first time in a new environment, but when there is a Cypress retry, the same environment is used, so if the data is not deleted, the test is prone to fail.

MadameSheema added a commit that referenced this issue Mar 25, 2024
…s not loading an archive (#178891)

## Summary

Addresses: #175022

Update:
[Flaky test suite runner passed
successfully](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5522)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Mar 25, 2024
…s not loading an archive (elastic#178891)

## Summary

Addresses: elastic#175022

Update:
[Flaky test suite runner passed
successfully](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5522)

(cherry picked from commit 6f49ab8)
kibanamachine added a commit that referenced this issue Mar 29, 2024
…ok if is not loading an archive (#178891) (#179333)

# Backport

This will backport the following commits from `main` to `8.13`:
- [[Security Solution][Rule Management] Getting rid off before hook if
is not loading an archive
(#178891)](#178891)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Gloria
Hornero","email":"gloria.hornero@elastic.co"},"sourceCommit":{"committedDate":"2024-03-25T11:04:13Z","message":"[Security
Solution][Rule Management] Getting rid off before hook if is not loading
an archive (#178891)\n\n## Summary\r\n\r\nAddresses:
#175022
test suite runner
passed\r\nsuccessfully](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5522)","sha":"6f49ab85e81fe123338a1a0a61266fb7c67606f9","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","test_ui_functional","release_note:skip","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","v8.14.0","v8.13.1"],"title":"[Security Solution][Rule
Management] Getting rid off before hook if is not loading an
archive","number":178891,"url":"#178891
Solution][Rule Management] Getting rid off before hook if is not loading
an archive (#178891)\n\n## Summary\r\n\r\nAddresses:
#175022
test suite runner
passed\r\nsuccessfully](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5522)","sha":"6f49ab85e81fe123338a1a0a61266fb7c67606f9"}},"sourceBranch":"main","suggestedTargetBranches":["8.13"],"targetPullRequestStates":[{"branch":"main","label":"v8.14.0","branchLabelMappingKey":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/178891","number":178891,"mergeCommit":{"message":"[Security
Solution][Rule Management] Getting rid off before hook if is not loading
an archive (#178891)\n\n## Summary\r\n\r\nAddresses:
#175022
test suite runner
passed\r\nsuccessfully](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5522)","sha":"6f49ab85e81fe123338a1a0a61266fb7c67606f9"}},{"branch":"8.13","label":"v8.13.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Gloria Hornero <gloria.hornero@elastic.co>
Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. test
Projects
None yet
3 participants