Skip to content

Commit

Permalink
Merge branch develop into 9.0-release
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-shehane committed Sep 23, 2021
2 parents bfa8347 + dedb05a commit 61e0444
Show file tree
Hide file tree
Showing 546 changed files with 14,773 additions and 30,022 deletions.
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.16.0
14.17.0
8 changes: 0 additions & 8 deletions .vscode/terminals.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@
"execute": false,
"command": "yarn cypress:run --project ../project"
},
{
"name": "cypress open (CT)",
"focus": true,
"onlySingle": true,
"execute": true,
"cwd": "[cwd]/packages/server-ct",
"command": "yarn cypress:open"
},
{
"name": "packages/server test-e2e",
"focus": true,
Expand Down
18 changes: 13 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,18 @@ Here is a list of the core packages in this repository with a short description,
| [example](./packages/example) | `@packages/example` | Our example kitchen-sink application. |
| [extension](./packages/extension) | `@packages/extension` | The Cypress Chrome browser extension |
| [https-proxy](./packages/https-proxy) | `@packages/https-proxy` | This does https proxy for handling http certs and traffic. |
| [net-stubbing](./packages/net-stubbing) | `@packages/net-stubbing` | Contains server side code for Cypress' network stubbing features. |
| [network](./packages/networ ) | `@packages/network` | Various utilities related to networking. |
| [proxy](./packages/proxy) | `@packages/proxy` | Code for Cypress' network proxy layer. |
| [launcher](./packages/launcher) | `@packages/launcher` | Finds and launches browsers installed on your system. |
| [reporter](./packages/reporter) | `@packages/reporter` | The reporter shows the running results of the tests (The Command Log UI). |
| [root](./packages/root) | `@packages/root` | Dummy package pointing at the root of the repository. |
| [runner](./packages/runner) | `@packages/runner` | The runner is the minimal "chrome" around the user's application under test. |
| [runner-ct](./packages/runner-ct) | `@packages/runner-ct` | The runner for component testing |
| [runner-shared](./packages/runner-shared) | `@packages/runner-shared` | The shared components between the `runner` and the `runner-ct` packages |
| [server](./packages/server) | `@packages/server` | The <3 of Cypress. This orchestrates everything. The backend node process. |
| [server-ct](./packages/server-ct) | `@packages/server-ct` | Some Component Testing specific overrides. Mostly extends functionality from `@packages/server` |
| [socket](./packages/socket) | `@packages/socket` | A wrapper around socket.io to provide common libraries. |
| [static](./packages/static) | `@packages/static` | Serves static assets used in the Cypress GUI. |
| [ts](./packages/ts) | `@packages/ts` | A centralized version of typescript. |

Public packages live within the [`npm`](./npm) folder and are standalone modules that get independently published to npm under the `@cypress/` namespace. These packages generally contain extensions, plugins, or other packages that are complementary to, yet independent of, the main Cypress app.
Expand All @@ -295,10 +298,15 @@ Here is a list of the npm packages in this repository:

| Folder Name | Package Name | Purpose |
| :----------------------------------------------------- | :--------------------------------- | :--------------------------------------------------------------------------- |
| [eslint-plugin-dev](./npm/eslint-plugin-dev) | `@cypress/eslint-plugin-dev` | Eslint plugin for internal development. |
| [react](./npm/react) | `@cypress/react` | Cypress component testing for React. |
| [vue](./npm/vue) | `@cypress/vue` | Cypress component testing for Vue. |
| [webpack-preprocessor](./npm/webpack-preprocessor) | `@cypress/webpack-preprocessor` | Cypress preprocessor for bundling JavaScript via webpack. |
| [angular](./npm/angular) | `@cypress/angular` | Cypress component testing for Angular. |
| [create-cypress-tests](./npm/create-cypress-tests) | `@cypress/create-cypress-tests` | Tooling to scaffold Cypress configuration and demo test files. |
| [eslint-plugin-dev](./npm/eslint-plugin-dev) | `@cypress/eslint-plugin-dev` | Eslint plugin for internal development. |
| [mount-utils](./npm/mount-utils) | `@cypress/mount-utils` | Common functionality for Vue/React/Angular adapters. |
| [react](./npm/react) | `@cypress/react` | Cypress component testing for React. |
| [vite-dev-server](./npm/vite-dev-server) | `@cypress/vite-dev-server` | Vite powered dev server for Component Testing. |
| [webpack-preprocessor](./npm/webpack-preprocessor) | `@cypress/webpack-preprocessor` | Cypress preprocessor for bundling JavaScript via webpack. |
| [webpack-dev-server](./npm/webpack-dev-server) | `@cypress/webpack-dev-server` | Webpack powered dev server for Component Testing. |
| [vue](./npm/vue) | `@cypress/vue` | Cypress component testing for Vue. |

We try to tag all issues with a `pkg/` or `npm/` tag describing the appropriate package the work is required in. For public packages, we use their qualified package name: For example, issues relating to the webpack preprocessor are tagged under [`npm: @cypress/webpack-preprocessor`](https://github.com/cypress-io/cypress/labels/npm%3A%20%40cypress%2Fwebpack-preprocessor) label and issues related to the `driver` package are tagged with the [`pkg/driver`](https://github.com/cypress-io/cypress/labels/pkg%2Fdriver) label.

Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ branches:
only:
- master
- develop
- windows-code-signing
- fix-test-other-projects
- /win*/

# https://www.appveyor.com/docs/lang/nodejs-iojs/
environment:
# use matching version of Node.js
nodejs_version: "14.16.0"
nodejs_version: "14.17.0"
# encode secure variables which will NOT be used
# in pull requests
# https://www.appveyor.com/docs/build-configuration/#secure-variables
Expand Down
4 changes: 2 additions & 2 deletions browser-versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"chrome:beta": "93.0.4577.18",
"chrome:stable": "92.0.4515.107"
"chrome:beta": "94.0.4606.54",
"chrome:stable": "94.0.4606.54"
}
35 changes: 19 additions & 16 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ macBuildFilters: &macBuildFilters
branches:
only:
- develop
- tgriesser/fix/mac-build
- tgriesser/chore/fix-release

defaults: &defaults
parallelism: 1
Expand Down Expand Up @@ -42,14 +42,15 @@ onlyMainBranches: &onlyMainBranches
branches:
only:
- develop
- tgriesser/chore/fix-release
requires:
- create-build-artifacts

executors:
# the Docker image with Cypress dependencies and Chrome browser
cy-doc:
docker:
- image: cypress/browsers:node14.16.0-chrome90-ff88
- image: cypress/browsers:node14.17.0-chrome91-ff89
# by default, we use "small" to save on CI costs. bump on a per-job basis if needed.
resource_class: small
environment:
Expand All @@ -58,7 +59,7 @@ executors:
# Docker image with non-root "node" user
non-root-docker-user:
docker:
- image: cypress/browsers:node14.16.0-chrome90-ff88
- image: cypress/browsers:node14.17.0-chrome91-ff89
user: node
environment:
PLATFORM: linux
Expand Down Expand Up @@ -303,6 +304,7 @@ commands:
dpkg -i /usr/src/google-chrome-<<parameters.channel>>_<<parameters.version>>_amd64.deb ; \
apt-get install -f -y && \
rm -f /usr/src/google-chrome-<<parameters.channel>>_<<parameters.version>>_amd64.deb
which google-chrome-<<parameters.channel>> || (printf "\n\033[0;31mChrome was not successfully downloaded - bailing\033[0m\n\n" && exit 1)
echo "Location of Google Chrome Installation: `which google-chrome-<<parameters.channel>>`"
echo "Google Chrome Version: `google-chrome-<<parameters.channel>> --version`"
Expand Down Expand Up @@ -373,6 +375,7 @@ commands:
PERCY_ENABLE=${PERCY_TOKEN:-0} \
PERCY_PARALLEL_TOTAL=-1 \
$cmd yarn workspace @packages/runner cypress:run --record --parallel --group runner-integration-<<parameters.browser>> --browser <<parameters.browser>>
- verify-mocha-results
- store_test_results:
path: /tmp/cypress
- store_artifacts:
Expand Down Expand Up @@ -407,6 +410,7 @@ commands:
else
echo "skipping percy screenshots uploading"
fi
- verify-mocha-results
- store_test_results:
path: /tmp/cypress
- store_artifacts:
Expand Down Expand Up @@ -1030,18 +1034,6 @@ jobs:
path: /tmp/cypress
- store-npm-logs

server-ct-unit-tests:
<<: *defaults
parallelism: 1
steps:
- restore_cached_workspace
- run: yarn test-unit --scope @packages/server-ct
- verify-mocha-results:
expectedResultCount: 1
- store_test_results:
path: /tmp/cypress
- store-npm-logs

server-integration-tests:
<<: *defaults
resource_class: medium
Expand Down Expand Up @@ -1126,6 +1118,7 @@ jobs:

runner-integration-tests-electron:
<<: *defaults
resource_class: medium
parallelism: 2
steps:
- run-runner-integration-tests:
Expand All @@ -1150,6 +1143,7 @@ jobs:

driver-integration-tests-chrome-beta:
<<: *defaults
resource_class: medium
parallelism: 5
steps:
- run-driver-integration-tests:
Expand Down Expand Up @@ -1488,7 +1482,7 @@ jobs:
- run:
name: Check current branch to persist artifacts
command: |
if [[ "$CIRCLE_BRANCH" != "develop" ]]; then
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "tgriesser/chore/fix-release" ]]; then
echo "Not uploading artifacts or posting install comment for this branch."
circleci-agent step halt
fi
Expand Down Expand Up @@ -2080,6 +2074,7 @@ linux-workflow: &linux-workflow
# Any attempts to automate this are welcome
# If CircleCI provided an "after all" hook, then this wouldn't be necessary
- npm-release:
context: test-runner:npm-release
requires:
- build
- npm-eslint-plugin-dev
Expand Down Expand Up @@ -2123,6 +2118,7 @@ linux-workflow: &linux-workflow
branches:
only:
- develop
- tgriesser/chore/fix-release
requires:
- build
- test-kitchensink:
Expand All @@ -2134,6 +2130,7 @@ linux-workflow: &linux-workflow
branches:
only:
- develop
- tgriesser/chore/fix-release
requires:
- build
- create-build-artifacts:
Expand Down Expand Up @@ -2183,13 +2180,15 @@ linux-workflow: &linux-workflow
branches:
only:
- develop
- tgriesser/chore/fix-release
requires:
- create-build-artifacts
- test-npm-module-and-verify-binary:
filters:
branches:
only:
- develop
- tgriesser/chore/fix-release
requires:
- create-build-artifacts
- test-binary-against-staging:
Expand All @@ -2198,6 +2197,7 @@ linux-workflow: &linux-workflow
branches:
only:
- develop
- tgriesser/chore/fix-release
requires:
- create-build-artifacts

