Skip to content

Commit f235477

Browse files
authored
Merge pull request #9452 from jrafanie/enable-cypress-on-push-pr-with-chrome-only
Upgrade cypress to 14.4 and enable it on for PRs with chrome only, for all browsers on manual, push, schedule
2 parents 25a4aa2 + 995315c commit f235477

File tree

6 files changed

+51
-31
lines changed

6 files changed

+51
-31
lines changed

.github/workflows/cypress.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
name: Cypress
33
on:
4+
pull_request:
5+
push:
46
workflow_dispatch:
57
schedule:
68
- cron: 0 0 * * 0
@@ -37,36 +39,42 @@ jobs:
3739
TEST_SUITE: spec:cypress
3840
CYPRESS: true
3941
CYPRESS_BROWSER: ${{ matrix.cypress-browser }}
42+
RUN_CYPRESS: ${{ matrix.cypress-browser == 'chrome' || (matrix.cypress-browser != 'chrome' && github.event_name != 'pull_request') }}
4043
PGHOST: localhost
4144
PGPASSWORD: smartvm
4245
steps:
4346
- uses: actions/checkout@v4
4447
- name: Install Edge
4548
uses: browser-actions/setup-edge@v1
46-
if: ${{ matrix.cypress-browser == 'edge' }}
49+
if: ${{ matrix.cypress-browser == 'edge' && env.RUN_CYPRESS == 'true' }}
4750
- name: Set up system
4851
run: bin/before_install
52+
if: ${{ env.RUN_CYPRESS == 'true' }}
4953
- name: Set up Ruby
5054
uses: ruby/setup-ruby@v1
55+
if: ${{ env.RUN_CYPRESS == 'true' }}
5156
with:
5257
ruby-version: "${{ matrix.ruby-version }}"
53-
bundler-cache: true
58+
bundler-cache: 'true'
5459
timeout-minutes: 30
5560
- name: Set up Node
5661
uses: actions/setup-node@v4
62+
if: ${{ env.RUN_CYPRESS == 'true' }}
5763
with:
5864
node-version: "${{ matrix.node-version }}"
5965
cache: yarn
6066
- name: Prepare tests
6167
run: bin/setup
68+
if: ${{ env.RUN_CYPRESS == 'true' }}
6269
env: # We will be using the development database, so no need for the test database
6370
SKIP_TEST_RESET: "true"
6471
SKIP_DATABASE_RESET: "false"
6572
- name: Run tests
6673
run: bundle exec rake
74+
if: ${{ env.RUN_CYPRESS == 'true' }}
6775
- name: Save artifacts
6876
uses: actions/upload-artifact@v4
69-
if: failure()
77+
if: ${{ failure() && env.RUN_CYPRESS == 'true' }}
7078
with:
7179
name: cypress-${{ matrix.cypress-browser }}
7280
path: |

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ namespace :spec do
8989
# Set the rate limit to a large number to avoid 429: Too Many Requests errors
9090
# which can occur as cypress very quickly hits a lots of endpoints.
9191
puts "\n== Removing rate limit =="
92-
exit $?.exitstatus unless system("bundle exec rails runner 'MiqServer.my_server.add_settings_for_resource(:server => {:rate_limiting => {:request => {:limit => 99999}}})'")
92+
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}}})'")
9393

9494
puts "\n== Starting Rails server =="
9595
rails_pid = Bundler.with_original_env do

config/webpack/shared.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ const notShims = (module) => (!SplitChunksPlugin.checkTest(/shims/, module));
5858

