-
Notifications
You must be signed in to change notification settings - Fork 111
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
[DRAFT] Separate cypress tests into "essential" tests that run on PRs vs "comprehensive" tests that run on main #7859
Conversation
Preview this change https://demo.audius.co/jd/cypress-essential-test-suite |
Thanks for taking the initiative! Couple of thoughts:
|
@@ -52,10 +52,21 @@ jobs: | |||
branches: | |||
only: /(^release.*)$/ | |||
|
|||
- web-test-staging-essential: |
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.
probably should rename both of these to web-test-cypress-pr
and web-test-cypress-main
or something
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.
yeah I was on the fence about the naming here, I think I might go with your suggestion and just name things PR or no
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'm fine with the way you have it tbh, @essential
is a good token to grep for and it makes sense to use it consistently all the way through the ci workflow name
- web-test-staging: | ||
context: Audius Client | ||
requires: | ||
- web-build-staging | ||
filters: | ||
branches: | ||
only: /^main$/ |
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.
probably want release branches too
|
||
import user from '../fixtures/user.json' | ||
|
||
// Enable the CLI grep tool | ||
registerCypressGrep() |
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.
this is cool!
Yeah 100% agree. My opinion is loosely held too, so I'm fine either way. I could also see an extreme where spinning up cypress itself is already too slow for PRs even as a baseline and pushing all cypress tests to main, and would be fine living with that as well if that's the consensus. The requirements or things to optimize for as I see them are:
And the debate is how to prioritize and balance 1 vs 2, but I think no matter what we decide there we're able to hit a solid baseline for all 3 |
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.
This is awesome!
Yeah the way you've grouped essential & non-essential seems good to me, let's work on growing the non-essential bucket over time
"should create an account" tests are skipped until they can be updated | ||
#### [Sign In](./signIn.cy.ts) - [C-4005] | ||
|
||
The 'can sign in' test is in jail until we can hard-code an OTP code |
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.
We could also whitelist the test account from OTP:
https://github.com/AudiusProject/audius-protocol/blob/main/packages/identity-service/src/utils/otp.js#L6
@@ -52,10 +52,21 @@ jobs: | |||
branches: | |||
only: /(^release.*)$/ | |||
|
|||
- web-test-staging-essential: |
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'm fine with the way you have it tbh, @essential
is a good token to grep for and it makes sense to use it consistently all the way through the ci workflow name
I think it's probably safe to close this |
Description
(This would be a draft PR but I want to see the CCI workflows changed here)
Context/Motivation
We've been discussing in our FE syncs how we want to increase cypress test coverage overall, but also want to avoid constantly spinning our wheels in PRs either waiting for long running test suites or spending time debugging flaky tests.
The solution proposed here is to migrate a portion of our suite to not run on PRs and instead run on every main commit. This way we are able to quickly ship PRs but still have test coverage on each change identifying which commit caused issues.
We also discussed putting stuff further away from PRs, in frequencies like scheduled builds (morning/nightly/etc), on release branchs only, and some other potential options. If we decide to do any of those it will be pretty easy to adjust; we just change what triggers the "comprehensive" suite flow
Changes in this PR
Using cypress-grep, this PR enables adding an
@essential
tag to a cypress test block to dictate whether a test runs on PRs or not (all tests run on main no matter what)I took a stab at picking which of our existing tests should be "essential" or not (spoiler; mostly essential)
Please do give feedback on these and whether some belong in/out of the "essential" list.
Essential (runs on every PR commit; aka existing flow)
signIn.cy.ts
signOut.cy.ts
signUp.cy.ts
uploadTrack.cy.ts
playTrack.cy.ts
Non-Essential (runs on main commits only; aka the new flow)
favoriteTrack.cy.ts
repostTrack.cy.ts
(I was on the fence about even putting these in non-essential, so please do give feedback)
Future TODOs
How Has This Been Tested?
TODO: watch CCI and make sure it works, also will verify suite runs once it goes to main (a little bit of 🚢 and 🙏)