Expand All @@ -2222,6 +2222,7 @@ linux-workflow: &linux-workflow
branches:
only:
- develop
- tgriesser/chore/fix-release
requires:
- create-build-artifacts

Expand Down Expand Up @@ -2293,6 +2294,7 @@ mac-workflow: &mac-workflow
branches:
only:
- develop
- tgriesser/chore/fix-release
requires:
- darwin-create-build-artifacts

Expand All @@ -2304,6 +2306,7 @@ mac-workflow: &mac-workflow
branches:
only:
- develop
- tgriesser/chore/fix-release
requires:
- darwin-create-build-artifacts

Expand Down
12 changes: 5 additions & 7 deletions cli/lib/tasks/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,17 @@ const request = require('@cypress/request')
const Promise = require('bluebird')
const requestProgress = require('request-progress')
const { stripIndent } = require('common-tags')
const getProxyForUrl = require('proxy-from-env').getProxyForUrl

const { throwFormErrorText, errors } = require('../errors')
const fs = require('../fs')
const util = require('../util')

const defaultBaseUrl = 'https://download.cypress.io/'

const getProxyUrl = () => {
return process.env.HTTPS_PROXY ||
process.env.https_proxy ||
const getProxyForUrlWithNpmConfig = (url) => {
return getProxyForUrl(url) ||
process.env.npm_config_https_proxy ||
process.env.HTTP_PROXY ||
process.env.http_proxy ||
process.env.npm_config_proxy ||
null
}
Expand Down Expand Up @@ -205,7 +203,7 @@ const verifyDownloadedFile = (filename, expectedSize, expectedChecksum) => {
// {filename: ..., downloaded: true}
const downloadFromUrl = ({ url, downloadDestination, progress, ca }) => {
return new Promise((resolve, reject) => {
const proxy = getProxyUrl()
const proxy = getProxyForUrlWithNpmConfig(url)

debug('Downloading package', {
url,
Expand Down Expand Up @@ -357,6 +355,6 @@ const start = (opts) => {
module.exports = {
start,
getUrl,
getProxyUrl,
getProxyForUrlWithNpmConfig,
getCA,
}
3 changes: 2 additions & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"unit": "cross-env BLUEBIRD_DEBUG=1 NODE_ENV=test mocha --reporter mocha-multi-reporters --reporter-options configFile=../mocha-reporter-config.json"
},
"dependencies": {
"@cypress/request": "^2.88.5",
"@cypress/request": "^2.88.6",
"@cypress/xvfb": "^1.2.4",
"@types/node": "^14.14.31",
"@types/sinonjs__fake-timers": "^6.0.2",
Expand Down Expand Up @@ -54,6 +54,7 @@
"minimist": "^1.2.5",
"ospath": "^1.2.2",
"pretty-bytes": "^5.6.0",
"proxy-from-env": "1.0.0",
"ramda": "~0.27.1",
"request-progress": "^3.0.0",
"supports-color": "^8.1.1",
Expand Down
54 changes: 43 additions & 11 deletions cli/test/lib/tasks/download_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,28 +313,60 @@ describe('lib/tasks/download', function () {
})

context('with proxy env vars', () => {
const testUriHttp = 'http://anything.com'
const testUriHttps = 'https://anything.com'

beforeEach(function () {
this.env = _.clone(process.env)
// add a default no_proxy which does not match the testUri
process.env.NO_PROXY = 'localhost,.org'
})

afterEach(function () {
process.env = this.env
})

it('prefers https_proxy over http_proxy', () => {
process.env.HTTP_PROXY = 'foo'
expect(download.getProxyUrl()).to.eq('foo')
process.env.https_proxy = 'bar'
expect(download.getProxyUrl()).to.eq('bar')
it('uses http_proxy on http request', () => {
process.env.http_proxy = 'http://foo'
expect(download.getProxyForUrlWithNpmConfig(testUriHttp)).to.eq('http://foo')
})

it('ignores http_proxy on https request', () => {
process.env.http_proxy = 'http://foo'
expect(download.getProxyForUrlWithNpmConfig(testUriHttps)).to.eq(null)
process.env.https_proxy = 'https://bar'
expect(download.getProxyForUrlWithNpmConfig(testUriHttps)).to.eq('https://bar')
})

it('falls back to npm_config_proxy', () => {
process.env.npm_config_proxy = 'foo'
expect(download.getProxyUrl()).to.eq('foo')
process.env.npm_config_https_proxy = 'bar'
expect(download.getProxyUrl()).to.eq('bar')
process.env.https_proxy = 'baz'
expect(download.getProxyUrl()).to.eq('baz')
process.env.npm_config_proxy = 'http://foo'
expect(download.getProxyForUrlWithNpmConfig(testUriHttps)).to.eq('http://foo')
process.env.npm_config_https_proxy = 'https://bar'
expect(download.getProxyForUrlWithNpmConfig(testUriHttps)).to.eq('https://bar')
process.env.https_proxy = 'https://baz'
expect(download.getProxyForUrlWithNpmConfig(testUriHttps)).to.eq('https://baz')
})

it('respects no_proxy on http and https requests', () => {
process.env.NO_PROXY = 'localhost,.com'

process.env.http_proxy = 'http://foo'
process.env.https_proxy = 'https://bar'

expect(download.getProxyForUrlWithNpmConfig(testUriHttp)).to.eq(null)
expect(download.getProxyForUrlWithNpmConfig(testUriHttps)).to.eq(null)
})

it('ignores no_proxy for npm proxy configs, prefers https over http', () => {
process.env.NO_PROXY = 'localhost,.com'

process.env.npm_config_proxy = 'http://foo'
expect(download.getProxyForUrlWithNpmConfig(testUriHttp)).to.eq('http://foo')
expect(download.getProxyForUrlWithNpmConfig(testUriHttps)).to.eq('http://foo')

process.env.npm_config_https_proxy = 'https://bar'
expect(download.getProxyForUrlWithNpmConfig(testUriHttp)).to.eq('https://bar')
expect(download.getProxyForUrlWithNpmConfig(testUriHttps)).to.eq('https://bar')
})
})

Expand Down

0 comments on commit 61e0444

Please sign in to comment.