5959
let plugins = [
6060
new webpack.DefinePlugin({
61-
// used only by v2v code now
6261
'process.env.NODE_ENV': JSON.stringify(env.NODE_ENV || 'development'),
62+
'process.env.CYPRESS': JSON.stringify(env.CYPRESS),
6363
}),
6464

6565
new ManifestPlugin({

cypress.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ module.exports = defineConfig({
99
viewportWidth: 1800,
1010
numTestsKeptInMemory: 0,
1111
videoCompression: false,
12+
13+
// See: https://docs.cypress.io/app/references/experiments#Experimental-Flake-Detection-Features
14+
retries: {
15+
experimentalStrategy: 'detect-flake-and-pass-on-threshold',
16+
experimentalOptions: {
17+
maxRetries: 2,
18+
passesRequired: 1,
19+
},
20+
21+
openMode: true,
22+
runMode: true,
23+
},
1224
// eslint-disable-next-line no-unused-vars
1325
setupNodeEvents(on, config) {
1426
on('after:spec', (spec, results) => {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
"core-js": "~3.6.4",
131131
"core-js-compat": "~3.2.1",
132132
"css-loader": "~3.4.2",
133-
"cypress": "^13.7.1",
133+
"cypress": "~14.4.0",
134134
"duplicate-package-checker-webpack-plugin": "~3.0.0",
135135
"enhanced-resolve": "~4.0.0",
136136
"enzyme": "^3.9.0",

yarn.lock

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,13 +1412,6 @@ __metadata:
14121412
languageName: node
14131413
linkType: hard
14141414

1415-
"@colors/colors@npm:1.5.0":
1416-
version: 1.5.0
1417-
resolution: "@colors/colors@npm:1.5.0"
1418-
checksum: 10/9d226461c1e91e95f067be2bdc5e6f99cfe55a721f45afb44122e23e4b8602eeac4ff7325af6b5a369f36396ee1514d3809af3f57769066d80d83790d8e53339
1419-
languageName: node
1420-
linkType: hard
1421-
14221415
"@csstools/convert-colors@npm:^1.4.0":
14231416
version: 1.4.0
14241417
resolution: "@csstools/convert-colors@npm:1.4.0"
@@ -1433,7 +1426,7 @@ __metadata:
14331426
languageName: node
14341427
linkType: hard
14351428

1436-
"@cypress/request@npm:^3.0.6":
1429+
"@cypress/request@npm:^3.0.8":
14371430
version: 3.0.8
14381431
resolution: "@cypress/request@npm:3.0.8"
14391432
dependencies:
@@ -4898,7 +4891,7 @@ __metadata:
48984891
languageName: node
48994892
linkType: hard
49004893

4901-
"ci-info@npm:^4.0.0":
4894+
"ci-info@npm:^4.1.0":
49024895
version: 4.2.0
49034896
resolution: "ci-info@npm:4.2.0"
49044897
checksum: 10/928d8457f3476ffc4a66dec93b9cdf1944d5e60dba69fbd6a0fc95b652386f6ef64857f6e32372533210ef6d8954634af2c7693d7c07778ee015f3629a5e0dd9
@@ -4964,16 +4957,16 @@ __metadata:
49644957
languageName: node
49654958
linkType: hard
49664959

4967-
"cli-table3@npm:~0.6.1":
4968-
version: 0.6.5
4969-
resolution: "cli-table3@npm:0.6.5"
4960+
"cli-table3@npm:0.6.1":
4961+
version: 0.6.1
4962+
resolution: "cli-table3@npm:0.6.1"
49704963
dependencies:
4971-
"@colors/colors": "npm:1.5.0"
4964+
colors: "npm:1.4.0"
49724965
string-width: "npm:^4.2.0"
49734966
dependenciesMeta:
4974-
"@colors/colors":
4967+
colors:
49754968
optional: true
4976-
checksum: 10/8dca71256f6f1367bab84c33add3f957367c7c43750a9828a4212ebd31b8df76bd7419d386e3391ac7419698a8540c25f1a474584028f35b170841cde2e055c5
4969+
checksum: 10/eb11ef1264d6e6480eef4d1306f7c9c25800751a40d3eb205f3910ff6e49d067b8b4208e2a17abe57742a57e3c19764a44a68dbf2761bc1f707fdb7b4d658cd9
49774970
languageName: node
49784971
linkType: hard
49794972

@@ -5122,6 +5115,13 @@ __metadata:
51225115
languageName: node
51235116
linkType: hard
51245117

5118+
"colors@npm:1.4.0":
5119+
version: 1.4.0
5120+
resolution: "colors@npm:1.4.0"
5121+
checksum: 10/90b2d5465159813a3983ea72ca8cff75f784824ad70f2cc2b32c233e95bcfbcda101ebc6d6766bc50f57263792629bfb4f1f8a4dfbd1d240f229fc7f69b785fc
5122+
languageName: node
5123+
linkType: hard
5124+
51255125
"combined-stream@npm:^1.0.6, combined-stream@npm:^1.0.8, combined-stream@npm:~1.0.6":
51265126
version: 1.0.8
51275127
resolution: "combined-stream@npm:1.0.8"
@@ -5734,11 +5734,11 @@ __metadata:
57345734
languageName: node
57355735
linkType: hard
57365736

5737-
"cypress@npm:^13.7.1":
5738-
version: 13.17.0
5739-
resolution: "cypress@npm:13.17.0"
5737+
"cypress@npm:~14.4.0":
5738+
version: 14.4.0
5739+
resolution: "cypress@npm:14.4.0"
57405740
dependencies:
5741-
"@cypress/request": "npm:^3.0.6"
5741+
"@cypress/request": "npm:^3.0.8"
57425742
"@cypress/xvfb": "npm:^1.2.4"
57435743
"@types/sinonjs__fake-timers": "npm:8.1.1"
57445744
"@types/sizzle": "npm:^2.3.2"
@@ -5749,9 +5749,9 @@ __metadata:
57495749
cachedir: "npm:^2.3.0"
57505750
chalk: "npm:^4.1.0"
57515751
check-more-types: "npm:^2.24.0"
5752-
ci-info: "npm:^4.0.0"
5752+
ci-info: "npm:^4.1.0"
57535753
cli-cursor: "npm:^3.1.0"
5754-
cli-table3: "npm:~0.6.1"
5754+
cli-table3: "npm:0.6.1"
57555755
commander: "npm:^6.2.1"
57565756
common-tags: "npm:^1.8.0"
57575757
dayjs: "npm:^1.10.4"
@@ -5775,15 +5775,15 @@ __metadata:
57755775
process: "npm:^0.11.10"
57765776
proxy-from-env: "npm:1.0.0"
57775777
request-progress: "npm:^3.0.0"
5778-
semver: "npm:^7.5.3"
5778+
semver: "npm:^7.7.1"
57795779
supports-color: "npm:^8.1.1"
57805780
tmp: "npm:~0.2.3"
57815781
tree-kill: "npm:1.2.2"
57825782
untildify: "npm:^4.0.0"
57835783
yauzl: "npm:^2.10.0"
57845784
bin:
57855785
cypress: bin/cypress
5786-
checksum: 10/6c548e2adf7ae127365570680aa32015dbeb94cad30ce4f8a92e2e58d8ef7033b7f0ece50579a0a13eb07061feede0c813ff8d1e50e0feb87520dece5be4ba95
5786+
checksum: 10/0fd3197ca611f14e36ad3ae3ae1890b4a2c79719a4125a329f63d2c84dc88284fafad9eb4edc01a9ec2b5a5d558b261734c8c185273495c71aed787c9039ed60
57875787
languageName: node
57885788
linkType: hard
57895789

@@ -11715,7 +11715,7 @@ __metadata:
1171511715
core-js-compat: "npm:~3.2.1"
1171611716
create-react-context: "npm:~0.3.0"
1171711717
css-loader: "npm:~3.4.2"
11718-
cypress: "npm:^13.7.1"
11718+
cypress: "npm:~14.4.0"
1171911719
d3: "npm:^7.8.2"
1172011720
dompurify: "npm:^3.2.4"
1172111721
duplicate-package-checker-webpack-plugin: "npm:~3.0.0"
@@ -15837,7 +15837,7 @@ __metadata:
1583715837
languageName: node
1583815838
linkType: hard
1583915839

15840-
"semver@npm:^7.2.1, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.5.3":
15840+
"semver@npm:^7.2.1, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.7.1":
1584115841
version: 7.7.2
1584215842
resolution: "semver@npm:7.7.2"
1584315843
bin:

0 commit comments

Comments
 (0)