Skip to content

Commit

Permalink
cypress process on CI crash fix (#4363)
Browse files Browse the repository at this point in the history
* bump cypress action version, moved experimental memory handle to main config

* wip

* switch to electron browser

* harcoded cypress v to 12.17 and numTestsKeptInMemory: 0

* switch back to chrome

* package json change: cypress:12.17.0 -> ^12.17.0

* switch to elektron browser

* typo in nightly workflow

* nightly workflow update - changed chrome to electron

* added changeset
  • Loading branch information
wojteknowacki committed Oct 24, 2023
1 parent e2f0e28 commit 5025ac3
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 21 deletions.
5 changes: 5 additions & 0 deletions .changeset/soft-hornets-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Change e2e default browser to electron
2 changes: 1 addition & 1 deletion .github/actions/e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ runs:
using: "composite"
steps:
- name: e2e with reports
uses: cypress-io/github-action@v5
uses: cypress-io/github-action@v6
with:
install: ${{inputs.install}}
browser: ${{inputs.browser}}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/tests-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ on:
browser:
required: true
description: "Browser"
default: "chrome"
default: "electron"
type: choice
options:
- chrome
- electron
- firefox
- all

Expand Down Expand Up @@ -161,12 +161,12 @@ jobs:
- name: Cypress install
id: cypress-install
if: ${{ github.event.inputs.tests != 'Critical' && github.event_name != 'repository_dispatch'}}
uses: cypress-io/github-action@v5
uses: cypress-io/github-action@v6
with:
runTests: false

- name: Cypress run chrome
id: cypress-chrome
- name: Cypress run electron
id: cypress-electron
if: ${{ github.event.inputs.tests != 'Critical' && github.event_name != 'repository_dispatch' && contains(fromJSON('["chrome", "all"]'), steps.get-browsers.outputs.result) && ! cancelled() }}
uses: ./.github/actions/e2e
with:
Expand All @@ -186,7 +186,7 @@ jobs:
splitIndex: ${{ strategy.job-index }}
commitInfoMessage: All tests triggered via ${{ github.event_name}} on ${{ steps.get-env-uri.outputs.ENV_URI }}
install: false
browser: chrome
browser: electron

- name: Cypress run firefox
id: cypress-firefox
Expand Down Expand Up @@ -308,7 +308,7 @@ jobs:
- name: Cypress run - automatically
id: cypress
continue-on-error: true
uses: cypress-io/github-action@v5
uses: cypress-io/github-action@v6
env:
API_URI: ${{ needs.get-environment-variables.outputs.url }}graphql/
APP_MOUNT_URI: ${{ secrets.APP_MOUNT_URI }}
Expand All @@ -329,7 +329,7 @@ jobs:
with:
install: false
parallel: true
group: "UI - Chrome"
group: "UI - Electron"
record: true
tag: ${{github.event.client_payload.project}}, ${{github.event.client_payload.environment}}, ${{ needs.get-environment-variables.outputs.url }}

Expand Down
4 changes: 2 additions & 2 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ module.exports = defineConfig({
viewportHeight: 660,
screenshotsFolder: "cypress/reports/mochareports",
screenshotOnRunFailure: true,
experimentalMemoryManagement: true,
numTestsKeptInMemory: 0,
retries: {
runMode: 2,
openMode: 0,
Expand All @@ -25,8 +27,6 @@ module.exports = defineConfig({
env: {
grepFilterSpecs: true,
grepOmitFiltered: true,
numTestsKeptInMemory: 10,
experimentalMemoryManagement: true,
},
baseUrl: process.env.BASE_URL,
async setupNodeEvents(on, config) {
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
"@types/jest": "^26.0.14",
"@types/setup-polly-jest": "^0.5.0",
"chromatic": "^6.17.4",
"cypress": "^12.4.0",
"cypress": "^12.17.0",
"cypress-file-upload": "^5.0.8",
"cypress-mailhog": "^1.3.0",
"cypress-mochawesome-reporter": "^3.5.1",
Expand Down

0 comments on commit 5025ac3

Please sign in to comment.