Skip to content

Commit

Permalink
Merge branch 'develop' into thlorenz/develop-ts
Browse files Browse the repository at this point in the history
* develop:
  fix(cli): Respect NO_PROXY on cypress download (cypress-io#17702)
  chore: Update Chrome (beta) to 94.0.4606.50 (cypress-io#18117)
  release 8.4.1 [skip ci]
  fix: GH env variable for test other projects (cypress-io#18147)
  fix(open_project): remove unnecessary fn wrapping from tryToCalls (cypress-io#18146)
  • Loading branch information
thlorenz committed Sep 20, 2021
2 parents b4dcea8 + 8249d2e commit b3b1f4b
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 64 deletions.
2 changes: 1 addition & 1 deletion browser-versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"chrome:beta": "94.0.4606.41",
"chrome:beta": "94.0.4606.50",
"chrome:stable": "93.0.4577.82"
}
22 changes: 11 additions & 11 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ macBuildFilters: &macBuildFilters
branches:
only:
- develop
- fix-test-other-projects
- tgriesser/chore/fix-release

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

Expand Down Expand Up @@ -1481,7 +1481,7 @@ jobs:
- run:
name: Check current branch to persist artifacts
command: |
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "fix-test-other-projects" ]]; 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 @@ -2117,7 +2117,7 @@ linux-workflow: &linux-workflow
branches:
only:
- develop
- fix-test-other-projects
- tgriesser/chore/fix-release
requires:
- build
- test-kitchensink:
Expand All @@ -2129,7 +2129,7 @@ linux-workflow: &linux-workflow
branches:
only:
- develop
- fix-test-other-projects
- tgriesser/chore/fix-release
requires:
- build
- create-build-artifacts:
Expand Down Expand Up @@ -2179,15 +2179,15 @@ linux-workflow: &linux-workflow
branches:
only:
- develop
- fix-test-other-projects
- tgriesser/chore/fix-release
requires:
- create-build-artifacts
- test-npm-module-and-verify-binary:
filters:
branches:
only:
- develop
- fix-test-other-projects
- tgriesser/chore/fix-release
requires:
- create-build-artifacts
- test-binary-against-staging:
Expand All @@ -2196,7 +2196,7 @@ linux-workflow: &linux-workflow
branches:
only:
- develop
- fix-test-other-projects
- tgriesser/chore/fix-release
requires:
- create-build-artifacts

Expand All @@ -2221,7 +2221,7 @@ linux-workflow: &linux-workflow
branches:
only:
- develop
- fix-test-other-projects
- tgriesser/chore/fix-release
requires:
- create-build-artifacts

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

Expand All @@ -2305,7 +2305,7 @@ mac-workflow: &mac-workflow
branches:
only:
- develop
- fix-test-other-projects
- 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,
}
1 change: 1 addition & 0 deletions cli/package.json
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cypress",
"version": "8.4.0",
"version": "8.4.1",
"description": "Cypress.io end to end testing tool",
"private": true,
"scripts": {
Expand Down
12 changes: 3 additions & 9 deletions packages/server/lib/open_project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,11 @@ export class OpenProject {
return this.openProject!.getConfig()
}

getRecordKeys () {
return this.tryToCall('getRecordKeys')
}
getRecordKeys = this.tryToCall('getRecordKeys')

getRuns () {
return this.tryToCall('getRuns')
}
getRuns = this.tryToCall('getRuns')

requestAccess () {
return this.tryToCall('requestAccess')
}
requestAccess = this.tryToCall('requestAccess')

getProject () {
return this.openProject
Expand Down
5 changes: 3 additions & 2 deletions scripts/binary/bump.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const awaitEachProjectAndProvider = function (projects, fn, filter = R.identity)

if (check.unemptyString(creds.githubToken)) {
providers.travis = {
githubToken: creds.githubToken,
githubToken: process.env.GH_TOKEN,
}
}

Expand Down Expand Up @@ -217,6 +217,7 @@ module.exports = {
console.log('do we have GH_APP_ID?', Boolean(process.env.GH_APP_ID))
console.log('do we have GH_INSTALLATION_ID?', Boolean(process.env.GH_INSTALLATION_ID))
console.log('do we have GH_PRIVATE_KEY?', Boolean(process.env.GH_PRIVATE_KEY))
console.log('do we have GH_TOKEN?', Boolean(process.env.GH_TOKEN))

const parsedRepo = parse(project)
const owner = parsedRepo[0]
Expand Down Expand Up @@ -249,7 +250,7 @@ Testing new Cypress version ${version}
owner,
repo,
message,
token: creds.githubToken,
token: process.env.GH_TOKEN,
}

const createGithubCommitStatusCheck = function ({ sha }) {
Expand Down

0 comments on commit b3b1f4b

Please sign in to comment.