-
Notifications
You must be signed in to change notification settings - Fork 360
Upgrade cypress to 14.4 and enable it on for PRs with chrome only, for all browsers on manual, push, schedule #9452
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
Upgrade cypress to 14.4 and enable it on for PRs with chrome only, for all browsers on manual, push, schedule #9452
Conversation
43fce3b
to
8da6be6
Compare
8da6be6
to
f442479
Compare
.github/workflows/cypress.yaml
Outdated
#- firefox | ||
#- edge |
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 know this PR is WIP, but I think we can keep these in place, and use conditionals like if: ${{ matrix.cypress-browser == 'chrome' && github.event_name == 'push' }}
or something similar to enable it only in certain cases.
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, just trying to figure out how to get the flakiness out... it's 2009 all over again
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.
Ok, pushed some changes... I can't access matrix early on to skip the whole workflow so I had to skip each step. To avoid having that logic copy / pasted everywhere, I added a step to contain the logic and reuse it later on.
47a81f6
to
2bf2dfd
Compare
exit $?.exitstatus unless system("bundle exec rails runner 'MiqServer.my_server.add_settings_for_resource(:server => {:rate_limiting => {:request => {:limit => 99999}}})'") | ||
exit $?.exitstatus unless system("bundle exec rails runner 'MiqServer.my_server.add_settings_for_resource(:server => {:rate_limiting => {:request => {:limit => 99999}, :ui_login => {:limit => 99999}}})'") |
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.
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 idea. I threw this in to try to get green but you bring up a good point. Is there any reason in development to have rack attack configured? Clearly, we can do an exception for cypress but I wonder what's the benefit to having it in dev mode.
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.
Is there any reason to development has rack attack configured?
That's actually a great question. The only reason I can think of is since we disable in testing, then there's nothing else running through this code otherwise. If we get an upgrade to the gem that breaks something it won't be caught in dev or test otherwise (but probably would be caught in PEN test). Maybe the security suite should be updated to ensure it's working as intended?
af96e1a
to
dd3fd8a
Compare
f131e58
to
c1ebaf0
Compare
.github/workflows/cypress.yaml
Outdated
- name: Set up system | ||
run: bin/before_install | ||
if: ${{ matrix.cypress-browser == 'chrome' || (matrix.cypress-browser != 'chrome' && github.event_name != 'pull_request') }} |
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 know this is WIP, so future cleanup idea.
I'm thinking let's shove this into an ENV var with a sensible name, then use that later. Either that or run an initial step that sets an output to the result and use that. So for env idea, something like
env:
TEST_SUITE: spec:cypress
RUN_CYPRESS: ${{ matrix.cypress-browser == 'chrome' || (matrix.cypress-browser != 'chrome' && github.event_name != 'pull_request') }}
...
steps:
...
- name: Set up system
run: bin/before_install
if: ${{ env.RUN_CYPRESS }}
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.
LOL you read my mind.
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.
Though I think env might be cleaner and I think it can support booleans
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 like the name. I think we might want pushes, manual / adhoc, and scheduled runs to be full browser support. Either way, we can tweak it once we have better ideas.
d3bebb0
to
1318ebb
Compare
Allow full cypress runs with all browsers on: * adhoc workflow_dispatch * pushes * schedule Currently, firefox is very slow, over 40 minutes, while chrome and edge are under 20 minutes each. For now, let's get chrome to verify PRs while we upgrade cypress and try to improve the speed further.
With this configuration, we expect each test to pass 1 out of 3 tries. If it does, it passes. We can track which tests often are flaky by watching for retries, while also keeping the test suite green.
471cbf9
to
694c8ef
Compare
app/javascript/oldjs/application.js
Outdated
if (process.env.NODE_ENV === 'development' && process.env.CYPRESS !== 'true') { | ||
require('./miq_debug.js'); | ||
require('./miq_debug.css'); | ||
} |
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.
TODO: this conditional doesn't work correctly as CYPRESS env variable is never defined. I tried REACT_APP_CYPRESS and other things such as trying to push it into webpack but nothing worked so for now, I have this removed in this PR as the notifications cause far too many sporadic test failures.
694c8ef
to
995315c
Compare
@jrafanie A conflict occurred during the backport of this pull request to If this pull request is based on another pull request that has not been marked for backport, add the appropriate labels to the other pull request. Otherwise, please create a new pull request direct to the Conflict details: diff --cc yarn.lock
index 033be2987d,fba156267c..0000000000
--- a/yarn.lock
+++ b/yarn.lock
@@@ -15837,12 -15837,12 +15837,18 @@@ __metadata
languageName: node
linkType: hard
++<<<<<<< HEAD
+"semver@npm:^7.2.1, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.5.3":
+ version: 7.7.1
+ resolution: "semver@npm:7.7.1"
++=======
+ "semver@npm:^7.2.1, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.7.1":
+ version: 7.7.2
+ resolution: "semver@npm:7.7.2"
++>>>>>>> f2354776cc (Merge pull request #9452 from jrafanie/enable-cypress-on-push-pr-with-chrome-only)
bin:
semver: bin/semver.js
- checksum: 10/7a24cffcaa13f53c09ce55e05efe25cd41328730b2308678624f8b9f5fc3093fc4d189f47950f0b811ff8f3c3039c24a2c36717ba7961615c682045bf03e1dda
+ checksum: 10/4cfa1eb91ef3751e20fc52e47a935a0118d56d6f15a837ab814da0c150778ba2ca4f1a4d9068b33070ea4273629e615066664c2cfcd7c272caf7a8a0f6518b2c
languageName: node
linkType: hard
|
Backported to
|
…-chrome-only Upgrade cypress to 14.4 and enable it on for PRs with chrome only, for all browsers on manual, push, schedule (cherry picked from commit f235477)
@Fryguy did you manually fix the conflict? Is there anything more to do here? I can test it later. |
I figured out that we had to backport #9434 first |
Upgrade cypress to 14.4
Run cypress via chrome only on pull requests
Allow full cypress runs with all browsers on:
TODO list:
Consider dropping rate limit / rack attack entirely for cypress or change the configuration for cypress 'mode' so we don't need to do the hack in the UI rake taskWe will handle this as a followupshould we extract the 14.4 upgrade out of this PR?we will do it here