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] fixes flaky-test-runner Cypress Security Solution tests #134205

Merged

Conversation

vitaliidm
Copy link
Contributor

@vitaliidm vitaliidm commented Jun 13, 2022

Summary

Fixes issue with security solution cypress flaky test runner

After introducing dynamic split for cypress tests in Security Solution, there was discovered an issue with flaky test runner, which is using parallelism in slightly different manner: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/697#_: tests were evenly split between N jobs, instead of repeating tests N times(as N jobs)

So, for flaky runner, I introducing a new ENV variable that would disable split for tests between parallel jobs and instead would run all test per each job.

Here is link to flaky runner build from this PR, which shows that all test runs per job
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/736

@vitaliidm vitaliidm self-assigned this Jun 14, 2022
@vitaliidm vitaliidm added bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Feature:Functional Testing 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 Jun 14, 2022
@vitaliidm vitaliidm changed the title [CI] fix-flaky-test-runner-for-security-solution [Security Solution] fix flaky-test-runner Cypress SecuritySolution Jun 14, 2022
@vitaliidm vitaliidm changed the title [Security Solution] fix flaky-test-runner Cypress SecuritySolution [Security Solution] fixes flaky-test-runner Cypress Security Solution tests Jun 14, 2022
@vitaliidm vitaliidm marked this pull request as ready for review June 14, 2022 12:08
@vitaliidm vitaliidm requested review from a team as code owners June 14, 2022 12:08
@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

@cavokz cavokz left a comment

Choose a reason for hiding this comment

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

LGTM

@vitaliidm
Copy link
Contributor Author

vitaliidm commented Jun 14, 2022

@cavokz , I had to revert changes you proposed

variables CLI_NUMBER, CLI_NUMBER are getting rewritten inside .buildkite/scripts/steps/functional/${CYPRESS_SUITE}.sh script
as these variables getting populated by from buildkite variables

https://github.com/elastic/kibana/blob/main/.buildkite/scripts/steps/functional/security_solution.sh#L8-L9

Let me know if you are fine with my initial solution or would like to approach it in other way

@cavokz
Copy link
Contributor

cavokz commented Jun 14, 2022

Let me know if you are fine with my initial solution or would like to approach it in other way

You can surely go with the initial approach but this is the start of a flags war, where some override others. I'd consider why this is happening before pushing the button.

@vitaliidm
Copy link
Contributor Author

You can surely go with the initial approach but this is the start of a flags war, where some override others. I'd consider why this is happening before pushing the button.

My understanding, It happens because buildkite context ENV variables in cypress bash script become available only in pipeline step runtime. So, only using these runtime variables in configuration, won't have any effect. That's why we need new ENV value that would be able to disable split tests from pipeline steps config

@cavokz
Copy link
Contributor

cavokz commented Jun 14, 2022

variables CLI_NUMBER, CLI_NUMBER are getting rewritten inside .buildkite/scripts/steps/functional/${CYPRESS_SUITE}.sh script as these variables getting populated by from buildkite variables

https://github.com/elastic/kibana/blob/main/.buildkite/scripts/steps/functional/security_solution.sh#L8-L9

My apologies, I'm reading that file only now. What I prefer then is, in that file, populate CLI_NUMBER and CLI_COUNT only if they are not already defined. Then set them to 1, as in my previous request.

@cavokz cavokz self-requested a review June 14, 2022 20:31
Copy link
Contributor

@cavokz cavokz left a comment

Choose a reason for hiding this comment

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

Yes, exactly. Thanks.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

cc @vitaliidm

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 bug Fixes for quality problems that affect the customer experience Feature:Functional Testing 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: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants