-
Notifications
You must be signed in to change notification settings - Fork 8k
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] Skip all Detection & Response Cypress tests in Serverless #165966
[Security Solution] Skip all Detection & Response Cypress tests in Serverless #165966
Conversation
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
b385328
to
0c7d76b
Compare
90c3bfc
to
ef8562a
Compare
ef8562a
to
c181eef
Compare
@@ -1316,6 +1316,7 @@ x-pack/test/security_solution_cypress/config.ts @elastic/security-engineering-pr | |||
x-pack/test/security_solution_cypress/runner.ts @elastic/security-engineering-productivity | |||
x-pack/test/security_solution_cypress/serverless_config.ts @elastic/security-engineering-productivity | |||
x-pack/test/security_solution_cypress/cypress/tags.ts @elastic/security-engineering-productivity | |||
x-pack/plugins/security_solution/scripts/run_cypress @MadameSheema @patrykkopycinski @oatkiller @maximpn @banderror |
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.
FYI @MadameSheema @patrykkopycinski @oatkiller @maximpn
See the PR description for motivation.
@@ -19,7 +19,7 @@ | |||
"junit:transform": "node ../../plugins/security_solution/scripts/junit_transformer --pathPattern '../../../target/kibana-security-solution/cypress/results/*.xml' --rootDirectory ../../../ --reportName 'Security Solution Cypress' --writeInPlace", | |||
"cypress:serverless": "TZ=UTC node ../../plugins/security_solution/scripts/start_cypress_parallel --config-file ../../test/security_solution_cypress/cypress/cypress_ci_serverless.config.ts --ftr-config-file ../../test/security_solution_cypress/serverless_config", | |||
"cypress:open:serverless": "yarn cypress:serverless open --config-file ../../test/security_solution_cypress/cypress/cypress_serverless.config.ts --spec './cypress/e2e/**/*.cy.ts'", | |||
"cypress:run:serverless": "yarn cypress:serverless --spec '**/cypress/e2e/!(investigations|explore)/**/*.cy.ts'", | |||
"cypress:run:serverless": "yarn cypress:serverless --spec './cypress/e2e/!(investigations|explore)/**/*.cy.ts'", |
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.
I also changed the pattern because it doesn't seem we need to support any nested subfolder structures which could be supported by **
@elasticmachine merge upstream |
- `@serverless` includes a test in the Serverless test suite. You need to explicitly add this tag to any test you want to run against a Serverless environment. | ||
- `@ess` includes a test in the normal, non-Serverless test suite. You need to explicitly add this tag to any test you want to run against a non-Serverless environment. | ||
- `@brokenInServerless` excludes a test from the Serverless test suite (even if it's tagged as `@serverless`). Indicates that a test should run in Serverless, but currently is broken. | ||
- `@skipInServerless` excludes a test from the Serverless test suite (even if it's tagged as `@serverless`). Could indicate many things, e.g. "the test is flaky in Serverless", "the test is Flaky in any type of environemnt", "the test has been temporarily excluded, see the comment above why". |
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.
Should we add @skipInEss
? If we need to skip for ESS right now we have to skip for all right?
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.
@yctercero This is a good point. I think we will need this tag eventually. And yes, if we need to skip for ESS right now we have to skip for all.
I'm not sure about adding it now because I think that "now we have to skip for all" is exactly what we should be doing now. Until we basically eliminate flakiness in our tests, we should treat a flaky test in ESS as being in general not yet fixed. Then, when we can say something like "ok, the rule creation Cypress tests have been all fixed and not flaky anymore in ESS and Serverless", then we could start skipping them in either environment if flakiness ever occurs again.
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.
security-engineering-productivity changes LGTM!!
Lots of thanks for doing this effort 🙏
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 for the changes! Ready to help with the next step of re-enabling these for DE.
Most of the tests passed in https://buildkite.com/elastic/kibana-pull-request/builds/157714. The failed ones look like flaky tests. Also, the
I also tested locally that if I enable at least one test using Cypress tags, the job will run it. I will remove the "all cypress tests" label and restart the build - hope it takes less time after that. |
e1f4fa2
to
22c2ab1
Compare
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.
Thank you for the detailed description, updated docs, and providing context/next steps -- appreciate it @banderror! LGTM 👍
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.
Cool! This PR also fixes Threat Intelligence Cypress Tests
cc @PhilippeOberti
22c2ab1
to
9be0ae5
Compare
9be0ae5
to
23ed5fc
Compare
💔 Build FailedFailed CI Steps
Test Failures
Metrics [docs]Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @banderror |
Hey folks, this PR introduced a SKIP for all tests that do not contain tags yet. Please take a look eg. at this https://buildkite.com/elastic/kibana-pull-request/builds/157814#018a769b-185b-4d22-bb6d-e2bf155745c6 We have some false passes around :P |
…rverless (elastic#165966) **Resolves: elastic#164441 ## Summary Skips all Cypress tests owned by @elastic/security-detection-rule-management and @elastic/security-detection-engine teams in Serverless using the new `@skipInServerless` tag. - Adds a new `@skipInServerless` tag - Updates `x-pack/test/security_solution_cypress/cypress/README.md` to explain when to use what tags - Explicitly adds missing tags to all D&R tests - Adds `// TODO:` comments to tests with links to follow-up tickets - Fixes the `x-pack/plugins/security_solution/scripts/run_cypress/parallel.ts` script (see below) Follow-up work: - elastic#161540 - elastic#161539 ## Context > Serverless test failures will soon block PR merge > During the development of the serverless test infrastructure, we decided that serverless tests will only soft-fail. That means you see the test failure in your PR but you're still able to merge. We did that mainly in order to not block delivery of stateful features and bug fixes while serverless tests and pipelines were implemented and stabilized. We now have the major building blocks for the serverless test infrastructure in place and will integrate serverless tests in our regular pipelines. As part of this process, we're skipping failing and flaky serverless tests that came in during the soft-fail phase. Once this is done, a PR with serverless test failures can no longer be merged, similar to how we have it for stateful test failures. > We plan to merge this in the next few days and we'll send out another notification when it's done. ## Fixing `parallel.ts` There were two problems with the `x-pack/plugins/security_solution/scripts/run_cypress/parallel.ts` script we use for running Cypress tests: - The script was broken in elastic#162673 (here on [this line](https://github.com/elastic/kibana/pull/162673/files#diff-9f40ced6d29c4fc2709af881680400293d8ce1bc9ebb07b9138d6d99c83c09c9R67)) - I think it has never supported situations when all tests matching a spec pattern (such as `./cypress/e2e/!(investigations|explore)/**/*.cy.ts`) end up being skipped via Cypress tags (such as `@skipInServerless`) Both the issues are fixed in this PR. Code owners are added for this script in the CODEOWNERS file to prevent breaking this script in future PRs.
Resolves: #164441
Summary
Skips all Cypress tests owned by @elastic/security-detection-rule-management and @elastic/security-detection-engine teams in Serverless using the new
@skipInServerless
tag.@skipInServerless
tagx-pack/test/security_solution_cypress/cypress/README.md
to explain when to use what tags// TODO:
comments to tests with links to follow-up ticketsx-pack/plugins/security_solution/scripts/run_cypress/parallel.ts
script (see below)Follow-up work:
Context
Fixing
parallel.ts
There were two problems with the
x-pack/plugins/security_solution/scripts/run_cypress/parallel.ts
script we use for running Cypress tests:./cypress/e2e/!(investigations|explore)/**/*.cy.ts
) end up being skipped via Cypress tags (such as@skipInServerless
)Both the issues are fixed in this PR.
Code owners are added for this script in the CODEOWNERS file to prevent breaking this script in future PRs.