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

moved cypress out of container #6931

Conversation

AndrewChubatiuk
Copy link
Collaborator

@AndrewChubatiuk AndrewChubatiuk commented Apr 27, 2024

What type of PR is this?

  • Refactor

Description

Moving cypress out of container decreases e2e test run up to 5 minutes, also for local setup no need to build container and install same deps. Also cypress builds from the start once there were changes in viz-lib, which it actually doesn't rely on.

  • replaced seed-data command with before hooks in cypress
  • moved cypress out of container
  • replaced viz-lib linking with just a link

How is this tested?

  • Unit tests (pytest, jest)
  • E2E Tests (Cypress)
  • Manually
  • N/A

Copy link

codecov bot commented Apr 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.76%. Comparing base (372adfe) to head (93d5497).
Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6931   +/-   ##
=======================================
  Coverage   63.76%   63.76%           
=======================================
  Files         161      161           
  Lines       13085    13085           
  Branches     1812     1812           
=======================================
  Hits         8344     8344           
  Misses       4438     4438           
  Partials      303      303           

@AndrewChubatiuk
Copy link
Collaborator Author

@justinclift @eradman could you please review?

@justinclift
Copy link
Member

@AndrewChubatiuk I can't do it tonight (end of day for me already), and I probably can't do it tomorrow either (paperwork day). Can look at it after that though, if no-one has gotten to it. 😄

One question though, as it's not obvious from the PR description, but what's the benefit from moving Cypress out of a container?

I can understand upgrading old Cypress version to newer, that's a good thing. 😄

I'm just unsure what the purpose/benefit/etc of removing the container bit is? Note, that's not me arguing, I'm actually asking. 😄

@AndrewChubatiuk
Copy link
Collaborator Author

Moving cypress out of container decreases e2e test run up to 5 minutes, also for local setup no need to build container and install same deps. Also cypress builds from the start once there were changes in viz-lib, which it actually doesn't rely on

@justinclift
Copy link
Member

decreases e2e test run up to 5 minutes

Awesome, that sounds like a good improvement. 😄

const LOGIN_PASSWORD = process.env.CYPRESS_LOGIN_PASSWORD || "password";
const ORG_NAME = process.env.CYPRESS_ORG_NAME || "Redash";

Cypress.Commands.add("setup", () => {
Copy link

Choose a reason for hiding this comment

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

How can I call this from terminal?
I got stuck so it never pass login screen on any test after I typed npm run cypress all

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this cypress command can be called using cy.setup, it's added to client/cypress/support/commands.js
it's executed before e2e tests execution. you need to run yarn cypress run-ci

Copy link

@mirkan1 mirkan1 May 7, 2024

Choose a reason for hiding this comment

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

I tested it on both node v16 and v20; this file has no access to .env file so please accept PR#24

const LOGIN_PASSWORD = process.env.CYPRESS_LOGIN_PASSWORD || "password";
const ORG_NAME = process.env.CYPRESS_ORG_NAME || "Redash";

Cypress.Commands.add("setup", () => {
Copy link

@mirkan1 mirkan1 May 7, 2024

Choose a reason for hiding this comment

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

I tested it on both node v16 and v20; this file has no access to .env file so please accept PR#24

Update Cypress tests to use environment variables for login credentials
@AndrewChubatiuk AndrewChubatiuk deleted the move-cypress-out-of-container branch May 9, 2024 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants