Files
cypress/circle.yml
Gleb Bahmutov 4e11b5bdde cli: downgrade chalk (#6569)
* cli: downgrade chalk

* add job to test NPM on minimum Node version

* forgot to attach workspace

* try updating npm

* try installing npm 5.0.4

* try npm 5.1.0

* skip npm init, just install Cypress

* try using Yarn

* run additional Cypress commands

* print Cypress version

* print Cypress version

* hmm, try different user

* yarn-lock

* back to npm

* print npm version

Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
2020-02-28 10:25:25 +06:30

1469 lines
40 KiB
YAML

version: 2.1
# usually we don't build Mac app - it takes a long time
# but sometimes we want to really confirm we are doing the right thing
# so just add your branch to the list here to build and test on Mac
macBuildFilters: &macBuildFilters
filters:
branches:
only:
- develop
defaults: &defaults
parallelism: 1
working_directory: ~/cypress
parameters:
executor:
type: executor
default: cy-doc
executor: <<parameters.executor>>
environment:
## set specific timezone
TZ: "/usr/share/zoneinfo/America/New_York"
## store artifacts here
CIRCLE_ARTIFACTS: /tmp/artifacts
## set so that e2e tests are consistent
COLUMNS: 100
LINES: 24
# filters and requires for testing binary with Firefox
testBinaryFirefox: &testBinaryFirefox
filters:
branches:
only:
- develop
requires:
- build-npm-package
- build-binary
executors:
# the Docker image with Cypress dependencies and Chrome browser
cy-doc:
docker:
- image: cypress/browsers:node12.8.1-chrome78-ff70
environment:
PLATFORM: linux
# Docker image with non-root "node" user
non-root-docker-user:
docker:
- image: cypress/base:12.0.0
user: node
environment:
PLATFORM: linux
# executor to run on Mac OS
# https://circleci.com/docs/2.0/executor-types/#using-macos
# https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions
mac:
macos:
xcode: "10.1.0"
environment:
PLATFORM: mac
commands:
install-latest-chrome:
description: Install latest Google Chrome (stable)
parameters:
browser:
default: "electron"
description: browser shortname to target
type: string
steps:
- run:
name: Install latest Google Chrome (stable)
command: |
if [ << parameters.browser >> == "chrome" ]; then
echo "**** Running Chrome tests. Installing latest stable version of Google Chrome. ****"
apt-get update
apt-get install google-chrome-stable -y
echo "**** Location of Google Chrome Installation: "`which google-chrome`" ****"
echo "**** Google Chrome Version: "`google-chrome --version`" ****"
else
echo "**** Not updating Chrome. Running tests in '<< parameters.browser >>' ****"
fi
run-e2e-tests:
parameters:
browser:
default: "electron"
description: browser shortname to target
type: string
chunk:
description: e2e test chunk number
type: integer
steps:
- attach_workspace:
at: ~/
- run:
command: yarn lerna exec --scope @packages/server "yarn test ./test/e2e/<< parameters.chunk >>*spec* --browser << parameters.browser >>"
- verify-mocha-results
- store_test_results:
path: /tmp/cypress
- store-npm-logs
store-npm-logs:
description: Saves any NPM debug logs as artifacts in case there is a problem
steps:
- store_artifacts:
path: ~/.npm/_logs
post-install-comment:
description: Post GitHub comment with a blurb on how to install pre-release version
steps:
- run: ls -la
# make sure JSON files with uploaded urls are present
- run: ls -la binary-url.json npm-package-url.json
- run: cat binary-url.json
- run: cat npm-package-url.json
- run:
name: Post pre-release install comment
command: |
node scripts/add-install-comment.js \
--npm npm-package-url.json \
--binary binary-url.json
verify-mocha-results:
description: Double-check that Mocha tests ran as expected.
parameters:
expectedResultCount:
description: The number of result files to expect, ie, the number of Mocha test suites that ran.
type: integer
## by default, assert that at least 1 test ran
default: 0
steps:
- run: yarn verify:mocha:results << parameters.expectedResultCount >>
test-binary-against-repo:
description: |
Takes the built binary and NPM package, clones given example repo
and runs the new version of Cypress against it.
parameters:
repo:
description: Name of the repo like "cypress-example-kitchensink"
type: string
browser:
description: Name of the browser to use
type: enum
enum: ["electron", "chrome", "firefox"]
default: "electron"
command:
description: Test command to run to start Cypress tests
type: string
default: "npm run e2e"
wait-on:
description: Url to wait-on before starting tests
type: string
default: ""
steps:
- attach_workspace:
at: ~/
# make sure the binary and NPM package files are present
- run: ls -l
- run: ls -l cypress.zip cypress.tgz
- run:
name: Cloning project <<parameters.repo>>
command: git clone --depth 1 https://github.com/cypress-io/<<parameters.repo>>.git /tmp/<<parameters.repo>>
- run:
command: npm install
working_directory: /tmp/<<parameters.repo>>
- run:
name: Install Cypress
working_directory: /tmp/<<parameters.repo>>
# force installing the freshly built binary
command: CYPRESS_INSTALL_BINARY=~/cypress/cypress.zip npm i ~/cypress/cypress.tgz
- run:
working_directory: /tmp/<<parameters.repo>>
command: npm run build --if-present
- run:
working_directory: /tmp/<<parameters.repo>>
command: npm start --if-present
background: true
- when:
condition: <<parameters.wait-on>>
steps:
- run:
name: Wait-on <<parameters.wait-on>>
command: npx wait-on <<parameters.wait-on>> --timeout 120000
- run:
working_directory: /tmp/<<parameters.repo>>
command: <<parameters.command>> -- --browser <<parameters.browser>>
- store-npm-logs
- store_artifacts:
name: screenshots
path: /tmp/<<parameters.repo>>/cypress/screenshots
- store_artifacts:
name: videos
path: /tmp/<<parameters.repo>>/cypress/videos
jobs:
## code checkout and yarn installs
build:
<<: *defaults
steps:
- checkout
- run:
name: Print working folder
command: echo $PWD
- run:
name: print global yarn cache path
command: echo $(yarn global bin)
- run:
name: print Node version
command: node -v
- run:
name: print yarn version
command: yarn -v
- run: yarn check-node-version
## make sure the TERM is set to 'xterm' in node (Linux only)
## else colors (and tests) will fail
## See the following information
## * http://andykdocs.de/development/Docker/Fixing+the+Docker+TERM+variable+issue
## * https://unix.stackexchange.com/questions/43945/whats-the-difference-between-various-term-variables
- run: yarn check-terminal
- run: yarn stop-only-all
- restore_cache:
name: Restore yarn cache
key: v{{ .Environment.CACHE_VERSION }}-{{ arch }}-{{ .Branch }}-deps-root-{{ checksum "yarn.lock" }}
# show what is already cached globally
- run: ls $(yarn global bin)
- run: ls $(yarn global bin)/../lib/node_modules
# try several times, because flaky NPM installs ...
- run: yarn --ignore-engines || yarn --ignore-engines
- run:
name: Top level packages
command: yarn list --depth=0 || true
- store-npm-logs
## save entire folder as artifact for other jobs to run without reinstalling
- persist_to_workspace:
root: ~/
paths:
- cypress
lint:
<<: *defaults
steps:
- attach_workspace:
at: ~/
## this will catch .only's in js/coffee as well
- run: yarn lint-all
- run:
name: cypress info (dev)
command: node cli/bin/cypress info --dev
- store-npm-logs
cli-visual-tests:
<<: *defaults
parallelism: 1
steps:
- attach_workspace:
at: ~/
- run: mkdir -p cli/visual-snapshots
- run:
# TODO sanitize "cypress info" output to be consistent
command: node cli/bin/cypress info --dev | yarn --silent term-to-html | node scripts/sanitize --type cli-info > cli/visual-snapshots/cypress-info.html
environment:
FORCE_COLOR: 2
- run:
command: node cli/bin/cypress help | yarn --silent term-to-html > cli/visual-snapshots/cypress-help.html
environment:
FORCE_COLOR: 2
- store_artifacts:
path: cli/visual-snapshots
- run:
name: Upload CLI snapshots for diffing
command: |
PERCY_TOKEN=$PERCY_TOKEN_CLI \
yarn percy snapshot ./cli/visual-snapshots
unit-tests:
<<: *defaults
parallelism: 1
steps:
- attach_workspace:
at: ~/
# make sure mocha runs
- run: yarn test-mocha
# test binary build code
- run: yarn test-scripts
# make sure our snapshots are compared correctly
- run: yarn test-mocha-snapshot
# make sure packages with TypeScript can be transpiled to JS
- run: yarn lerna run build-prod --stream
# run unit tests from each individual package
- run: yarn test
- verify-mocha-results:
expectedResultCount: 6
- store_test_results:
path: /tmp/cypress
- store-npm-logs
lint-types:
<<: *defaults
parallelism: 1
steps:
- attach_workspace:
at: ~/
- run:
command: ls -la types
working_directory: cli
- run:
command: ls -la chai
working_directory: cli/types
- run:
command: yarn lerna exec --scope cypress "yarn dtslint"
- store-npm-logs
"server-unit-tests":
<<: *defaults
parallelism: 2
steps:
- attach_workspace:
at: ~/
- run: yarn test-unit --scope @packages/server
- verify-mocha-results:
expectedResultCount: 1
- store_test_results:
path: /tmp/cypress
- store-npm-logs
"server-integration-tests":
<<: *defaults
parallelism: 2
steps:
- attach_workspace:
at: ~/
- run: yarn test-integration --scope @packages/server
- verify-mocha-results:
expectedResultCount: 1
- store_test_results:
path: /tmp/cypress
- store-npm-logs
"server-performance-tests":
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
command: yarn lerna exec --scope @packages/server "yarn test-performance"
- verify-mocha-results:
expectedResultCount: 1
- store_test_results:
path: /tmp/cypress
- store_artifacts:
path: /tmp/artifacts
- store-npm-logs
"server-e2e-tests-chrome-1":
<<: *defaults
steps:
- run-e2e-tests:
browser: chrome
chunk: 1
"server-e2e-tests-chrome-2":
<<: *defaults
steps:
- run-e2e-tests:
browser: chrome
chunk: 2
"server-e2e-tests-chrome-3":
<<: *defaults
steps:
- run-e2e-tests:
browser: chrome
chunk: 3
"server-e2e-tests-chrome-4":
<<: *defaults
steps:
- run-e2e-tests:
browser: chrome
chunk: 4
"server-e2e-tests-chrome-5":
<<: *defaults
steps:
- run-e2e-tests:
browser: chrome
chunk: 5
"server-e2e-tests-chrome-6":
<<: *defaults
steps:
- run-e2e-tests:
browser: chrome
chunk: 6
"server-e2e-tests-chrome-7":
<<: *defaults
steps:
- run-e2e-tests:
browser: chrome
chunk: 7
"server-e2e-tests-chrome-8":
<<: *defaults
steps:
- run-e2e-tests:
browser: chrome
chunk: 8
"server-e2e-tests-electron-1":
<<: *defaults
steps:
- run-e2e-tests:
browser: electron
chunk: 1
"server-e2e-tests-electron-2":
<<: *defaults
steps:
- run-e2e-tests:
browser: electron
chunk: 2
"server-e2e-tests-electron-3":
<<: *defaults
steps:
- run-e2e-tests:
browser: electron
chunk: 3
"server-e2e-tests-electron-4":
<<: *defaults
steps:
- run-e2e-tests:
browser: electron
chunk: 4
"server-e2e-tests-electron-5":
<<: *defaults
steps:
- run-e2e-tests:
browser: electron
chunk: 5
"server-e2e-tests-electron-6":
<<: *defaults
steps:
- run-e2e-tests:
browser: electron
chunk: 6
"server-e2e-tests-electron-7":
<<: *defaults
steps:
- run-e2e-tests:
browser: electron
chunk: 7
"server-e2e-tests-electron-8":
<<: *defaults
steps:
- run-e2e-tests:
browser: electron
chunk: 8
"server-e2e-tests-firefox-1":
<<: *defaults
steps:
- run-e2e-tests:
browser: firefox
chunk: 1
"server-e2e-tests-firefox-2":
<<: *defaults
steps:
- run-e2e-tests:
browser: firefox
chunk: 2
"server-e2e-tests-firefox-3":
<<: *defaults
steps:
- run-e2e-tests:
browser: firefox
chunk: 3
"server-e2e-tests-firefox-4":
<<: *defaults
steps:
- run-e2e-tests:
browser: firefox
chunk: 4
"server-e2e-tests-firefox-5":
<<: *defaults
steps:
- run-e2e-tests:
browser: firefox
chunk: 5
"server-e2e-tests-firefox-6":
<<: *defaults
steps:
- run-e2e-tests:
browser: firefox
chunk: 6
"server-e2e-tests-firefox-7":
<<: *defaults
steps:
- run-e2e-tests:
browser: firefox
chunk: 7
"server-e2e-tests-firefox-8":
<<: *defaults
steps:
- run-e2e-tests:
browser: firefox
chunk: 8
"driver-integration-tests-chrome":
<<: *defaults
parallelism: 5
steps:
- attach_workspace:
at: ~/
- run:
command: yarn lerna exec --scope @packages/driver "yarn start"
background: true
- run:
command: yarn wait-on http://localhost:3500
- run:
command: |
CYPRESS_KONFIG_ENV=production \
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
yarn lerna exec --scope @packages/driver "yarn cypress:run --record --parallel --group 5x-driver-chrome --browser chrome"
- store_test_results:
path: /tmp/cypress
- store_artifacts:
path: /tmp/artifacts
- store-npm-logs
# "driver-integration-tests-electron":
# <<: *defaults
# parallelism: 5
# steps:
# - attach_workspace:
# at: ~/
# - run:
# command: npm start
# background: true
# working_directory: packages/driver
# - run:
# command: $(npm bin)/wait-on http://localhost:3500
# working_directory: packages/driver
# - run:
# command: |
# CYPRESS_KONFIG_ENV=production \
# CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
# npm run cypress:run --record --parallel --group 5x-driver-electron --browser electron
# working_directory: packages/driver
# - store_test_results:
# path: /tmp/cypress
# - store_artifacts:
# path: /tmp/artifacts
# - store-npm-logs
"driver-integration-tests-firefox":
<<: *defaults
parallelism: 5
steps:
- attach_workspace:
at: ~/
- run:
command: yarn workspace @packages/driver start
background: true
- run:
command: $(yarn bin)/wait-on http://localhost:3500
- run:
command: |
CYPRESS_KONFIG_ENV=production \
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
yarn lerna exec --scope @packages/driver "yarn cypress:run --record --parallel --group 5x-driver-firefox --browser firefox"
- store_test_results:
path: /tmp/cypress
- store_artifacts:
path: /tmp/artifacts
"desktop-gui-integration-tests-2x":
<<: *defaults
parallelism: 2
steps:
- attach_workspace:
at: ~/
- run:
command: yarn workspace @packages/desktop-gui build-prod
- run:
command: |
CYPRESS_KONFIG_ENV=production \
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
yarn lerna exec --scope @packages/desktop-gui "yarn cypress:run --record --parallel --group 2x-desktop-gui"
- store_test_results:
path: /tmp/cypress
- store_artifacts:
path: /tmp/artifacts
- store-npm-logs
"reporter-integration-tests":
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
command: yarn workspace @packages/reporter build-for-tests
- run:
command: |
CYPRESS_KONFIG_ENV=production \
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
yarn lerna exec --scope @packages/reporter "yarn cypress:run --record --parallel --group reporter"
- store_test_results:
path: /tmp/cypress
- store_artifacts:
path: /tmp/artifacts
- store-npm-logs
"ui-components-integration-tests":
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
command: yarn workspace @packages/ui-components build-for-tests
- run:
command: |
CYPRESS_KONFIG_ENV=production \
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
yarn lerna exec --scope @packages/ui-components "yarn cypress:run --record --parallel --group ui-components"
- store_test_results:
path: /tmp/cypress
- store_artifacts:
path: /tmp/artifacts
- store-npm-logs
"run-launcher":
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
command: node index.js
working_directory: packages/launcher
build-binary:
<<: *defaults
shell: /bin/bash --login
steps:
- run:
name: Check environment variables before code sign (if on Mac)
# NOTE
# our Mac code sign works via electron-builder
# by default, electron-builder will NOT sign app built in a pull request
# even our internal one (!)
# Usually this is not a problem, since we only build and test binary
# built on "develop" and "master" branches
# but if you need to really build and sign a Mac binary in a PR
# set variable CSC_FOR_PULL_REQUEST=true
command: |
set -e
if [[ "$OSTYPE" == "darwin"* ]]; then
if [ -z "$CSC_LINK" ]; then
echo "Need to provide environment variable CSC_LINK"
echo "with base64 encoded certificate .p12 file"
exit 1
fi
if [ -z "$CSC_KEY_PASSWORD" ]; then
echo "Need to provide environment variable CSC_KEY_PASSWORD"
echo "with password for unlocking certificate .p12 file"
exit 1
fi
else
echo "Not Mac platform, skipping code sign setup"
fi
- attach_workspace:
at: ~/
- run: $(yarn bin)/print-arch
- run:
environment:
DEBUG: electron-builder,electron-osx-sign*
command: yarn binary-build --platform $PLATFORM --version ${NEXT_DEV_VERSION:-0.0.0-development}
- run: yarn binary-zip --platform $PLATFORM
# Cypress binary file should be zipped to cypress.zip
- run: ls -l *.zip
- store-npm-logs
- persist_to_workspace:
root: ~/
paths:
- cypress/cypress.zip
upload-binary:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run: ls -l
- run:
name: upload unique binary
command: |
node scripts/binary.js upload-unique-binary \
--file cypress.zip \
--version $NEXT_DEV_VERSION
- run: cat binary-url.json
- store-npm-logs
- persist_to_workspace:
root: ~/
paths:
- cypress/binary-url.json
test-kitchensink:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Cloning test project
command: git clone https://github.com/cypress-io/cypress-example-kitchensink.git /tmp/repo
- run:
name: Install prod dependencies
command: yarn --production
working_directory: /tmp/repo
- run:
name: Example server
command: yarn start
working_directory: /tmp/repo
background: true
- run:
name: Run Kitchensink example project
command: yarn cypress:run --project /tmp/repo
- store_artifacts:
path: /tmp/repo/cypress/screenshots
- store_artifacts:
path: /tmp/repo/cypress/videos
- store-npm-logs
"test-kitchensink-against-staging":
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Cloning test project
command: git clone https://github.com/cypress-io/cypress-example-kitchensink.git /tmp/repo
- run:
name: Install prod dependencies
command: yarn --production
working_directory: /tmp/repo
- run:
name: Example server
command: yarn start
working_directory: /tmp/repo
background: true
- run:
name: Run Kitchensink example project
command: |
CYPRESS_PROJECT_ID=$TEST_KITCHENSINK_PROJECT_ID \
CYPRESS_RECORD_KEY=$TEST_KITCHENSINK_RECORD_KEY \
CYPRESS_ENV=staging \
CYPRESS_video=false \
yarn cypress:run --project /tmp/repo --record
- store-npm-logs
"test-against-staging":
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Cloning test project
command: git clone https://github.com/cypress-io/cypress-test-tiny.git /tmp/repo
- run:
name: Run test project
command: |
CYPRESS_PROJECT_ID=$TEST_TINY_PROJECT_ID \
CYPRESS_RECORD_KEY=$TEST_TINY_RECORD_KEY \
CYPRESS_ENV=staging \
yarn cypress:run --project /tmp/repo --record
- store-npm-logs
build-npm-package:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run: yarn check-next-dev-version
- run:
name: bump NPM version
command: yarn version --no-git-tag-version --new-version ${NEXT_DEV_VERSION:-0.0.0-development}
- run:
name: build NPM package
command: yarn build --scope cypress
- run:
command: ls -la types
working_directory: cli/build
- run:
name: list NPM package contents
command: yarn lerna run --scope cypress size
- run:
name: pack NPM package
working_directory: cli/build
command: yarn pack
- run:
name: list created NPM package
working_directory: cli/build
command: ls -l
# created file should have filename cypress-<version>.tgz
- run: mkdir /tmp/urls
- run: cp cli/build/cypress-v${NEXT_DEV_VERSION:-0.0.0-development}.tgz cypress.tgz
- run: cp cli/build/cypress-v${NEXT_DEV_VERSION:-0.0.0-development}.tgz /tmp/urls/cypress.tgz
- run: ls -l /tmp/urls
- store-npm-logs
- run: pwd
- run: ls -l
- persist_to_workspace:
root: ~/
paths:
- cypress/cypress.tgz
upload-npm-package:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run: ls -l
# NPM package file should have filename cypress-<version>.tgz
- run:
name: upload NPM package
command: |
node scripts/binary.js upload-npm-package \
--file cypress.tgz \
--version $NEXT_DEV_VERSION
- store-npm-logs
- run: ls -l
- run: cat npm-package-url.json
- persist_to_workspace:
root: ~/
paths:
- cypress/npm-package-url.json
"test-binary-and-npm-against-other-projects":
<<: *defaults
steps:
# needs uploaded NPM and test binary
- attach_workspace:
at: ~/
- run: ls -la
# make sure JSON files with uploaded urls are present
- run: ls -la binary-url.json npm-package-url.json
- run: cat binary-url.json
- run: cat npm-package-url.json
- run: mkdir /tmp/testing
- run:
name: create dummy package
working_directory: /tmp/testing
command: npm init -y
- run:
# install NPM from unique urls
name: Install Cypress
command: |
node scripts/test-unique-npm-and-binary.js \
--npm npm-package-url.json \
--binary binary-url.json \
--cwd /tmp/testing
- run:
name: Verify Cypress binary
working_directory: /tmp/testing
command: $(yarn bin)/cypress verify
- run:
name: Running other test projects with new NPM package and binary
command: |
node scripts/test-other-projects.js \
--npm npm-package-url.json \
--binary binary-url.json \
--provider circle
- store-npm-logs
post-pre-release-install-comment:
<<: *defaults
steps:
# needs uploaded NPM and test binary
- attach_workspace:
at: ~/
- run: ls -la
- post-install-comment
"test-npm-module-and-verify-binary":
<<: *defaults
steps:
- attach_workspace:
at: ~/
# make sure we have cypress.zip received
- run: ls -l
- run: ls -l cypress.zip cypress.tgz
- run: mkdir test-binary
- run:
name: Create new NPM package
working_directory: test-binary
command: npm init -y
- run:
# install NPM from built NPM package folder
name: Install Cypress
working_directory: test-binary
# force installing the freshly built binary
command: CYPRESS_INSTALL_BINARY=/root/cypress/cypress.zip npm i /root/cypress/cypress.tgz
- run:
name: Verify Cypress binary
working_directory: test-binary
command: $(yarn bin)/cypress verify
- run:
name: Cypress help
working_directory: test-binary
command: $(yarn bin)/cypress help
- run:
name: Cypress info
working_directory: test-binary
command: $(yarn bin)/cypress info
- store-npm-logs
test-npm-module-on-minimum-node-version:
<<: *defaults
docker:
- image: cypress/base:8.0.0
steps:
- attach_workspace:
at: ~/
# make sure we have cypress.zip received
- run: ls -l
- run: ls -l cypress.zip cypress.tgz
- run: mkdir test-binary
- run: node --version
- run: npm --version
- run:
name: Create new NPM package
working_directory: test-binary
command: npm init -y
- run:
name: Install Cypress
working_directory: test-binary
command: CYPRESS_INSTALL_BINARY=/root/cypress/cypress.zip npm install /root/cypress/cypress.tgz
- run:
name: Verify Cypress binary
working_directory: test-binary
command: $(npm bin)/cypress verify
- run:
name: Print Cypress version
working_directory: test-binary
command: $(npm bin)/cypress version
- run:
name: Cypress info
working_directory: test-binary
command: $(npm bin)/cypress info
# install NPM + binary zip and run against staging API
"test-binary-against-staging":
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run: ls -l
# make sure we have the binary and NPM package
- run: ls -l cypress.zip cypress.tgz
- run:
name: Cloning test project
command: git clone https://github.com/cypress-io/cypress-test-tiny.git /tmp/cypress-test-tiny
- run:
name: Install Cypress
working_directory: /tmp/cypress-test-tiny
# force installing the freshly built binary
command: CYPRESS_INSTALL_BINARY=~/cypress/cypress.zip npm i ~/cypress/cypress.tgz
- run:
name: Run test project
working_directory: /tmp/cypress-test-tiny
command: |
CYPRESS_PROJECT_ID=$TEST_TINY_PROJECT_ID \
CYPRESS_RECORD_KEY=$TEST_TINY_RECORD_KEY \
CYPRESS_ENV=staging \
$(yarn bin)/cypress run --record
- store-npm-logs
"test-binary-against-recipes-firefox":
<<: *defaults
steps:
- test-binary-against-repo:
repo: cypress-example-recipes
command: npm run test:ci:firefox
"test-binary-against-kitchensink":
<<: *defaults
steps:
- test-binary-against-repo:
repo: cypress-example-kitchensink
"test-binary-against-kitchensink-firefox":
<<: *defaults
steps:
- test-binary-against-repo:
repo: cypress-example-kitchensink
browser: firefox
"test-binary-against-kitchensink-chrome":
<<: *defaults
steps:
- test-binary-against-repo:
repo: cypress-example-kitchensink
browser: chrome
"test-binary-against-todomvc-firefox":
<<: *defaults
steps:
- test-binary-against-repo:
repo: cypress-example-todomvc
browser: firefox
"test-binary-against-documentation-firefox":
<<: *defaults
steps:
- test-binary-against-repo:
repo: cypress-documentation
browser: firefox
command: "npm run cypress:run"
wait-on: "http://localhost:2222"
"test-binary-against-realworld-firefox":
<<: *defaults
steps:
- test-binary-against-repo:
repo: cypress-example-realworld
browser: firefox
command: "npm run cypress:run"
wait-on: "http://localhost:4100"
"test-binary-against-api-testing-firefox":
<<: *defaults
steps:
- test-binary-against-repo:
repo: cypress-example-api-testing
browser: firefox
command: "npm run cy:run"
wait-on: "http://localhost:3000"
"test-binary-against-piechopper-firefox":
<<: *defaults
steps:
- test-binary-against-repo:
repo: cypress-example-piechopper
browser: firefox
command: "npm run cypress:run"
wait-on: "http://localhost:8080"
test-binary-as-specific-user:
<<: *defaults
steps:
- attach_workspace:
at: ~/
# the user should be "node"
- run: whoami
- run: pwd
# prints the current user's effective user id
# for root it is 0
# for other users it is a positive integer
- run: node -e 'console.log(process.geteuid())'
# make sure the binary and NPM package files are present
- run: ls -l
- run: ls -l cypress.zip cypress.tgz
- run: mkdir test-binary
- run:
name: Create new NPM package
working_directory: test-binary
command: npm init -y
- run:
# install NPM from built NPM package folder
name: Install Cypress
working_directory: test-binary
# force installing the freshly built binary
command: CYPRESS_INSTALL_BINARY=~/cypress/cypress.zip npm i ~/cypress/cypress.tgz
- run:
name: Cypress help
working_directory: test-binary
command: $(yarn bin)/cypress help
- run:
name: Cypress info
working_directory: test-binary
command: $(yarn bin)/cypress info
- run:
name: Add Cypress demo
working_directory: test-binary
command: npx @bahmutov/cly init
- run:
name: Verify Cypress binary
working_directory: test-binary
command: DEBUG=cypress:cli $(yarn bin)/cypress verify
- run:
name: Run Cypress binary
working_directory: test-binary
command: DEBUG=cypress:cli $(yarn bin)/cypress run
- store-npm-logs
linux-workflow: &linux-workflow
jobs:
- build
- lint:
name: Linux lint
requires:
- build
- lint-types:
requires:
- build
# unit, integration and e2e tests
- cli-visual-tests:
requires:
- build
- unit-tests:
requires:
- build
- server-unit-tests:
requires:
- build
- server-integration-tests:
requires:
- build
- server-performance-tests:
requires:
- build
- server-e2e-tests-chrome-1:
requires:
- build
- server-e2e-tests-chrome-2:
requires:
- build
- server-e2e-tests-chrome-3:
requires:
- build
- server-e2e-tests-chrome-4:
requires:
- build
- server-e2e-tests-chrome-5:
requires:
- build
- server-e2e-tests-chrome-6:
requires:
- build
- server-e2e-tests-chrome-7:
requires:
- build
- server-e2e-tests-chrome-8:
requires:
- build
- server-e2e-tests-electron-1:
requires:
- build
- server-e2e-tests-electron-2:
requires:
- build
- server-e2e-tests-electron-3:
requires:
- build
- server-e2e-tests-electron-4:
requires:
- build
- server-e2e-tests-electron-5:
requires:
- build
- server-e2e-tests-electron-6:
requires:
- build
- server-e2e-tests-electron-7:
requires:
- build
- server-e2e-tests-electron-8:
requires:
- build
- server-e2e-tests-firefox-1:
requires:
- build
- server-e2e-tests-firefox-2:
requires:
- build
- server-e2e-tests-firefox-3:
requires:
- build
- server-e2e-tests-firefox-4:
requires:
- build
- server-e2e-tests-firefox-5:
requires:
- build
- server-e2e-tests-firefox-6:
requires:
- build
- server-e2e-tests-firefox-7:
requires:
- build
- server-e2e-tests-firefox-8:
requires:
- build
- driver-integration-tests-chrome:
requires:
- build
- driver-integration-tests-firefox:
requires:
- build
## TODO: add these back in when flaky tests are fixed
# - driver-integration-tests-electron:
# requires:
# - build
- desktop-gui-integration-tests-2x:
requires:
- build
- reporter-integration-tests:
requires:
- build
- ui-components-integration-tests:
requires:
- build
- run-launcher:
requires:
- build
# various testing scenarios, like building full binary
# and testing it on a real project
- test-against-staging:
context: test-runner:record-tests
filters:
branches:
only:
- develop
requires:
- build
- test-kitchensink:
requires:
- build
- test-kitchensink-against-staging:
context: test-runner:record-tests
filters:
branches:
only:
- develop
requires:
- build
- build-npm-package:
requires:
- build
- upload-npm-package:
context: test-runner:upload
filters:
branches:
only:
- develop
requires:
- build-npm-package
- build-binary:
requires:
- build
- upload-binary:
context: test-runner:upload
filters:
branches:
only:
- develop
requires:
- build-binary
- test-npm-module-on-minimum-node-version:
requires:
- build-binary
- build-npm-package
- post-pre-release-install-comment:
context: test-runner:commit-status-checks
filters:
branches:
only:
- develop
requires:
- upload-npm-package
- upload-binary
- test-binary-and-npm-against-other-projects:
context: test-runner:trigger-test-jobs
filters:
branches:
only:
- develop
requires:
- upload-npm-package
- upload-binary
- test-npm-module-and-verify-binary:
filters:
branches:
only:
- develop
requires:
- build-npm-package
- build-binary
- test-binary-against-staging:
context: test-runner:record-tests
filters:
branches:
only:
- develop
requires:
- build-npm-package
- build-binary
- test-binary-against-recipes-firefox:
<<: *testBinaryFirefox
- test-binary-against-kitchensink:
<<: *testBinaryFirefox
- test-binary-against-kitchensink-firefox:
<<: *testBinaryFirefox
- test-binary-against-kitchensink-chrome:
<<: *testBinaryFirefox
- test-binary-against-todomvc-firefox:
<<: *testBinaryFirefox
- test-binary-against-documentation-firefox:
<<: *testBinaryFirefox
- test-binary-against-api-testing-firefox:
<<: *testBinaryFirefox
- test-binary-against-realworld-firefox:
<<: *testBinaryFirefox
- test-binary-against-piechopper-firefox:
<<: *testBinaryFirefox
- test-binary-as-specific-user:
name: "test binary as a non-root user"
executor: non-root-docker-user
requires:
- build-npm-package
- build-binary
- test-binary-as-specific-user:
name: "test binary as a root user"
requires:
- build-npm-package
- build-binary
mac-workflow: &mac-workflow
jobs:
- build:
name: Mac build
executor: mac
<<: *macBuildFilters
- lint:
name: Mac lint
executor: mac
<<: *macBuildFilters
requires:
- Mac build
# maybe run unit tests?
- build-npm-package:
name: Mac NPM package
executor: mac
requires:
- Mac build
filters:
branches:
only:
- develop
- upload-npm-package:
name: Mac NPM package upload
context: test-runner:upload
executor: mac
filters:
branches:
only:
- develop
requires:
- Mac NPM package
- build-binary:
name: Mac binary
context: org-global
executor: mac
<<: *macBuildFilters
requires:
- Mac build
- upload-binary:
name: Mac binary upload
executor: mac
context: test-runner:upload
filters:
branches:
only:
- develop
requires:
- Mac binary
- test-kitchensink:
name: Test Mac Kitchensink
executor: mac
<<: *macBuildFilters
requires:
- Mac build
- test-binary-against-kitchensink:
name: Test Mac binary against kitchensink
executor: mac
filters:
branches:
only:
- develop
requires:
- Mac NPM package
- Mac binary
- test-binary-against-staging:
context: test-runner:record-tests
name: Test Mac binary against staging
executor: mac
filters:
branches:
only:
- develop
requires:
- Mac NPM package
- Mac binary
- post-pre-release-install-comment:
context: test-runner:commit-status-checks
name: Post Mac pre-release install comment
filters:
branches:
only:
- develop
requires:
- Mac NPM package upload
- Mac binary upload
- test-binary-and-npm-against-other-projects:
context: test-runner:trigger-test-jobs
name: Test Mac binary against other projects
executor: mac
filters:
branches:
only:
- develop
requires:
- Mac NPM package upload
- Mac binary upload
workflows:
linux:
<<: *linux-workflow
mac:
<<: *mac-workflow