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] Removing cy.session from Cypress tests #170969

Merged

Conversation

MadameSheema
Copy link
Member

Context

We are working to execute our Cypress tests in the second Quality Gate (QA environment, deployed projects on MKI). To do so we are mimicking the orchestration we currently have thanks to the parallel.ts script on our ESS and serverless FTR environment, where each spec file is executed in its own project and each spec file can set the PLI that needs to be executed.

As part of this effort, we are trying to make our Cypress tests more robust and reliable what means having several consecutive green executions on an MKI environment through the buildkite pipeline we are testing.

During our testing we started to find a sign-off/unauthorized issue in some of our tests.

image

image

We originally thought that the issue might be caused due to the project not being fully initialized, so we added a big delay after the project creation without success, as well as other safety guards around the project as waiting to be able to login in our application before starting with the tests.

After digging more into the code, we saw that we are using cy.session in our login. With that implemented, after the first login, we store the session and we reuse it when login is called again inside the spec file.

All the above failures we faced, happened in spec files with login on a beforeEach hook, so it seemed that reusing the session was not a good idea in these MKI environments. We deleted the method and the execution worked as expected

In this PR

In this PR we are removing the cy.session functionality from our login.

@MadameSheema MadameSheema added release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.12.0 labels Nov 9, 2023
@MadameSheema MadameSheema self-assigned this Nov 9, 2023
@elasticmachine
Copy link
Contributor

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

@MadameSheema MadameSheema enabled auto-merge (squash) November 9, 2023 16:01
Copy link
Contributor

@charlie-pichette charlie-pichette left a comment

Choose a reason for hiding this comment

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

👍🏼

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

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

cc @MadameSheema

@MadameSheema MadameSheema merged commit ebe0d1b into elastic:main Nov 9, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Nov 9, 2023
@MadameSheema MadameSheema deleted the removing-session-from-cypress branch June 28, 2024 10:54
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 release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants