-
Notifications
You must be signed in to change notification settings - Fork 358
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
test: [M3-8517] - Cloud changes for component test CI #10926
test: [M3-8517] - Cloud changes for component test CI #10926
Conversation
…or Cypress Component tests
Coverage Report: ✅ |
mochaFile: 'cypress/results/test-results-[hash].xml', | ||
rootSuiteTitle: 'Cloud Manager Cypress Tests', | ||
testsuitesTitle: testSuiteName, | ||
jenkinsMode, |
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 can't remember why we never set Jenkins mode to begin with, but it makes the output in the Jenkins run "Test" section a lot more readable. Sadly we can't just set this globally now that we have other teams like SRE who depend on our JUnit test results, so for right now this will only be set for the component test JUnit output
return setupPlugins(on, config, [ | ||
loadEnvironmentConfig, | ||
discardPassedTestRecordings, | ||
enableJunitReport('Component', true), |
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.
@abailly-akamai For the UI tests, we added the CY_TEST_DISABLE_FILE_WATCHING
env var to prevent the Cypress UI from automatically stopping and re-running tests when it detects file changes.
Do you think that behavior should apply to the component tests as well, or do we want to keep file watching enabled since developing these tests is more iterative / the tests run quickly?
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 think it's okay to make the behavior apply to both.
As far as I know, I don't ever set CY_TEST_DISABLE_FILE_WATCHING
. I like having my files be watched when developing 👀
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 do use CY_TEST_DISABLE_FILE_WATCHING
, it's very helpful when working on resource intensive CY test and saving files often (rate limiting etc). Doesn't really apply as much for component tests as you mentioned, but applying the behavior to both makes sense to me as well.
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.
Just to pose one last option: we can break this into 2 env vars so they can be configured independently, so @abailly-akamai you could keep file watching disabled for UI tests and enabled for component tests
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 kinda prefer to have it control both so it's one less variable to remember (and also very few people seem to use it), but I can go either way
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.
That makes sense too -- there's already an overwhelming number of configuration options.
I'll make it apply to both, but this is easy to change so if it ever becomes a pain point we can always revisit 👍
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.
Actually I spoke too soon -- with component tests, it looks like the hot reloading is handled by Vite/our Vite config.
I think it could be changed dynamically using the CY_TEST_DISABLE_FILE_WATCHING
env var, but the little bit of messing around I was doing with it started to get real hacky so I figure I'll just hold off unless this becomes a pain.
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.
Good with me!
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.
YESS. ty! Can't wait to make more strides towards real interactive component tests and reduce UI behavior testing with jest/vitest
* Add component test Jenkinsfile * Load fonts from index template, add `cy:component:run` command * Add component test runner to Docker Compose file * Fix region select component test * Allow explicit suite name to be specified in JUnit report * Expose env, discard passed test recordings, and enable JUnit output for Cypress Component tests * Add changeset, make slight improvements to Docker Compose docs
Description 📝
This PR contains the changes needed to get the Cloud Manager component tests running via CI. There isn't too much testing that can be done for this, but I did add some information to the ticket related to validating these changes.
Changes 🔄
yarn cy:component:run
command to run component tests via the CLIHow to test 🧪
yarn cy:component:run
and make sure tests run and passAs an Author I have considered 🤔
Check all that apply