-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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 Solutions] Make Cypress tests work independent of on-disk rules vs cloud rules #105857
[Security Solutions] Make Cypress tests work independent of on-disk rules vs cloud rules #105857
Conversation
…it pulls from online
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @FrankHassanabad!
x-pack/plugins/security_solution/cypress/integration/detection_rules/prebuilt_rules.spec.ts
Show resolved
Hide resolved
x-pack/plugins/security_solution/cypress/tasks/alerts_detection_rules.ts
Show resolved
Hide resolved
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving this since I it is not a good idea to have our tests blocking things but I would deeply appreciate @FrankHassanabad if we can have a quick call to have a better understanding why that missalignment exist. Thanks for taking care of this :)
Putting this in draft mode in favor of potentially one of the other options from: |
Closing this since we went with a different option here: |
Summary
Whenever we forget to mirror a rule on disk on-disk compared to a fleet server being updated, the pre-packaged rules will activate and prefer to grab the rules from the online service which can and will cause issues with our tests. This PR decouples that logic so that the total count of rules comes from the pre-packaged rule endpoint instead of relying on-disk rules.
>=
check instead of strict equals and splits out the regex of numbers from their text in the tests.prebuild_rules.spec.ts
One important CON to mention is that you're losing a bit of test safety that all the rules were installed correctly since we use a
>=
even when checking strings around deleting rules.How to manual testing this situation:
Run the cypress tests and delete one of the rules from
And you should see Cypress still passing tests.
Checklist