Skip to content
Snippets Groups Projects
Unverified Commit baed054f authored by pawit-metabase's avatar pawit-metabase Committed by GitHub
Browse files

upgrade to @percy/cypress 3.x (#17485)

* upgrade to @percy/cypress 3.x

@percy/cypress 2.x uses deprecated @percy/agent which includes
an old version of puppeteer. The old version of puppeteer causes
`yarn` command to fail on M1 macOS environment.

Upgrade to @percy/cypress 3.x removes the dependency and thus
solves the issue.

The upgrade was done by running `npx @percy/migrate`.

* remove percy healthcheck task

This no longer exists in 3.x, see
https://github.com/percy/percy-cypress/blob/master/README.md#upgrading

* remove deprecated percy/exec-action

and moved `percy exec` to the correct command

* run 'yarn install' before running percy
parent 5f6a1a01
No related branches found
No related tags found
No related merge requests found
......@@ -124,6 +124,7 @@ jobs:
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile --prefer-offline
- uses: actions/download-artifact@v2
name: Retrieve uberjar artifact
......@@ -135,9 +136,7 @@ jobs:
mv version.properties resources/
- name: Percy Test
uses: percy/exec-action@v0.3.1
with:
command: "yarn run test-visual-no-build"
run: yarn run test-visual-no-build
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
PERCY_COMMIT: ${{ needs.pr_info.outputs.commit_sha }}
......
......@@ -98,6 +98,7 @@ jobs:
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile --prefer-offline
- uses: actions/download-artifact@v2
name: Retrieve uberjar artifact
......@@ -109,8 +110,6 @@ jobs:
mv version.properties resources/
- name: Percy Test
uses: percy/exec-action@v0.3.1
with:
command: "yarn run test-visual-no-build"
run: yarn run test-visual-no-build
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
version: 1
version: 2
snapshot:
widths: [1280]
widths:
- 1280
min-height: 800
discovery:
disable-cache: true
......@@ -24,8 +24,6 @@ const isQaDatabase = process.env["QA_DB_ENABLED"];
const webpack = require("@cypress/webpack-preprocessor");
const { resolve } = require("../../../../webpack.config.js");
const percyHealthCheck = require("@percy/cypress/task");
const webpackPluginOptions = {
webpackOptions: { resolve },
watchOptions: {},
......@@ -36,9 +34,6 @@ module.exports = (on, config) => {
// `config` is the resolved Cypress config
require("cypress-grep/src/plugin")(config);
// Required for Percy
on("task", percyHealthCheck);
/********************************************************************
** WEBPACK **
********************************************************************/
......
......@@ -107,7 +107,7 @@
"@cypress/skip-test": "^2.6.0",
"@cypress/webpack-preprocessor": "^5.9.1",
"@percy/cli": "^1.0.0-beta.48",
"@percy/cypress": "^2.3.4",
"@percy/cypress": "^3.0.0",
"@testing-library/cypress": "^5.0.2",
"@testing-library/dom": "^7.29.0",
"@testing-library/jest-dom": "^4.0.0",
......@@ -205,8 +205,8 @@
"test-cypress-open": "./bin/build-for-test && yarn test-cypress-no-build --open",
"test-cypress-open-no-backend": "E2E_HOST='http://localhost:3000' yarn test-cypress-no-build --open",
"test-cypress-no-build": "yarn && babel-node ./frontend/test/__runner__/run_cypress_tests.js",
"test-visual": "percy exec -- yarn build && ./bin/build-for-test && yarn test-visual-no-build",
"test-visual-no-build": "yarn test-cypress-no-build --spec \"./frontend/test/metabase-visual/**/*.cy.spec.js\"",
"test-visual": "yarn build && ./bin/build-for-test && yarn test-visual-no-build",
"test-visual-no-build": "percy exec -- yarn test-cypress-no-build --spec \"./frontend/test/metabase-visual/**/*.cy.spec.js\"",
"test-visual-open": "percy exec -- yarn test-cypress-open --spec \"./frontend/test/metabase-visual/**/*.cy.spec.js\"",
"prepare": "husky install"
},
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment