Move Cypress to dev dependencies (#3991)

* Test Cypress on package list

* Skip Puppeteer Chromium as well

* Put back missing npm install on netlify.toml

* Netlify: move env vars to build.environment

* Remove cypress:install script

* Update Cypress dockerfile

* Copy package-lock.json to Cypress dockerfile
This commit is contained in:
Gabriel Dutra 2020-09-29 03:51:28 -03:00 committed by GitHub
parent c821cab4cb
commit f4dcb2918a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 4766 additions and 18 deletions

View File

@ -3,11 +3,9 @@ FROM cypress/browsers:chrome67
ENV APP /usr/src/app
WORKDIR $APP
COPY package.json $APP/package.json
RUN npm run cypress:install > /dev/null
COPY client/cypress $APP/client/cypress
COPY cypress.json $APP/cypress.json
COPY package.json package-lock.json $APP/
COPY viz-lib $APP/viz-lib
RUN npm ci > /dev/null
COPY . $APP

View File

@ -57,6 +57,9 @@ jobs:
- store_artifacts:
path: coverage.xml
frontend-lint:
environment:
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
docker:
- image: circleci/node:12
steps:
@ -67,6 +70,9 @@ jobs:
- store_test_results:
path: /tmp/test-results
frontend-unit-tests:
environment:
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
docker:
- image: circleci/node:12
steps:
@ -90,6 +96,8 @@ jobs:
PERCY_TOKEN_ENCODED: ZGRiY2ZmZDQ0OTdjMzM5ZWE0ZGQzNTZiOWNkMDRjOTk4Zjg0ZjMxMWRmMDZiM2RjOTYxNDZhOGExMjI4ZDE3MA==
CYPRESS_PROJECT_ID_ENCODED: OTI0Y2th
CYPRESS_RECORD_KEY_ENCODED: YzA1OTIxMTUtYTA1Yy00NzQ2LWEyMDMtZmZjMDgwZGI2ODgx
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
docker:
- image: circleci/node:12
steps:

View File

@ -3,6 +3,9 @@ FROM node:12 as frontend-builder
# Controls whether to build the frontend assets
ARG skip_frontend_build
ENV CYPRESS_INSTALL_BINARY=0
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1
WORKDIR /frontend
COPY package.json package-lock.json /frontend/
COPY viz-lib /frontend/viz-lib

View File

@ -35,7 +35,7 @@ backend-unit-tests: up test_db
docker-compose run --rm --name tests server tests
frontend-unit-tests: bundle
npm ci
CYPRESS_INSTALL_BINARY=0 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 npm ci
npm run bundle
npm test

View File

@ -3,6 +3,10 @@
publish = "client/dist"
command = "npm ci && npm run build"
[build.environment]
CYPRESS_INSTALL_BINARY = "0"
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = "1"
[[redirects]]
from = "/api/*"
to = "http://preview-backend.redashapp.com/api/:splat"

4751
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,6 @@
"jest": "TZ=Africa/Khartoum jest",
"test": "run-s type-check jest",
"test:watch": "jest --watch",
"cypress:install": "npm install --no-save cypress@~4.12.1 @percy/agent@0.26.2 @percy/cypress@^2.2.0 atob@2.1.2 lodash@^4.17.10 request-cookies@^1.1.0 @cypress/code-coverage@^3.8.1",
"cypress": "node client/cypress/cypress.js",
"postinstall": "(cd viz-lib && npm ci && npm run build:babel)"
},
@ -59,7 +58,6 @@
"font-awesome": "^4.7.0",
"history": "^4.10.1",
"hoist-non-react-statics": "^3.3.0",
"lodash": "^4.17.10",
"markdown": "0.5.0",
"material-design-iconic-font": "^2.2.0",
"moment": "^2.19.3",
@ -87,6 +85,9 @@
"@babel/preset-env": "^7.10.4",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.10.4",
"@cypress/code-coverage": "^3.8.1",
"@percy/agent": "^0.26.2",
"@percy/cypress": "^2.3.1",
"@types/classnames": "^2.2.10",
"@types/hoist-non-react-statics": "^3.3.1",
"@types/lodash": "^4.14.157",
@ -95,6 +96,7 @@
"@types/react-dom": "^16.9.8",
"@typescript-eslint/eslint-plugin": "^2.10.0",
"@typescript-eslint/parser": "^2.10.0",
"atob": "^2.1.2",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.1.0",
"babel-loader": "^8.0.5",
@ -102,6 +104,7 @@
"babel-plugin-transform-builtin-extend": "^1.1.2",
"copy-webpack-plugin": "^4.5.3",
"css-loader": "^0.28.7",
"cypress": "^4.12.1",
"enzyme": "^3.8.0",
"enzyme-adapter-react-16": "^1.7.1",
"enzyme-to-json": "^3.3.5",
@ -126,6 +129,7 @@
"less": "^3.9.0",
"less-loader": "^4.1.0",
"less-plugin-autoprefix": "^1.5.1",
"lodash": "^4.17.20",
"mini-css-extract-plugin": "^0.4.4",
"mockdate": "^2.0.2",
"npm-run-all": "^4.1.5",