From c22541df22d756cc90099455d8e14d98a3d4b76c Mon Sep 17 00:00:00 2001 From: Lais Tomaz Date: Mon, 8 Jun 2020 14:57:20 +0200 Subject: [PATCH 01/12] Rename all instances of blacklistHosts --- cli/schema/cypress.schema.json | 4 +-- .../desktop-gui/cypress/fixtures/config.json | 4 +-- .../cypress/integration/settings_spec.js | 6 ++-- packages/network/lib/blacklist.ts | 6 ++-- packages/proxy/lib/http/request-middleware.ts | 6 ++-- packages/server/lib/config.js | 6 ++-- packages/server/lib/server.js | 6 ++-- .../server/test/e2e/1_blacklist_hosts_spec.js | 2 +- .../test/integration/http_requests_spec.js | 2 +- packages/server/test/unit/args_spec.js | 14 ++++---- packages/server/test/unit/config_spec.js | 34 +++++++++---------- 11 files changed, 45 insertions(+), 45 deletions(-) diff --git a/cli/schema/cypress.schema.json b/cli/schema/cypress.schema.json index 4b69ddbcb589..db9a3fd0a368 100644 --- a/cli/schema/cypress.schema.json +++ b/cli/schema/cypress.schema.json @@ -175,7 +175,7 @@ "default": null, "description": "Enables you to override the default user agent the browser sends in all request headers. User agent values are typically used by servers to help identify the operating system, browser, and browser version. See User-Agent MDN Documentation for example user agent values here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent" }, - "blacklistHosts": { + "blocklistHosts": { "type": [ "string", "array" @@ -184,7 +184,7 @@ "type": "string" }, "default": null, - "description": "A String or Array of hosts that you wish to block traffic for. Please read the notes for examples on using this https://on.cypress.io/configuration#blacklistHosts" + "description": "A String or Array of hosts that you wish to block traffic for. Please read the notes for examples on using this https://on.cypress.io/configuration#blocklistHosts" }, "modifyObstructiveCode": { "type": "boolean", diff --git a/packages/desktop-gui/cypress/fixtures/config.json b/packages/desktop-gui/cypress/fixtures/config.json index f55c7483b7df..9219d5060b3d 100644 --- a/packages/desktop-gui/cypress/fixtures/config.json +++ b/packages/desktop-gui/cypress/fixtures/config.json @@ -109,7 +109,7 @@ "cypressHostUrl": "http://localhost:2020", "cypressEnv": "development", "env": {}, - "blacklistHosts": [ + "blocklistHosts": [ "www.google-analytics.com", "hotjar.com" ], @@ -376,7 +376,7 @@ "from": "default", "value": true }, - "blacklistHosts": { + "blocklistHosts": { "from": "config", "value": [ "www.google-analytics.com", diff --git a/packages/desktop-gui/cypress/integration/settings_spec.js b/packages/desktop-gui/cypress/integration/settings_spec.js index 85eaf91711cd..a3c4a54aa681 100644 --- a/packages/desktop-gui/cypress/integration/settings_spec.js +++ b/packages/desktop-gui/cypress/integration/settings_spec.js @@ -154,7 +154,7 @@ describe('Settings', () => { cy.get('@config-vars') .contains('span', 'Electron').parent('span').should('have.class', 'plugin') - cy.contains('span', 'blacklistHosts').parents('div').first().find('span').first().click() + cy.contains('span', 'blocklistHosts').parents('div').first().find('span').first().click() cy.get('@config-vars') .contains('span', 'www.google-analytics.com').parent('span').should('have.class', 'config') @@ -207,8 +207,8 @@ describe('Settings', () => { cy.get('.line').contains('*.foobar.com, *.bazqux.com') }) - it('displays "array" values for blacklistHosts', () => { - cy.contains('.line', 'blacklistHosts').contains('www.google-analytics.com, hotjar.com') + it('displays "array" values for blocklistHosts', () => { + cy.contains('.line', 'blocklistHosts').contains('www.google-analytics.com, hotjar.com') }) it('opens help link on click', () => { diff --git a/packages/network/lib/blacklist.ts b/packages/network/lib/blacklist.ts index 1a6b7021ecba..a36bd75edb88 100644 --- a/packages/network/lib/blacklist.ts +++ b/packages/network/lib/blacklist.ts @@ -2,9 +2,9 @@ import _ from 'lodash' import minimatch from 'minimatch' import { stripProtocolAndDefaultPorts } from './uri' -export function matches (urlToCheck, blacklistHosts) { +export function matches (urlToCheck, blocklistHosts) { // normalize into flat array - blacklistHosts = [].concat(blacklistHosts) + blocklistHosts = [].concat(blocklistHosts) urlToCheck = stripProtocolAndDefaultPorts(urlToCheck) @@ -14,5 +14,5 @@ export function matches (urlToCheck, blacklistHosts) { return minimatch(urlToCheck, hostMatcher) } - return _.find(blacklistHosts, matchUrl) + return _.find(blocklistHosts, matchUrl) } diff --git a/packages/proxy/lib/http/request-middleware.ts b/packages/proxy/lib/http/request-middleware.ts index 51dd2136efc1..5181504b8794 100644 --- a/packages/proxy/lib/http/request-middleware.ts +++ b/packages/proxy/lib/http/request-middleware.ts @@ -47,10 +47,10 @@ const RedirectToClientRouteIfNotProxied: RequestMiddleware = function () { } const EndRequestsToBlacklistedHosts: RequestMiddleware = function () { - const { blacklistHosts } = this.config + const { blocklistHosts } = this.config - if (blacklistHosts) { - const matches = blacklist.matches(this.req.proxiedUrl, blacklistHosts) + if (blocklistHosts) { + const matches = blacklist.matches(this.req.proxiedUrl, blocklistHosts) if (matches) { this.res.set('x-cypress-matched-blacklisted-host', matches) diff --git a/packages/server/lib/config.js b/packages/server/lib/config.js index a1bfbb39a2de..41f85eb3e1da 100644 --- a/packages/server/lib/config.js +++ b/packages/server/lib/config.js @@ -57,7 +57,7 @@ folders.push('componentFolder') const configKeys = toWords(`\ animationDistanceThreshold fileServerFolder baseUrl fixturesFolder -blacklistHosts +blocklistHosts chromeWebSecurity modifyObstructiveCode integrationFolder env pluginsFile @@ -119,7 +119,7 @@ const CONFIG_DEFAULTS = { isTextTerminal: false, reporter: 'spec', reporterOptions: null, - blacklistHosts: null, + blocklistHosts: null, clientRoute: '/__/', xhrRoute: '/xhrs/', socketIoRoute: '/__socket.io', @@ -175,7 +175,7 @@ const CONFIG_DEFAULTS = { const validationRules = { animationDistanceThreshold: v.isNumber, baseUrl: v.isFullyQualifiedUrl, - blacklistHosts: v.isStringOrArrayOfStrings, + blocklistHosts: v.isStringOrArrayOfStrings, browsers: v.isValidBrowserList, chromeWebSecurity: v.isBoolean, configFile: v.isStringOrFalse, diff --git a/packages/server/lib/server.js b/packages/server/lib/server.js index 02f7ccf206c5..3dade2ef8a4c 100644 --- a/packages/server/lib/server.js +++ b/packages/server/lib/server.js @@ -240,7 +240,7 @@ class Server { createServer (app, config, project, request, onWarning) { return new Promise((resolve, reject) => { - const { port, fileServerFolder, socketIoRoute, baseUrl, blacklistHosts } = config + const { port, fileServerFolder, socketIoRoute, baseUrl, blocklistHosts } = config this._server = http.createServer(app) @@ -299,8 +299,8 @@ class Server { // see if this matches - if so then // we cannot allow it to make a direct // connection - if (blacklistHosts && !isMatching) { - isMatching = blacklist.matches(urlToCheck, blacklistHosts) + if (blocklistHosts && !isMatching) { + isMatching = blacklist.matches(urlToCheck, blocklistHosts) debug(`HTTPS request ${urlToCheck} matches blacklist?`, isMatching) } diff --git a/packages/server/test/e2e/1_blacklist_hosts_spec.js b/packages/server/test/e2e/1_blacklist_hosts_spec.js index ae38f96f5f0d..b7ea65a1e955 100644 --- a/packages/server/test/e2e/1_blacklist_hosts_spec.js +++ b/packages/server/test/e2e/1_blacklist_hosts_spec.js @@ -25,7 +25,7 @@ describe('e2e blacklist', () => { }], settings: { baseUrl: 'http://localhost:3232', - blacklistHosts: 'localhost:3131', + blocklistHosts: 'localhost:3131', }, }) diff --git a/packages/server/test/integration/http_requests_spec.js b/packages/server/test/integration/http_requests_spec.js index de88edfe633c..7434b39cd6c7 100644 --- a/packages/server/test/integration/http_requests_spec.js +++ b/packages/server/test/integration/http_requests_spec.js @@ -3731,7 +3731,7 @@ describe('Routes', () => { beforeEach(function () { return this.setup({ config: { - blacklistHosts: [ + blocklistHosts: [ '*.google.com', 'shop.apple.com', 'cypress.io', diff --git a/packages/server/test/unit/args_spec.js b/packages/server/test/unit/args_spec.js index a09082c159bf..2815354de1d0 100644 --- a/packages/server/test/unit/args_spec.js +++ b/packages/server/test/unit/args_spec.js @@ -198,7 +198,7 @@ describe('lib/util/args', () => { const config = { pageLoadTimeout: 10000, waitForAnimations: false, - blacklistHosts: ['one.com', 'www.two.io'], + blocklistHosts: ['one.com', 'www.two.io'], hosts: { 'foobar.com': '127.0.0.1', }, @@ -211,7 +211,7 @@ describe('lib/util/args', () => { // as mixed usage const hosts = JSON.stringify(config.hosts) - const blacklistHosts = JSON.stringify(config.blacklistHosts) + const blocklistHosts = JSON.stringify(config.blocklistHosts) options = this.setup( '--config', @@ -219,7 +219,7 @@ describe('lib/util/args', () => { 'pageLoadTimeout=10000', 'waitForAnimations=false', `hosts=${hosts}`, - `blacklistHosts=${blacklistHosts}`, + `blocklistHosts=${blocklistHosts}`, ].join(','), ) @@ -276,7 +276,7 @@ describe('lib/util/args', () => { context('.toObject', () => { beforeEach(function () { this.hosts = { a: 'b', b: 'c' } - this.blacklistHosts = ['a.com', 'b.com'] + this.blocklistHosts = ['a.com', 'b.com'] this.specs = [ path.join(cwd, 'foo'), path.join(cwd, 'bar'), @@ -293,7 +293,7 @@ describe('lib/util/args', () => { env: this.env, hosts: this.hosts, requestTimeout: 1234, - blacklistHosts: this.blacklistHosts, + blocklistHosts: this.blocklistHosts, reporterOptions: { foo: 'bar', }, @@ -307,7 +307,7 @@ describe('lib/util/args', () => { '--get-key', '--env=foo=bar,baz=quux,bar=foo=quz', '--config', - `requestTimeout=1234,blacklistHosts=${s(this.blacklistHosts)},hosts=${s(this.hosts)}`, + `requestTimeout=1234,blocklistHosts=${s(this.blocklistHosts)},hosts=${s(this.hosts)}`, '--reporter-options=foo=bar', '--spec=foo,bar,baz', ) @@ -334,7 +334,7 @@ describe('lib/util/args', () => { it('can transpose back to an array', function () { const mergedConfig = JSON.stringify({ requestTimeout: this.config.requestTimeout, - blacklistHosts: this.blacklistHosts, + blocklistHosts: this.blocklistHosts, hosts: this.hosts, env: this.env, reporterOptions: { diff --git a/packages/server/test/unit/config_spec.js b/packages/server/test/unit/config_spec.js index aecaa46090af..ede7ba399a50 100644 --- a/packages/server/test/unit/config_spec.js +++ b/packages/server/test/unit/config_spec.js @@ -649,27 +649,27 @@ describe('lib/config', () => { }) }) - context('blacklistHosts', () => { + context('blocklistHosts', () => { it('passes if a string', function () { - this.setup({ blacklistHosts: 'google.com' }) + this.setup({ blocklistHosts: 'google.com' }) return this.expectValidationPasses() }) it('passes if an array of strings', function () { - this.setup({ blacklistHosts: ['google.com'] }) + this.setup({ blocklistHosts: ['google.com'] }) return this.expectValidationPasses() }) it('fails if not a string or array', function () { - this.setup({ blacklistHosts: 5 }) + this.setup({ blocklistHosts: 5 }) return this.expectValidationFails('be a string or an array of strings') }) it('fails if not an array of strings', function () { - this.setup({ blacklistHosts: [5] }) + this.setup({ blocklistHosts: [5] }) this.expectValidationFails('be a string or an array of strings') return this.expectValidationFails('the value was: `[5]`') @@ -717,8 +717,8 @@ describe('lib/config', () => { } }) - it('includes blacklistHosts', function () { - return this.includes('blacklistHosts') + it('includes blocklistHosts', function () { + return this.includes('blocklistHosts') }) }) @@ -957,19 +957,19 @@ describe('lib/config', () => { return this.defaults('supportFile', false, { supportFile: false }) }) - it('blacklistHosts=null', function () { - return this.defaults('blacklistHosts', null) + it('blocklistHosts=null', function () { + return this.defaults('blocklistHosts', null) }) - it('blacklistHosts=[a,b]', function () { - return this.defaults('blacklistHosts', ['a', 'b'], { - blacklistHosts: ['a', 'b'], + it('blocklistHosts=[a,b]', function () { + return this.defaults('blocklistHosts', ['a', 'b'], { + blocklistHosts: ['a', 'b'], }) }) - it('blacklistHosts=a|b', function () { - return this.defaults('blacklistHosts', ['a', 'b'], { - blacklistHosts: ['a', 'b'], + it('blocklistHosts=a|b', function () { + return this.defaults('blocklistHosts', ['a', 'b'], { + blocklistHosts: ['a', 'b'], }) }) @@ -1097,7 +1097,7 @@ describe('lib/config', () => { projectId: { value: null, from: 'default' }, port: { value: 1234, from: 'cli' }, hosts: { value: null, from: 'default' }, - blacklistHosts: { value: null, from: 'default' }, + blocklistHosts: { value: null, from: 'default' }, browsers: { value: [], from: 'default' }, userAgent: { value: null, from: 'default' }, reporter: { value: 'json', from: 'cli' }, @@ -1172,7 +1172,7 @@ describe('lib/config', () => { projectId: { value: 'projectId123', from: 'env' }, port: { value: 2020, from: 'config' }, hosts: { value: null, from: 'default' }, - blacklistHosts: { value: null, from: 'default' }, + blocklistHosts: { value: null, from: 'default' }, browsers: { value: [], from: 'default' }, userAgent: { value: null, from: 'default' }, reporter: { value: 'spec', from: 'default' }, From 52e68d5426773942e1e8dfcffb1fe764c7b55f17 Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Tue, 9 Jun 2020 10:33:06 +0630 Subject: [PATCH 02/12] Update code around blacklistHosts to use blocklist terminology --- packages/driver/src/cy/aliases.js | 4 ++-- .../cypress/integration/commands/agents_spec.js | 16 ++++++++-------- .../integration/commands/aliasing_spec.js | 8 ++++---- packages/network/README.md | 2 +- .../network/lib/{blacklist.ts => blocklist.ts} | 0 packages/network/lib/index.ts | 4 ++-- packages/network/test/unit/blacklist_spec.ts | 10 +++++----- packages/proxy/lib/http/request-middleware.ts | 8 ++++---- packages/server/lib/server.js | 10 +++++----- .../server/test/e2e/1_blacklist_hosts_spec.js | 4 ++-- .../test/integration/http_requests_spec.js | 4 ++-- ...s_spec.coffee => blocklist_hosts_spec.coffee} | 4 ++-- 12 files changed, 37 insertions(+), 37 deletions(-) rename packages/network/lib/{blacklist.ts => blocklist.ts} (100%) rename packages/server/test/support/fixtures/projects/e2e/cypress/integration/{blacklist_hosts_spec.coffee => blocklist_hosts_spec.coffee} (91%) diff --git a/packages/driver/src/cy/aliases.js b/packages/driver/src/cy/aliases.js index 2500567adffb..5a9aee2f2264 100644 --- a/packages/driver/src/cy/aliases.js +++ b/packages/driver/src/cy/aliases.js @@ -7,7 +7,7 @@ const aliasRe = /^@.+/ const aliasDisplayRe = /^([@]+)/ const requestXhrRe = /\.request$/ -const blacklist = ['test', 'runnable', 'timeout', 'slow', 'skip', 'inspect'] +const blocklist = ['test', 'runnable', 'timeout', 'slow', 'skip', 'inspect'] const aliasDisplayName = (name) => { return name.replace(aliasDisplayRe, '') @@ -39,7 +39,7 @@ const validateAlias = (alias) => { $errUtils.throwErrByPath('as.empty_string') } - if (blacklist.includes(alias)) { + if (blocklist.includes(alias)) { return $errUtils.throwErrByPath('as.reserved_word', { args: { alias } }) } } diff --git a/packages/driver/test/cypress/integration/commands/agents_spec.js b/packages/driver/test/cypress/integration/commands/agents_spec.js index 0088dfc6c210..5d804637b76e 100644 --- a/packages/driver/test/cypress/integration/commands/agents_spec.js +++ b/packages/driver/test/cypress/integration/commands/agents_spec.js @@ -352,11 +352,11 @@ describe('src/cy/commands/agents', () => { }).to.throw('`cy.as()` cannot be passed an empty string.') }) - _.each(['test', 'runnable', 'timeout', 'slow', 'skip', 'inspect'], (blacklist) => { - it(`throws on a blacklisted word: ${blacklist}`, () => { + _.each(['test', 'runnable', 'timeout', 'slow', 'skip', 'inspect'], (blocklist) => { + it(`throws on a blocklisted word: ${blocklist}`, () => { expect(() => { - cy.stub().as(blacklist) - }).to.throw(`\`cy.as()\` cannot be aliased as: \`${blacklist}\`. This word is reserved.`) + cy.stub().as(blocklist) + }).to.throw(`\`cy.as()\` cannot be aliased as: \`${blocklist}\`. This word is reserved.`) }) }) }) @@ -433,11 +433,11 @@ describe('src/cy/commands/agents', () => { }).to.throw('`cy.as()` cannot be passed an empty string.') }) - _.each(['test', 'runnable', 'timeout', 'slow', 'skip', 'inspect'], (blacklist) => { - it(`throws on a blacklisted word: ${blacklist}`, () => { + _.each(['test', 'runnable', 'timeout', 'slow', 'skip', 'inspect'], (blocklist) => { + it(`throws on a blocklisted word: ${blocklist}`, () => { expect(() => { - cy.stub().as(blacklist) - }).to.throw(`\`cy.as()\` cannot be aliased as: \`${blacklist}\`. This word is reserved.`) + cy.stub().as(blocklist) + }).to.throw(`\`cy.as()\` cannot be aliased as: \`${blocklist}\`. This word is reserved.`) }) }) }) diff --git a/packages/driver/test/cypress/integration/commands/aliasing_spec.js b/packages/driver/test/cypress/integration/commands/aliasing_spec.js index 3a88ff2d70fb..b3d7a6f7aeeb 100644 --- a/packages/driver/test/cypress/integration/commands/aliasing_spec.js +++ b/packages/driver/test/cypress/integration/commands/aliasing_spec.js @@ -232,16 +232,16 @@ describe('src/cy/commands/aliasing', () => { cy.get('@my@Alias') }) - _.each(['test', 'runnable', 'timeout', 'slow', 'skip', 'inspect'], (blacklist) => { - it(`throws on a blacklisted word: ${blacklist}`, (done) => { + _.each(['test', 'runnable', 'timeout', 'slow', 'skip', 'inspect'], (blocklist) => { + it(`throws on a blocklisted word: ${blocklist}`, (done) => { cy.on('fail', (err) => { - expect(err.message).to.eq(`\`cy.as()\` cannot be aliased as: \`${blacklist}\`. This word is reserved.`) + expect(err.message).to.eq(`\`cy.as()\` cannot be aliased as: \`${blocklist}\`. This word is reserved.`) expect(err.docsUrl).to.eq('https://on.cypress.io/as') done() }) - cy.get('div:first').as(blacklist) + cy.get('div:first').as(blocklist) }) }) }) diff --git a/packages/network/README.md b/packages/network/README.md index 335dc6489e40..dc1317aaa5a0 100644 --- a/packages/network/README.md +++ b/packages/network/README.md @@ -8,7 +8,7 @@ You can see a list of the modules exported from this package in [./lib/index.ts] * `agent` is a HTTP/HTTPS [agent][1] with support for HTTP/HTTPS proxies and keepalive whenever possible * `allowDestroy` can be used to wrap a `net.Server` to add a `.destroy()` method -* `blacklist` is a utility for matching glob blacklists +* `blocklist` is a utility for matching glob blocklists * `concatStream` is a wrapper around [`concat-stream@1.6.2`][2] that makes it always yield a `Buffer` * `connect` contains utilities for making network connections, including `createRetryingSocket` * `cors` contains utilities for Cross-Origin Resource Sharing diff --git a/packages/network/lib/blacklist.ts b/packages/network/lib/blocklist.ts similarity index 100% rename from packages/network/lib/blacklist.ts rename to packages/network/lib/blocklist.ts diff --git a/packages/network/lib/index.ts b/packages/network/lib/index.ts index f40984659a19..6616d9dabd4c 100644 --- a/packages/network/lib/index.ts +++ b/packages/network/lib/index.ts @@ -1,12 +1,12 @@ import agent from './agent' -import * as blacklist from './blacklist' +import * as blocklist from './blocklist' import * as connect from './connect' import * as cors from './cors' import * as uri from './uri' export { agent, - blacklist, + blocklist, connect, cors, uri, diff --git a/packages/network/test/unit/blacklist_spec.ts b/packages/network/test/unit/blacklist_spec.ts index 81e223b4f915..e0969085bec5 100644 --- a/packages/network/test/unit/blacklist_spec.ts +++ b/packages/network/test/unit/blacklist_spec.ts @@ -1,4 +1,4 @@ -import { blacklist } from '../..' +import { blocklist } from '../..' import { expect } from 'chai' const hosts = [ @@ -10,22 +10,22 @@ const hosts = [ ] const matchesStr = function (url, host, val) { - const m = blacklist.matches(url, host) + const m = blocklist.matches(url, host) expect(!!m).to.eq(val, `url: '${url}' did not pass`) } const matchesArray = function (url, val) { - const m = blacklist.matches(url, hosts) + const m = blocklist.matches(url, hosts) expect(!!m).to.eq(val, `url: '${url}' did not pass`) } const matchesHost = (url, host) => { - expect(blacklist.matches(url, hosts)).to.eq(host) + expect(blocklist.matches(url, hosts)).to.eq(host) } -describe('lib/blacklist', () => { +describe('lib/blocklist', () => { it('handles hosts, ports, wildcards', () => { matchesArray('https://mail.google.com/foo', true) matchesArray('https://shop.apple.com/bar', true) diff --git a/packages/proxy/lib/http/request-middleware.ts b/packages/proxy/lib/http/request-middleware.ts index 5181504b8794..b65266ebe9ca 100644 --- a/packages/proxy/lib/http/request-middleware.ts +++ b/packages/proxy/lib/http/request-middleware.ts @@ -1,6 +1,6 @@ import _ from 'lodash' import debugModule from 'debug' -import { blacklist, cors } from '@packages/network' +import { blocklist, cors } from '@packages/network' import { HttpMiddleware } from './' export type RequestMiddleware = HttpMiddleware<{ @@ -50,11 +50,11 @@ const EndRequestsToBlacklistedHosts: RequestMiddleware = function () { const { blocklistHosts } = this.config if (blocklistHosts) { - const matches = blacklist.matches(this.req.proxiedUrl, blocklistHosts) + const matches = blocklist.matches(this.req.proxiedUrl, blocklistHosts) if (matches) { - this.res.set('x-cypress-matched-blacklisted-host', matches) - debug('blacklisting request %o', { + this.res.set('x-cypress-matched-blocklisted-host', matches) + debug('blocklisting request %o', { url: this.req.proxiedUrl, matches, }) diff --git a/packages/server/lib/server.js b/packages/server/lib/server.js index 3dade2ef8a4c..78f4b28cb3f8 100644 --- a/packages/server/lib/server.js +++ b/packages/server/lib/server.js @@ -15,7 +15,7 @@ const compression = require('compression') const debug = require('debug')('cypress:server:server') const { agent, - blacklist, + blocklist, concatStream, cors, uri, @@ -293,16 +293,16 @@ class Server { // if we are currently matching then we're // not making a direct connection anyway // so we only need to check this if we - // have blacklist hosts and are not matching. + // have blocklist hosts and are not matching. // - // if we have blacklisted hosts lets + // if we have blocklisted hosts lets // see if this matches - if so then // we cannot allow it to make a direct // connection if (blocklistHosts && !isMatching) { - isMatching = blacklist.matches(urlToCheck, blocklistHosts) + isMatching = blocklist.matches(urlToCheck, blocklistHosts) - debug(`HTTPS request ${urlToCheck} matches blacklist?`, isMatching) + debug(`HTTPS request ${urlToCheck} matches blocklist?`, isMatching) } // make a direct connection only if diff --git a/packages/server/test/e2e/1_blacklist_hosts_spec.js b/packages/server/test/e2e/1_blacklist_hosts_spec.js index b7ea65a1e955..565fb41268c4 100644 --- a/packages/server/test/e2e/1_blacklist_hosts_spec.js +++ b/packages/server/test/e2e/1_blacklist_hosts_spec.js @@ -14,7 +14,7 @@ const onServer = function (app) { }) } -describe('e2e blacklist', () => { +describe('e2e blocklist', () => { e2e.setup({ servers: [{ port: 3131, @@ -31,7 +31,7 @@ describe('e2e blacklist', () => { it('passes', function () { return e2e.exec(this, { - spec: 'blacklist_hosts_spec.coffee', + spec: 'blocklist_hosts_spec.coffee', snapshot: true, }) }) diff --git a/packages/server/test/integration/http_requests_spec.js b/packages/server/test/integration/http_requests_spec.js index 7434b39cd6c7..c22d2b550460 100644 --- a/packages/server/test/integration/http_requests_spec.js +++ b/packages/server/test/integration/http_requests_spec.js @@ -3727,7 +3727,7 @@ describe('Routes', () => { }) }) - context('blacklisted hosts', () => { + context('blocklisted hosts', () => { beforeEach(function () { return this.setup({ config: { @@ -3744,7 +3744,7 @@ describe('Routes', () => { it('returns 503 and custom headers for all hosts', function () { const expectedHeader = (res, val) => { - expect(res.headers['x-cypress-matched-blacklisted-host']).to.eq(val) + expect(res.headers['x-cypress-matched-blocklisted-host']).to.eq(val) } return Promise.all([ diff --git a/packages/server/test/support/fixtures/projects/e2e/cypress/integration/blacklist_hosts_spec.coffee b/packages/server/test/support/fixtures/projects/e2e/cypress/integration/blocklist_hosts_spec.coffee similarity index 91% rename from packages/server/test/support/fixtures/projects/e2e/cypress/integration/blacklist_hosts_spec.coffee rename to packages/server/test/support/fixtures/projects/e2e/cypress/integration/blocklist_hosts_spec.coffee index 47fecb9a4e39..864ab0c8f6a6 100644 --- a/packages/server/test/support/fixtures/projects/e2e/cypress/integration/blacklist_hosts_spec.coffee +++ b/packages/server/test/support/fixtures/projects/e2e/cypress/integration/blocklist_hosts_spec.coffee @@ -1,5 +1,5 @@ -describe "blacklist", -> - it "forces blacklisted hosts to return 503", -> +describe "blocklist", -> + it "forces blocklisted hosts to return 503", -> cy .visit("http://localhost:3232") From 567ebd5a4d48db724f7e6619565d649a7f8607d8 Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Tue, 9 Jun 2020 11:58:14 +0630 Subject: [PATCH 03/12] Recapture snapshot for new blocklist files --- ...hosts_spec.js => 1_blocklist_hosts_spec.js} | 18 +++++++++--------- ...hosts_spec.js => 1_blocklist_hosts_spec.js} | 0 2 files changed, 9 insertions(+), 9 deletions(-) rename packages/server/__snapshots__/{1_blacklist_hosts_spec.js => 1_blocklist_hosts_spec.js} (89%) rename packages/server/test/e2e/{1_blacklist_hosts_spec.js => 1_blocklist_hosts_spec.js} (100%) diff --git a/packages/server/__snapshots__/1_blacklist_hosts_spec.js b/packages/server/__snapshots__/1_blocklist_hosts_spec.js similarity index 89% rename from packages/server/__snapshots__/1_blacklist_hosts_spec.js rename to packages/server/__snapshots__/1_blocklist_hosts_spec.js index ddc788d39721..63d0e7a567e9 100644 --- a/packages/server/__snapshots__/1_blacklist_hosts_spec.js +++ b/packages/server/__snapshots__/1_blocklist_hosts_spec.js @@ -1,4 +1,4 @@ -exports['e2e blacklist passes 1'] = ` +exports['e2e blocklist passes 1'] = ` ==================================================================================================== @@ -7,18 +7,18 @@ exports['e2e blacklist passes 1'] = ` ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 1.2.3 │ │ Browser: FooBrowser 88 │ - │ Specs: 1 found (blacklist_hosts_spec.coffee) │ - │ Searched: cypress/integration/blacklist_hosts_spec.coffee │ + │ Specs: 1 found (blocklist_hosts_spec.coffee) │ + │ Searched: cypress/integration/blocklist_hosts_spec.coffee │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── - Running: blacklist_hosts_spec.coffee (1 of 1) + Running: blocklist_hosts_spec.coffee (1 of 1) - blacklist - ✓ forces blacklisted hosts to return 503 + blocklist + ✓ forces blocklisted hosts to return 503 1 passing @@ -35,14 +35,14 @@ exports['e2e blacklist passes 1'] = ` │ Screenshots: 0 │ │ Video: true │ │ Duration: X seconds │ - │ Spec Ran: blacklist_hosts_spec.coffee │ + │ Spec Ran: blocklist_hosts_spec.coffee │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ (Video) - Started processing: Compressing to 32 CRF - - Finished processing: /XXX/XXX/XXX/cypress/videos/blacklist_hosts_spec.coffee.mp4 (X second) + - Finished processing: /XXX/XXX/XXX/cypress/videos/blocklist_hosts_spec.coffee.mp4 (X second) ==================================================================================================== @@ -52,7 +52,7 @@ exports['e2e blacklist passes 1'] = ` Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ ✔ blacklist_hosts_spec.coffee XX:XX 1 1 - - - │ + │ ✔ blocklist_hosts_spec.coffee XX:XX 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! XX:XX 1 1 - - - diff --git a/packages/server/test/e2e/1_blacklist_hosts_spec.js b/packages/server/test/e2e/1_blocklist_hosts_spec.js similarity index 100% rename from packages/server/test/e2e/1_blacklist_hosts_spec.js rename to packages/server/test/e2e/1_blocklist_hosts_spec.js From 1cf3fb1733227a1f8bebf804d06452638308cac6 Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Mon, 15 Jun 2020 12:58:49 +0630 Subject: [PATCH 04/12] Deprecate blacklistHosts instead of breaking - show warning --- cli/schema/cypress.schema.json | 11 +++++ packages/proxy/lib/http/request-middleware.ts | 11 ++--- .../test/unit/http/request-middleware.spec.ts | 2 +- packages/server/lib/config.js | 23 +++++++++- packages/server/lib/errors.js | 7 +++ packages/server/lib/server.js | 10 +++-- .../server/test/e2e/1_blocklist_hosts_spec.js | 23 ++++++++++ .../server/test/integration/cypress_spec.js | 11 +++++ .../test/integration/http_requests_spec.js | 44 ++++++++++++++++++ packages/server/test/unit/config_spec.js | 45 ++++++++++++------- 10 files changed, 160 insertions(+), 27 deletions(-) diff --git a/cli/schema/cypress.schema.json b/cli/schema/cypress.schema.json index 0e20b40c0798..06047badbde9 100644 --- a/cli/schema/cypress.schema.json +++ b/cli/schema/cypress.schema.json @@ -175,6 +175,17 @@ "default": null, "description": "Enables you to override the default user agent the browser sends in all request headers. User agent values are typically used by servers to help identify the operating system, browser, and browser version. See User-Agent MDN Documentation for example user agent values here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent" }, + "blacklistHosts": { + "type": [ + "string", + "array" + ], + "items": { + "type": "string" + }, + "default": null, + "description": "Deprecated: Please rename to 'blocklistHosts'. A String or Array of hosts that you wish to block traffic for. Please read the notes for examples on using this https://on.cypress.io/configuration#blocklistHosts" + }, "blocklistHosts": { "type": [ "string", diff --git a/packages/proxy/lib/http/request-middleware.ts b/packages/proxy/lib/http/request-middleware.ts index b65266ebe9ca..8d9e51b030a6 100644 --- a/packages/proxy/lib/http/request-middleware.ts +++ b/packages/proxy/lib/http/request-middleware.ts @@ -46,11 +46,12 @@ const RedirectToClientRouteIfNotProxied: RequestMiddleware = function () { this.next() } -const EndRequestsToBlacklistedHosts: RequestMiddleware = function () { - const { blocklistHosts } = this.config +const EndRequestsToBlocklistedHosts: RequestMiddleware = function () { + // blacklistHosts is deprecated, but still should work + const key = this.config.blocklistHosts ? 'blocklistHosts' : 'blacklistHosts' - if (blocklistHosts) { - const matches = blocklist.matches(this.req.proxiedUrl, blocklistHosts) + if (this.config[key]) { + const matches = blocklist.matches(this.req.proxiedUrl, this.config[key]) if (matches) { this.res.set('x-cypress-matched-blocklisted-host', matches) @@ -150,7 +151,7 @@ export default { LogRequest, RedirectToClientRouteIfUnloaded, RedirectToClientRouteIfNotProxied, - EndRequestsToBlacklistedHosts, + EndRequestsToBlocklistedHosts, MaybeEndRequestWithBufferedResponse, StripUnsupportedAcceptEncoding, MaybeSetBasicAuthHeaders, diff --git a/packages/proxy/test/unit/http/request-middleware.spec.ts b/packages/proxy/test/unit/http/request-middleware.spec.ts index 5fb61b6839e9..bd40b3bbafb0 100644 --- a/packages/proxy/test/unit/http/request-middleware.spec.ts +++ b/packages/proxy/test/unit/http/request-middleware.spec.ts @@ -8,7 +8,7 @@ describe('http/request-middleware', function () { 'LogRequest', 'RedirectToClientRouteIfUnloaded', 'RedirectToClientRouteIfNotProxied', - 'EndRequestsToBlacklistedHosts', + 'EndRequestsToBlocklistedHosts', 'MaybeEndRequestWithBufferedResponse', 'StripUnsupportedAcceptEncoding', 'MaybeSetBasicAuthHeaders', diff --git a/packages/server/lib/config.js b/packages/server/lib/config.js index 89dc47a06bd7..682f4c24892a 100644 --- a/packages/server/lib/config.js +++ b/packages/server/lib/config.js @@ -89,7 +89,12 @@ firefoxGcInterval\ // experimentalComponentTesting configKeys.push('componentFolder') -// Deprecated and retired public configuration properties +// Deprecated configuration properties, will only warn +const deprecatedConfigKeys = toWords(`\ +blacklistHosts\ +`) + +// Breaking public configuration properties, will error const breakingConfigKeys = toWords(`\ videoRecording screenshotOnHeadlessFailure @@ -119,6 +124,7 @@ const CONFIG_DEFAULTS = { isTextTerminal: false, reporter: 'spec', reporterOptions: null, + blacklistHosts: null, blocklistHosts: null, clientRoute: '/__/', xhrRoute: '/xhrs/', @@ -176,6 +182,7 @@ const CONFIG_DEFAULTS = { const validationRules = { animationDistanceThreshold: v.isNumber, baseUrl: v.isFullyQualifiedUrl, + blacklistHosts: v.isStringOrArrayOfStrings, blocklistHosts: v.isStringOrArrayOfStrings, browsers: v.isValidBrowserList, chromeWebSecurity: v.isBoolean, @@ -233,6 +240,18 @@ const convertRelativeToAbsolutePaths = (projectRoot, obj, defaults = {}) => { , {}) } +const warnDeprecatedConfig = (cfg) => { + return _.each(deprecatedConfigKeys, (key) => { + if (_.has(cfg, key)) { + switch (key) { + case 'blacklistHosts': + return errors.warning('DEPRECATED_RENAMED_CONFIG_OPTION', key, 'blocklistHosts') + default: + } + } + }) +} + const validateNoBreakingConfig = (cfg) => { return _.each(breakingConfigKeys, (key) => { if (_.has(cfg, key)) { @@ -366,6 +385,7 @@ module.exports = { whitelist (obj = {}) { const propertyNames = configKeys .concat(breakingConfigKeys) + .concat(deprecatedConfigKeys) .concat(systemConfigKeys) .concat(experimentalConfigKeys) @@ -477,6 +497,7 @@ module.exports = { }) validateNoBreakingConfig(config) + warnDeprecatedConfig(config) return this.setSupportFileAndFolder(config) .then(this.setPluginsFile) diff --git a/packages/server/lib/errors.js b/packages/server/lib/errors.js index 8797c2a48d4f..0c8940af1eae 100644 --- a/packages/server/lib/errors.js +++ b/packages/server/lib/errors.js @@ -666,6 +666,13 @@ const getMsgByType = function (type, arg1 = {}, arg2, arg3) { return stripIndent`\ A configuration option you have supplied has been renamed. + Please rename ${chalk.yellow(arg1)} to ${chalk.blue(arg2)}` + case 'DEPRECATED_RENAMED_CONFIG_OPTION': + return stripIndent`\ + The ${chalk.yellow(arg1)} configuration option you have supplied has been renamed. + + This configuration option will be removed and is not recommended for use. + Please rename ${chalk.yellow(arg1)} to ${chalk.blue(arg2)}` case 'CANNOT_CONNECT_BASE_URL': return stripIndent`\ diff --git a/packages/server/lib/server.js b/packages/server/lib/server.js index 78f4b28cb3f8..96edbd60443f 100644 --- a/packages/server/lib/server.js +++ b/packages/server/lib/server.js @@ -240,7 +240,7 @@ class Server { createServer (app, config, project, request, onWarning) { return new Promise((resolve, reject) => { - const { port, fileServerFolder, socketIoRoute, baseUrl, blocklistHosts } = config + const { port, fileServerFolder, socketIoRoute, baseUrl } = config this._server = http.createServer(app) @@ -299,8 +299,12 @@ class Server { // see if this matches - if so then // we cannot allow it to make a direct // connection - if (blocklistHosts && !isMatching) { - isMatching = blocklist.matches(urlToCheck, blocklistHosts) + + // blacklistHosts is deprecated, still need to support + const blocklistKey = config.blocklistHosts ? 'blocklistHosts' : 'blacklistHosts' + + if (config[blocklistKey] && !isMatching) { + isMatching = blocklist.matches(urlToCheck, config[blocklistKey]) debug(`HTTPS request ${urlToCheck} matches blocklist?`, isMatching) } diff --git a/packages/server/test/e2e/1_blocklist_hosts_spec.js b/packages/server/test/e2e/1_blocklist_hosts_spec.js index 565fb41268c4..b20775d7d6c7 100644 --- a/packages/server/test/e2e/1_blocklist_hosts_spec.js +++ b/packages/server/test/e2e/1_blocklist_hosts_spec.js @@ -14,6 +14,29 @@ const onServer = function (app) { }) } +describe('e2e blacklist (deprecated)', () => { + e2e.setup({ + servers: [{ + port: 3131, + onServer, + }, { + port: 3232, + onServer, + }], + settings: { + baseUrl: 'http://localhost:3232', + blacklistHosts: 'localhost:3131', + }, + }) + + it('passes', function () { + return e2e.exec(this, { + spec: 'blocklist_hosts_spec.coffee', + snapshot: true, + }) + }) +}) + describe('e2e blocklist', () => { e2e.setup({ servers: [{ diff --git a/packages/server/test/integration/cypress_spec.js b/packages/server/test/integration/cypress_spec.js index 627fd351ab30..f3752b2a278d 100644 --- a/packages/server/test/integration/cypress_spec.js +++ b/packages/server/test/integration/cypress_spec.js @@ -745,6 +745,17 @@ describe('lib/cypress', () => { }) }) + it('logs warning when using deprecated configuration option: blacklistHosts', function () { + return cypress.start([ + `--run-project=${this.todosPath}`, + '--config=blacklistHosts=""', + ]) + .then(() => { + expect(errors.warning).to.be.calledWith('DEPRECATED_RENAMED_CONFIG_OPTION', 'blacklistHosts', 'blocklistHosts') + expect(console.log).to.be.calledWithMatch('The blacklistHosts configuration option you have supplied has been renamed.') + }) + }) + it('does not log warning when no projectId', function () { return cypress.start([`--run-project=${this.pristinePath}`, '--key=asdf']) .then(() => { diff --git a/packages/server/test/integration/http_requests_spec.js b/packages/server/test/integration/http_requests_spec.js index 5432d3981908..b0f29c1c740c 100644 --- a/packages/server/test/integration/http_requests_spec.js +++ b/packages/server/test/integration/http_requests_spec.js @@ -3727,6 +3727,50 @@ describe('Routes', () => { }) }) + context('blacklisted hosts (deprecated)', () => { + beforeEach(function () { + return this.setup({ + config: { + blacklistHosts: [ + '*.google.com', + 'shop.apple.com', + 'cypress.io', + 'localhost:6666', + '*adwords.com', + ], + }, + }) + }) + + it('returns 503 and custom headers for all hosts', function () { + const expectedHeader = (res, val) => { + expect(res.headers['x-cypress-matched-blocklisted-host']).to.eq(val) + } + + return Promise.all([ + this.rp('https://mail.google.com/f'), + this.rp('http://shop.apple.com/o'), + this.rp('https://cypress.io'), + this.rp('https://localhost:6666/o'), + this.rp('https://some.adwords.com'), + ]) + .spread((...responses) => { + _.every(responses, (res) => { + expect(res.statusCode).to.eq(503) + + expect(res.body).to.be.empty + }) + + expectedHeader(responses[0], '*.google.com') + expectedHeader(responses[1], 'shop.apple.com') + expectedHeader(responses[2], 'cypress.io') + expectedHeader(responses[3], 'localhost:6666') + + return expectedHeader(responses[4], '*adwords.com') + }) + }) + }) + context('blocklisted hosts', () => { beforeEach(function () { return this.setup({ diff --git a/packages/server/test/unit/config_spec.js b/packages/server/test/unit/config_spec.js index 2ca10bc7e071..6ffca449d7c5 100644 --- a/packages/server/test/unit/config_spec.js +++ b/packages/server/test/unit/config_spec.js @@ -649,30 +649,41 @@ describe('lib/config', () => { }) }) - context('blocklistHosts', () => { - it('passes if a string', function () { - this.setup({ blocklistHosts: 'google.com' }) + // blacklistHosts is deprecated, should be supported + const blocklistKeys = ['blocklistHosts', 'blacklistHosts'] - return this.expectValidationPasses() - }) + blocklistKeys.forEach((blocklistKey) => { + context(`${blocklistKey}`, () => { + const config = {} - it('passes if an array of strings', function () { - this.setup({ blocklistHosts: ['google.com'] }) + it('passes if a string', function () { + config[blocklistKey] = 'google.com' + this.setup(config) - return this.expectValidationPasses() - }) + return this.expectValidationPasses() + }) - it('fails if not a string or array', function () { - this.setup({ blocklistHosts: 5 }) + it('passes if an array of strings', function () { + config[blocklistKey] = ['google.com'] + this.setup(config) - return this.expectValidationFails('be a string or an array of strings') - }) + return this.expectValidationPasses() + }) - it('fails if not an array of strings', function () { - this.setup({ blocklistHosts: [5] }) - this.expectValidationFails('be a string or an array of strings') + it('fails if not a string or array', function () { + config[blocklistKey] = 5 + this.setup(config) - return this.expectValidationFails('the value was: `[5]`') + return this.expectValidationFails('be a string or an array of strings') + }) + + it('fails if not an array of strings', function () { + config[blocklistKey] = [5] + this.setup(config) + this.expectValidationFails('be a string or an array of strings') + + return this.expectValidationFails('the value was: `[5]`') + }) }) }) From 966f21bc1d04a392f69da362b51896a05e89608a Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Mon, 15 Jun 2020 14:28:06 +0630 Subject: [PATCH 05/12] don't set default for deprecated key --- packages/server/lib/config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/server/lib/config.js b/packages/server/lib/config.js index 682f4c24892a..5dff92c12cd4 100644 --- a/packages/server/lib/config.js +++ b/packages/server/lib/config.js @@ -124,7 +124,6 @@ const CONFIG_DEFAULTS = { isTextTerminal: false, reporter: 'spec', reporterOptions: null, - blacklistHosts: null, blocklistHosts: null, clientRoute: '/__/', xhrRoute: '/xhrs/', From 93502511a01dbb9e307aa6fca8d5e07e445ccb3b Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Mon, 15 Jun 2020 15:05:49 +0630 Subject: [PATCH 06/12] make error less specific so it matches without ansi code --- packages/server/test/integration/cypress_spec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/server/test/integration/cypress_spec.js b/packages/server/test/integration/cypress_spec.js index f3752b2a278d..37a929785bc0 100644 --- a/packages/server/test/integration/cypress_spec.js +++ b/packages/server/test/integration/cypress_spec.js @@ -752,7 +752,8 @@ describe('lib/cypress', () => { ]) .then(() => { expect(errors.warning).to.be.calledWith('DEPRECATED_RENAMED_CONFIG_OPTION', 'blacklistHosts', 'blocklistHosts') - expect(console.log).to.be.calledWithMatch('The blacklistHosts configuration option you have supplied has been renamed.') + expect(console.log).to.be.calledWithMatch('configuration option you have supplied has been renamed.') + expect(console.log).to.be.calledWithMatch('This configuration option will be removed and is not recommended for use') }) }) From 1712c5c3d8e4f358d0c09745d8850c230877c5f1 Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Mon, 15 Jun 2020 15:12:29 +0630 Subject: [PATCH 07/12] Update blacklistHosts snapshot, set them both to no video (unecessary) --- .../__snapshots__/1_blocklist_hosts_spec.js | 62 +++++++++++++++++-- .../server/test/e2e/1_blocklist_hosts_spec.js | 2 + 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/packages/server/__snapshots__/1_blocklist_hosts_spec.js b/packages/server/__snapshots__/1_blocklist_hosts_spec.js index 63d0e7a567e9..0363989d98f0 100644 --- a/packages/server/__snapshots__/1_blocklist_hosts_spec.js +++ b/packages/server/__snapshots__/1_blocklist_hosts_spec.js @@ -33,16 +33,70 @@ exports['e2e blocklist passes 1'] = ` │ Pending: 0 │ │ Skipped: 0 │ │ Screenshots: 0 │ - │ Video: true │ + │ Video: false │ │ Duration: X seconds │ │ Spec Ran: blocklist_hosts_spec.coffee │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ - (Video) +==================================================================================================== + + (Run Finished) + + + Spec Tests Passing Failing Pending Skipped + ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ ✔ blocklist_hosts_spec.coffee XX:XX 1 1 - - - │ + └────────────────────────────────────────────────────────────────────────────────────────────────┘ + ✔ All specs passed! XX:XX 1 1 - - - + + +` + +exports['e2e blacklist (deprecated) passes 1'] = ` +The blacklistHosts configuration option you have supplied has been renamed. + +This configuration option will be removed and is not recommended for use. + +Please rename blacklistHosts to blocklistHosts + +==================================================================================================== + + (Run Starting) + + ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ Cypress: 1.2.3 │ + │ Browser: FooBrowser 88 │ + │ Specs: 1 found (blocklist_hosts_spec.coffee) │ + │ Searched: cypress/integration/blocklist_hosts_spec.coffee │ + └────────────────────────────────────────────────────────────────────────────────────────────────┘ + + +──────────────────────────────────────────────────────────────────────────────────────────────────── + + Running: blocklist_hosts_spec.coffee (1 of 1) + + + blocklist + ✓ forces blocklisted hosts to return 503 + + + 1 passing - - Started processing: Compressing to 32 CRF - - Finished processing: /XXX/XXX/XXX/cypress/videos/blocklist_hosts_spec.coffee.mp4 (X second) + + (Results) + + ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ Tests: 1 │ + │ Passing: 1 │ + │ Failing: 0 │ + │ Pending: 0 │ + │ Skipped: 0 │ + │ Screenshots: 0 │ + │ Video: false │ + │ Duration: X seconds │ + │ Spec Ran: blocklist_hosts_spec.coffee │ + └────────────────────────────────────────────────────────────────────────────────────────────────┘ ==================================================================================================== diff --git a/packages/server/test/e2e/1_blocklist_hosts_spec.js b/packages/server/test/e2e/1_blocklist_hosts_spec.js index b20775d7d6c7..69325b5c446d 100644 --- a/packages/server/test/e2e/1_blocklist_hosts_spec.js +++ b/packages/server/test/e2e/1_blocklist_hosts_spec.js @@ -26,6 +26,7 @@ describe('e2e blacklist (deprecated)', () => { settings: { baseUrl: 'http://localhost:3232', blacklistHosts: 'localhost:3131', + video: false, }, }) @@ -49,6 +50,7 @@ describe('e2e blocklist', () => { settings: { baseUrl: 'http://localhost:3232', blocklistHosts: 'localhost:3131', + video: false, }, }) From c7c1c6f5adde1feeeae16bcca227dcfa01b5ea0c Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Tue, 23 Jun 2020 11:48:29 +0630 Subject: [PATCH 08/12] Go back to breaking change for blacklistHosts removal. --- cli/schema/cypress.schema.json | 11 ---- .../{blacklist_spec.ts => blocklist_spec.ts} | 0 packages/proxy/lib/http/request-middleware.ts | 7 +-- .../__snapshots__/1_blocklist_hosts_spec.js | 60 ------------------- packages/server/lib/config.js | 23 +------ packages/server/lib/errors.js | 7 --- packages/server/lib/server.js | 9 +-- .../server/test/e2e/1_blocklist_hosts_spec.js | 24 -------- .../server/test/integration/cypress_spec.js | 56 ++++++++--------- .../test/integration/http_requests_spec.js | 44 -------------- packages/server/test/unit/config_spec.js | 45 ++++++-------- 11 files changed, 51 insertions(+), 235 deletions(-) rename packages/network/test/unit/{blacklist_spec.ts => blocklist_spec.ts} (100%) diff --git a/cli/schema/cypress.schema.json b/cli/schema/cypress.schema.json index 06047badbde9..0e20b40c0798 100644 --- a/cli/schema/cypress.schema.json +++ b/cli/schema/cypress.schema.json @@ -175,17 +175,6 @@ "default": null, "description": "Enables you to override the default user agent the browser sends in all request headers. User agent values are typically used by servers to help identify the operating system, browser, and browser version. See User-Agent MDN Documentation for example user agent values here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent" }, - "blacklistHosts": { - "type": [ - "string", - "array" - ], - "items": { - "type": "string" - }, - "default": null, - "description": "Deprecated: Please rename to 'blocklistHosts'. A String or Array of hosts that you wish to block traffic for. Please read the notes for examples on using this https://on.cypress.io/configuration#blocklistHosts" - }, "blocklistHosts": { "type": [ "string", diff --git a/packages/network/test/unit/blacklist_spec.ts b/packages/network/test/unit/blocklist_spec.ts similarity index 100% rename from packages/network/test/unit/blacklist_spec.ts rename to packages/network/test/unit/blocklist_spec.ts diff --git a/packages/proxy/lib/http/request-middleware.ts b/packages/proxy/lib/http/request-middleware.ts index 8d9e51b030a6..469f3ebd0659 100644 --- a/packages/proxy/lib/http/request-middleware.ts +++ b/packages/proxy/lib/http/request-middleware.ts @@ -47,11 +47,10 @@ const RedirectToClientRouteIfNotProxied: RequestMiddleware = function () { } const EndRequestsToBlocklistedHosts: RequestMiddleware = function () { - // blacklistHosts is deprecated, but still should work - const key = this.config.blocklistHosts ? 'blocklistHosts' : 'blacklistHosts' + const { blocklistHosts } = this.config - if (this.config[key]) { - const matches = blocklist.matches(this.req.proxiedUrl, this.config[key]) + if (blocklistHosts) { + const matches = blocklist.matches(this.req.proxiedUrl, blocklistHosts) if (matches) { this.res.set('x-cypress-matched-blocklisted-host', matches) diff --git a/packages/server/__snapshots__/1_blocklist_hosts_spec.js b/packages/server/__snapshots__/1_blocklist_hosts_spec.js index 0363989d98f0..05cf65313ccb 100644 --- a/packages/server/__snapshots__/1_blocklist_hosts_spec.js +++ b/packages/server/__snapshots__/1_blocklist_hosts_spec.js @@ -52,63 +52,3 @@ exports['e2e blocklist passes 1'] = ` ` - -exports['e2e blacklist (deprecated) passes 1'] = ` -The blacklistHosts configuration option you have supplied has been renamed. - -This configuration option will be removed and is not recommended for use. - -Please rename blacklistHosts to blocklistHosts - -==================================================================================================== - - (Run Starting) - - ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ Cypress: 1.2.3 │ - │ Browser: FooBrowser 88 │ - │ Specs: 1 found (blocklist_hosts_spec.coffee) │ - │ Searched: cypress/integration/blocklist_hosts_spec.coffee │ - └────────────────────────────────────────────────────────────────────────────────────────────────┘ - - -──────────────────────────────────────────────────────────────────────────────────────────────────── - - Running: blocklist_hosts_spec.coffee (1 of 1) - - - blocklist - ✓ forces blocklisted hosts to return 503 - - - 1 passing - - - (Results) - - ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ Tests: 1 │ - │ Passing: 1 │ - │ Failing: 0 │ - │ Pending: 0 │ - │ Skipped: 0 │ - │ Screenshots: 0 │ - │ Video: false │ - │ Duration: X seconds │ - │ Spec Ran: blocklist_hosts_spec.coffee │ - └────────────────────────────────────────────────────────────────────────────────────────────────┘ - - -==================================================================================================== - - (Run Finished) - - - Spec Tests Passing Failing Pending Skipped - ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ ✔ blocklist_hosts_spec.coffee XX:XX 1 1 - - - │ - └────────────────────────────────────────────────────────────────────────────────────────────────┘ - ✔ All specs passed! XX:XX 1 1 - - - - - -` diff --git a/packages/server/lib/config.js b/packages/server/lib/config.js index 5dff92c12cd4..0d07a19b30c9 100644 --- a/packages/server/lib/config.js +++ b/packages/server/lib/config.js @@ -89,13 +89,9 @@ firefoxGcInterval\ // experimentalComponentTesting configKeys.push('componentFolder') -// Deprecated configuration properties, will only warn -const deprecatedConfigKeys = toWords(`\ -blacklistHosts\ -`) - // Breaking public configuration properties, will error const breakingConfigKeys = toWords(`\ +blacklistHosts videoRecording screenshotOnHeadlessFailure trashAssetsBeforeHeadlessRuns\ @@ -181,7 +177,6 @@ const CONFIG_DEFAULTS = { const validationRules = { animationDistanceThreshold: v.isNumber, baseUrl: v.isFullyQualifiedUrl, - blacklistHosts: v.isStringOrArrayOfStrings, blocklistHosts: v.isStringOrArrayOfStrings, browsers: v.isValidBrowserList, chromeWebSecurity: v.isBoolean, @@ -239,18 +234,6 @@ const convertRelativeToAbsolutePaths = (projectRoot, obj, defaults = {}) => { , {}) } -const warnDeprecatedConfig = (cfg) => { - return _.each(deprecatedConfigKeys, (key) => { - if (_.has(cfg, key)) { - switch (key) { - case 'blacklistHosts': - return errors.warning('DEPRECATED_RENAMED_CONFIG_OPTION', key, 'blocklistHosts') - default: - } - } - }) -} - const validateNoBreakingConfig = (cfg) => { return _.each(breakingConfigKeys, (key) => { if (_.has(cfg, key)) { @@ -261,6 +244,8 @@ const validateNoBreakingConfig = (cfg) => { return errors.throw('RENAMED_CONFIG_OPTION', key, 'trashAssetsBeforeRuns') case 'videoRecording': return errors.throw('RENAMED_CONFIG_OPTION', key, 'video') + case 'blacklistHosts': + return errors.throw('RENAMED_CONFIG_OPTION', key, 'blocklistHosts') default: } } @@ -384,7 +369,6 @@ module.exports = { whitelist (obj = {}) { const propertyNames = configKeys .concat(breakingConfigKeys) - .concat(deprecatedConfigKeys) .concat(systemConfigKeys) .concat(experimentalConfigKeys) @@ -496,7 +480,6 @@ module.exports = { }) validateNoBreakingConfig(config) - warnDeprecatedConfig(config) return this.setSupportFileAndFolder(config) .then(this.setPluginsFile) diff --git a/packages/server/lib/errors.js b/packages/server/lib/errors.js index 0c8940af1eae..80bab50c4498 100644 --- a/packages/server/lib/errors.js +++ b/packages/server/lib/errors.js @@ -663,16 +663,9 @@ const getMsgByType = function (type, arg1 = {}, arg2, arg3) { Learn more at https://on.cypress.io/screenshot-api` case 'RENAMED_CONFIG_OPTION': - return stripIndent`\ - A configuration option you have supplied has been renamed. - - Please rename ${chalk.yellow(arg1)} to ${chalk.blue(arg2)}` - case 'DEPRECATED_RENAMED_CONFIG_OPTION': return stripIndent`\ The ${chalk.yellow(arg1)} configuration option you have supplied has been renamed. - This configuration option will be removed and is not recommended for use. - Please rename ${chalk.yellow(arg1)} to ${chalk.blue(arg2)}` case 'CANNOT_CONNECT_BASE_URL': return stripIndent`\ diff --git a/packages/server/lib/server.js b/packages/server/lib/server.js index 96edbd60443f..24b633c79383 100644 --- a/packages/server/lib/server.js +++ b/packages/server/lib/server.js @@ -240,7 +240,7 @@ class Server { createServer (app, config, project, request, onWarning) { return new Promise((resolve, reject) => { - const { port, fileServerFolder, socketIoRoute, baseUrl } = config + const { port, fileServerFolder, socketIoRoute, baseUrl, blocklistHosts } = config this._server = http.createServer(app) @@ -300,11 +300,8 @@ class Server { // we cannot allow it to make a direct // connection - // blacklistHosts is deprecated, still need to support - const blocklistKey = config.blocklistHosts ? 'blocklistHosts' : 'blacklistHosts' - - if (config[blocklistKey] && !isMatching) { - isMatching = blocklist.matches(urlToCheck, config[blocklistKey]) + if (blocklistHosts && !isMatching) { + isMatching = blocklist.matches(urlToCheck, blocklistHosts) debug(`HTTPS request ${urlToCheck} matches blocklist?`, isMatching) } diff --git a/packages/server/test/e2e/1_blocklist_hosts_spec.js b/packages/server/test/e2e/1_blocklist_hosts_spec.js index 69325b5c446d..68a8b450acff 100644 --- a/packages/server/test/e2e/1_blocklist_hosts_spec.js +++ b/packages/server/test/e2e/1_blocklist_hosts_spec.js @@ -14,30 +14,6 @@ const onServer = function (app) { }) } -describe('e2e blacklist (deprecated)', () => { - e2e.setup({ - servers: [{ - port: 3131, - onServer, - }, { - port: 3232, - onServer, - }], - settings: { - baseUrl: 'http://localhost:3232', - blacklistHosts: 'localhost:3131', - video: false, - }, - }) - - it('passes', function () { - return e2e.exec(this, { - spec: 'blocklist_hosts_spec.coffee', - snapshot: true, - }) - }) -}) - describe('e2e blocklist', () => { e2e.setup({ servers: [{ diff --git a/packages/server/test/integration/cypress_spec.js b/packages/server/test/integration/cypress_spec.js index 37a929785bc0..1fb91faceefa 100644 --- a/packages/server/test/integration/cypress_spec.js +++ b/packages/server/test/integration/cypress_spec.js @@ -745,18 +745,6 @@ describe('lib/cypress', () => { }) }) - it('logs warning when using deprecated configuration option: blacklistHosts', function () { - return cypress.start([ - `--run-project=${this.todosPath}`, - '--config=blacklistHosts=""', - ]) - .then(() => { - expect(errors.warning).to.be.calledWith('DEPRECATED_RENAMED_CONFIG_OPTION', 'blacklistHosts', 'blocklistHosts') - expect(console.log).to.be.calledWithMatch('configuration option you have supplied has been renamed.') - expect(console.log).to.be.calledWithMatch('This configuration option will be removed and is not recommended for use') - }) - }) - it('does not log warning when no projectId', function () { return cypress.start([`--run-project=${this.pristinePath}`, '--key=asdf']) .then(() => { @@ -901,25 +889,31 @@ describe('lib/cypress', () => { }) }) - it('logs error and exits when using an old configuration option: trashAssetsBeforeHeadlessRuns', function () { - return cypress.start([ - `--run-project=${this.todosPath}`, - '--config=trashAssetsBeforeHeadlessRuns=false', - ]) - .then(() => { - this.expectExitWithErr('RENAMED_CONFIG_OPTION', 'trashAssetsBeforeHeadlessRuns') - this.expectExitWithErr('RENAMED_CONFIG_OPTION', 'trashAssetsBeforeRuns') - }) - }) - - it('logs error and exits when using an old configuration option: videoRecording', function () { - return cypress.start([ - `--run-project=${this.todosPath}`, - '--config=videoRecording=false', - ]) - .then(() => { - this.expectExitWithErr('RENAMED_CONFIG_OPTION', 'videoRecording') - this.expectExitWithErr('RENAMED_CONFIG_OPTION', 'video') + const renamedConfigs = [ + { + old: 'trashAssetsBeforeHeadlessRuns', + new: 'trashAssetsBeforeRuns', + }, + { + old: 'videoRecording', + new: 'video', + }, + { + old: 'blacklistHosts', + new: 'blocklistHosts', + }, + ] + + renamedConfigs.forEach(function (config) { + it(`logs error and exits when using an old configuration option: ${config.old}`, function () { + return cypress.start([ + `--run-project=${this.todosPath}`, + `--config=${config.old}=''`, + ]) + .then(() => { + this.expectExitWithErr('RENAMED_CONFIG_OPTION', config.old) + this.expectExitWithErr('RENAMED_CONFIG_OPTION', config.new) + }) }) }) diff --git a/packages/server/test/integration/http_requests_spec.js b/packages/server/test/integration/http_requests_spec.js index b0f29c1c740c..5432d3981908 100644 --- a/packages/server/test/integration/http_requests_spec.js +++ b/packages/server/test/integration/http_requests_spec.js @@ -3727,50 +3727,6 @@ describe('Routes', () => { }) }) - context('blacklisted hosts (deprecated)', () => { - beforeEach(function () { - return this.setup({ - config: { - blacklistHosts: [ - '*.google.com', - 'shop.apple.com', - 'cypress.io', - 'localhost:6666', - '*adwords.com', - ], - }, - }) - }) - - it('returns 503 and custom headers for all hosts', function () { - const expectedHeader = (res, val) => { - expect(res.headers['x-cypress-matched-blocklisted-host']).to.eq(val) - } - - return Promise.all([ - this.rp('https://mail.google.com/f'), - this.rp('http://shop.apple.com/o'), - this.rp('https://cypress.io'), - this.rp('https://localhost:6666/o'), - this.rp('https://some.adwords.com'), - ]) - .spread((...responses) => { - _.every(responses, (res) => { - expect(res.statusCode).to.eq(503) - - expect(res.body).to.be.empty - }) - - expectedHeader(responses[0], '*.google.com') - expectedHeader(responses[1], 'shop.apple.com') - expectedHeader(responses[2], 'cypress.io') - expectedHeader(responses[3], 'localhost:6666') - - return expectedHeader(responses[4], '*adwords.com') - }) - }) - }) - context('blocklisted hosts', () => { beforeEach(function () { return this.setup({ diff --git a/packages/server/test/unit/config_spec.js b/packages/server/test/unit/config_spec.js index 6ffca449d7c5..2ca10bc7e071 100644 --- a/packages/server/test/unit/config_spec.js +++ b/packages/server/test/unit/config_spec.js @@ -649,41 +649,30 @@ describe('lib/config', () => { }) }) - // blacklistHosts is deprecated, should be supported - const blocklistKeys = ['blocklistHosts', 'blacklistHosts'] - - blocklistKeys.forEach((blocklistKey) => { - context(`${blocklistKey}`, () => { - const config = {} - - it('passes if a string', function () { - config[blocklistKey] = 'google.com' - this.setup(config) + context('blocklistHosts', () => { + it('passes if a string', function () { + this.setup({ blocklistHosts: 'google.com' }) - return this.expectValidationPasses() - }) + return this.expectValidationPasses() + }) - it('passes if an array of strings', function () { - config[blocklistKey] = ['google.com'] - this.setup(config) + it('passes if an array of strings', function () { + this.setup({ blocklistHosts: ['google.com'] }) - return this.expectValidationPasses() - }) + return this.expectValidationPasses() + }) - it('fails if not a string or array', function () { - config[blocklistKey] = 5 - this.setup(config) + it('fails if not a string or array', function () { + this.setup({ blocklistHosts: 5 }) - return this.expectValidationFails('be a string or an array of strings') - }) + return this.expectValidationFails('be a string or an array of strings') + }) - it('fails if not an array of strings', function () { - config[blocklistKey] = [5] - this.setup(config) - this.expectValidationFails('be a string or an array of strings') + it('fails if not an array of strings', function () { + this.setup({ blocklistHosts: [5] }) + this.expectValidationFails('be a string or an array of strings') - return this.expectValidationFails('the value was: `[5]`') - }) + return this.expectValidationFails('the value was: `[5]`') }) }) From 987cc6fa1381533db9707b2d436d9ff22e495e23 Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Fri, 26 Jun 2020 11:37:45 +0630 Subject: [PATCH 09/12] rename blacklistHosts to more active voice blockHosts --- cli/schema/cypress.schema.json | 4 +-- .../desktop-gui/cypress/fixtures/config.json | 4 +-- .../cypress/integration/settings_spec.js | 6 ++-- .../integration/commands/agents_spec.js | 16 ++++----- .../integration/commands/aliasing_spec.js | 8 ++--- packages/driver/src/cy/aliases.js | 4 +-- packages/network/README.md | 2 +- .../network/lib/{blocklist.ts => blocked.ts} | 6 ++-- packages/network/lib/index.ts | 4 +-- .../{blocklist_spec.ts => blocked_spec.ts} | 10 +++--- packages/proxy/lib/http/request-middleware.ts | 16 ++++----- .../test/unit/http/request-middleware.spec.ts | 2 +- ...st_hosts_spec.js => 1_block_hosts_spec.js} | 16 ++++----- packages/server/lib/browsers/firefox.ts | 2 +- packages/server/lib/config.js | 8 ++--- packages/server/lib/server.js | 14 ++++---- ...st_hosts_spec.js => 1_block_hosts_spec.js} | 6 ++-- .../server/test/integration/cypress_spec.js | 2 +- .../test/integration/http_requests_spec.js | 6 ++-- ...ts_spec.coffee => block_hosts_spec.coffee} | 4 +-- packages/server/test/unit/args_spec.js | 14 ++++---- packages/server/test/unit/config_spec.js | 34 +++++++++---------- 22 files changed, 94 insertions(+), 94 deletions(-) rename packages/network/lib/{blocklist.ts => blocked.ts} (71%) rename packages/network/test/unit/{blocklist_spec.ts => blocked_spec.ts} (87%) rename packages/server/__snapshots__/{1_blocklist_hosts_spec.js => 1_block_hosts_spec.js} (89%) rename packages/server/test/e2e/{1_blocklist_hosts_spec.js => 1_block_hosts_spec.js} (84%) rename packages/server/test/support/fixtures/projects/e2e/cypress/integration/{blocklist_hosts_spec.coffee => block_hosts_spec.coffee} (91%) diff --git a/cli/schema/cypress.schema.json b/cli/schema/cypress.schema.json index 0e20b40c0798..80894c1c5c33 100644 --- a/cli/schema/cypress.schema.json +++ b/cli/schema/cypress.schema.json @@ -175,7 +175,7 @@ "default": null, "description": "Enables you to override the default user agent the browser sends in all request headers. User agent values are typically used by servers to help identify the operating system, browser, and browser version. See User-Agent MDN Documentation for example user agent values here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent" }, - "blocklistHosts": { + "blockHosts": { "type": [ "string", "array" @@ -184,7 +184,7 @@ "type": "string" }, "default": null, - "description": "A String or Array of hosts that you wish to block traffic for. Please read the notes for examples on using this https://on.cypress.io/configuration#blocklistHosts" + "description": "A String or Array of hosts that you wish to block traffic for. Please read the notes for examples on using this https://on.cypress.io/configuration#blockHosts" }, "modifyObstructiveCode": { "type": "boolean", diff --git a/packages/desktop-gui/cypress/fixtures/config.json b/packages/desktop-gui/cypress/fixtures/config.json index 9219d5060b3d..5da0c8d3e099 100644 --- a/packages/desktop-gui/cypress/fixtures/config.json +++ b/packages/desktop-gui/cypress/fixtures/config.json @@ -109,7 +109,7 @@ "cypressHostUrl": "http://localhost:2020", "cypressEnv": "development", "env": {}, - "blocklistHosts": [ + "blockHosts": [ "www.google-analytics.com", "hotjar.com" ], @@ -376,7 +376,7 @@ "from": "default", "value": true }, - "blocklistHosts": { + "blockHosts": { "from": "config", "value": [ "www.google-analytics.com", diff --git a/packages/desktop-gui/cypress/integration/settings_spec.js b/packages/desktop-gui/cypress/integration/settings_spec.js index a3c4a54aa681..7f43548f3828 100644 --- a/packages/desktop-gui/cypress/integration/settings_spec.js +++ b/packages/desktop-gui/cypress/integration/settings_spec.js @@ -154,7 +154,7 @@ describe('Settings', () => { cy.get('@config-vars') .contains('span', 'Electron').parent('span').should('have.class', 'plugin') - cy.contains('span', 'blocklistHosts').parents('div').first().find('span').first().click() + cy.contains('span', 'blockHosts').parents('div').first().find('span').first().click() cy.get('@config-vars') .contains('span', 'www.google-analytics.com').parent('span').should('have.class', 'config') @@ -207,8 +207,8 @@ describe('Settings', () => { cy.get('.line').contains('*.foobar.com, *.bazqux.com') }) - it('displays "array" values for blocklistHosts', () => { - cy.contains('.line', 'blocklistHosts').contains('www.google-analytics.com, hotjar.com') + it('displays "array" values for blockHosts', () => { + cy.contains('.line', 'blockHosts').contains('www.google-analytics.com, hotjar.com') }) it('opens help link on click', () => { diff --git a/packages/driver/cypress/integration/commands/agents_spec.js b/packages/driver/cypress/integration/commands/agents_spec.js index 5d804637b76e..bff2ae3ea08f 100644 --- a/packages/driver/cypress/integration/commands/agents_spec.js +++ b/packages/driver/cypress/integration/commands/agents_spec.js @@ -352,11 +352,11 @@ describe('src/cy/commands/agents', () => { }).to.throw('`cy.as()` cannot be passed an empty string.') }) - _.each(['test', 'runnable', 'timeout', 'slow', 'skip', 'inspect'], (blocklist) => { - it(`throws on a blocklisted word: ${blocklist}`, () => { + _.each(['test', 'runnable', 'timeout', 'slow', 'skip', 'inspect'], (reserved) => { + it(`throws on a reserved word: ${reserved}`, () => { expect(() => { - cy.stub().as(blocklist) - }).to.throw(`\`cy.as()\` cannot be aliased as: \`${blocklist}\`. This word is reserved.`) + cy.stub().as(reserved) + }).to.throw(`\`cy.as()\` cannot be aliased as: \`${reserved}\`. This word is reserved.`) }) }) }) @@ -433,11 +433,11 @@ describe('src/cy/commands/agents', () => { }).to.throw('`cy.as()` cannot be passed an empty string.') }) - _.each(['test', 'runnable', 'timeout', 'slow', 'skip', 'inspect'], (blocklist) => { - it(`throws on a blocklisted word: ${blocklist}`, () => { + _.each(['test', 'runnable', 'timeout', 'slow', 'skip', 'inspect'], (reserved) => { + it(`throws on a reserved word: ${reserved}`, () => { expect(() => { - cy.stub().as(blocklist) - }).to.throw(`\`cy.as()\` cannot be aliased as: \`${blocklist}\`. This word is reserved.`) + cy.stub().as(reserved) + }).to.throw(`\`cy.as()\` cannot be aliased as: \`${reserved}\`. This word is reserved.`) }) }) }) diff --git a/packages/driver/cypress/integration/commands/aliasing_spec.js b/packages/driver/cypress/integration/commands/aliasing_spec.js index b3d7a6f7aeeb..db17200a01cf 100644 --- a/packages/driver/cypress/integration/commands/aliasing_spec.js +++ b/packages/driver/cypress/integration/commands/aliasing_spec.js @@ -232,16 +232,16 @@ describe('src/cy/commands/aliasing', () => { cy.get('@my@Alias') }) - _.each(['test', 'runnable', 'timeout', 'slow', 'skip', 'inspect'], (blocklist) => { - it(`throws on a blocklisted word: ${blocklist}`, (done) => { + _.each(['test', 'runnable', 'timeout', 'slow', 'skip', 'inspect'], (reserved) => { + it(`throws on a reserved word: ${reserved}`, (done) => { cy.on('fail', (err) => { - expect(err.message).to.eq(`\`cy.as()\` cannot be aliased as: \`${blocklist}\`. This word is reserved.`) + expect(err.message).to.eq(`\`cy.as()\` cannot be aliased as: \`${reserved}\`. This word is reserved.`) expect(err.docsUrl).to.eq('https://on.cypress.io/as') done() }) - cy.get('div:first').as(blocklist) + cy.get('div:first').as(reserved) }) }) }) diff --git a/packages/driver/src/cy/aliases.js b/packages/driver/src/cy/aliases.js index 5a9aee2f2264..8ba6840f39b3 100644 --- a/packages/driver/src/cy/aliases.js +++ b/packages/driver/src/cy/aliases.js @@ -7,7 +7,7 @@ const aliasRe = /^@.+/ const aliasDisplayRe = /^([@]+)/ const requestXhrRe = /\.request$/ -const blocklist = ['test', 'runnable', 'timeout', 'slow', 'skip', 'inspect'] +const reserved = ['test', 'runnable', 'timeout', 'slow', 'skip', 'inspect'] const aliasDisplayName = (name) => { return name.replace(aliasDisplayRe, '') @@ -39,7 +39,7 @@ const validateAlias = (alias) => { $errUtils.throwErrByPath('as.empty_string') } - if (blocklist.includes(alias)) { + if (reserved.includes(alias)) { return $errUtils.throwErrByPath('as.reserved_word', { args: { alias } }) } } diff --git a/packages/network/README.md b/packages/network/README.md index 58a97e3f80d8..5263862e391a 100644 --- a/packages/network/README.md +++ b/packages/network/README.md @@ -8,7 +8,7 @@ You can see a list of the modules exported from this package in [./lib/index.ts] * `agent` is a HTTP/HTTPS [agent][1] with support for HTTP/HTTPS proxies and keepalive whenever possible * `allowDestroy` can be used to wrap a `net.Server` to add a `.destroy()` method -* `blocklist` is a utility for matching glob blocklists +* `blocked` is a utility for matching blocked globs * `concatStream` is a wrapper around [`concat-stream@1.6.2`][2] that makes it always yield a `Buffer` * `connect` contains utilities for making network connections, including `createRetryingSocket` * `cors` contains utilities for Cross-Origin Resource Sharing diff --git a/packages/network/lib/blocklist.ts b/packages/network/lib/blocked.ts similarity index 71% rename from packages/network/lib/blocklist.ts rename to packages/network/lib/blocked.ts index a36bd75edb88..1e59bbda5b91 100644 --- a/packages/network/lib/blocklist.ts +++ b/packages/network/lib/blocked.ts @@ -2,9 +2,9 @@ import _ from 'lodash' import minimatch from 'minimatch' import { stripProtocolAndDefaultPorts } from './uri' -export function matches (urlToCheck, blocklistHosts) { +export function matches (urlToCheck, blockHosts) { // normalize into flat array - blocklistHosts = [].concat(blocklistHosts) + blockHosts = [].concat(blockHosts) urlToCheck = stripProtocolAndDefaultPorts(urlToCheck) @@ -14,5 +14,5 @@ export function matches (urlToCheck, blocklistHosts) { return minimatch(urlToCheck, hostMatcher) } - return _.find(blocklistHosts, matchUrl) + return _.find(blockHosts, matchUrl) } diff --git a/packages/network/lib/index.ts b/packages/network/lib/index.ts index 6616d9dabd4c..e9064ae0b3ab 100644 --- a/packages/network/lib/index.ts +++ b/packages/network/lib/index.ts @@ -1,12 +1,12 @@ import agent from './agent' -import * as blocklist from './blocklist' +import * as blocked from './blocked' import * as connect from './connect' import * as cors from './cors' import * as uri from './uri' export { agent, - blocklist, + blocked, connect, cors, uri, diff --git a/packages/network/test/unit/blocklist_spec.ts b/packages/network/test/unit/blocked_spec.ts similarity index 87% rename from packages/network/test/unit/blocklist_spec.ts rename to packages/network/test/unit/blocked_spec.ts index e0969085bec5..0e327503d490 100644 --- a/packages/network/test/unit/blocklist_spec.ts +++ b/packages/network/test/unit/blocked_spec.ts @@ -1,4 +1,4 @@ -import { blocklist } from '../..' +import { blocked } from '../..' import { expect } from 'chai' const hosts = [ @@ -10,22 +10,22 @@ const hosts = [ ] const matchesStr = function (url, host, val) { - const m = blocklist.matches(url, host) + const m = blocked.matches(url, host) expect(!!m).to.eq(val, `url: '${url}' did not pass`) } const matchesArray = function (url, val) { - const m = blocklist.matches(url, hosts) + const m = blocked.matches(url, hosts) expect(!!m).to.eq(val, `url: '${url}' did not pass`) } const matchesHost = (url, host) => { - expect(blocklist.matches(url, hosts)).to.eq(host) + expect(blocked.matches(url, hosts)).to.eq(host) } -describe('lib/blocklist', () => { +describe('lib/blocked', () => { it('handles hosts, ports, wildcards', () => { matchesArray('https://mail.google.com/foo', true) matchesArray('https://shop.apple.com/bar', true) diff --git a/packages/proxy/lib/http/request-middleware.ts b/packages/proxy/lib/http/request-middleware.ts index 469f3ebd0659..df3733767c2d 100644 --- a/packages/proxy/lib/http/request-middleware.ts +++ b/packages/proxy/lib/http/request-middleware.ts @@ -1,6 +1,6 @@ import _ from 'lodash' import debugModule from 'debug' -import { blocklist, cors } from '@packages/network' +import { blocked, cors } from '@packages/network' import { HttpMiddleware } from './' export type RequestMiddleware = HttpMiddleware<{ @@ -46,15 +46,15 @@ const RedirectToClientRouteIfNotProxied: RequestMiddleware = function () { this.next() } -const EndRequestsToBlocklistedHosts: RequestMiddleware = function () { - const { blocklistHosts } = this.config +const EndRequestsToBlockedHosts: RequestMiddleware = function () { + const { blockHosts } = this.config - if (blocklistHosts) { - const matches = blocklist.matches(this.req.proxiedUrl, blocklistHosts) + if (blockHosts) { + const matches = blocked.matches(this.req.proxiedUrl, blockHosts) if (matches) { - this.res.set('x-cypress-matched-blocklisted-host', matches) - debug('blocklisting request %o', { + this.res.set('x-cypress-matched-blocked-host', matches) + debug('blocking request %o', { url: this.req.proxiedUrl, matches, }) @@ -150,7 +150,7 @@ export default { LogRequest, RedirectToClientRouteIfUnloaded, RedirectToClientRouteIfNotProxied, - EndRequestsToBlocklistedHosts, + EndRequestsToBlockedHosts, MaybeEndRequestWithBufferedResponse, StripUnsupportedAcceptEncoding, MaybeSetBasicAuthHeaders, diff --git a/packages/proxy/test/unit/http/request-middleware.spec.ts b/packages/proxy/test/unit/http/request-middleware.spec.ts index bd40b3bbafb0..07cd117c8754 100644 --- a/packages/proxy/test/unit/http/request-middleware.spec.ts +++ b/packages/proxy/test/unit/http/request-middleware.spec.ts @@ -8,7 +8,7 @@ describe('http/request-middleware', function () { 'LogRequest', 'RedirectToClientRouteIfUnloaded', 'RedirectToClientRouteIfNotProxied', - 'EndRequestsToBlocklistedHosts', + 'EndRequestsToBlockedHosts', 'MaybeEndRequestWithBufferedResponse', 'StripUnsupportedAcceptEncoding', 'MaybeSetBasicAuthHeaders', diff --git a/packages/server/__snapshots__/1_blocklist_hosts_spec.js b/packages/server/__snapshots__/1_block_hosts_spec.js similarity index 89% rename from packages/server/__snapshots__/1_blocklist_hosts_spec.js rename to packages/server/__snapshots__/1_block_hosts_spec.js index 05cf65313ccb..e96f050822b3 100644 --- a/packages/server/__snapshots__/1_blocklist_hosts_spec.js +++ b/packages/server/__snapshots__/1_block_hosts_spec.js @@ -1,4 +1,4 @@ -exports['e2e blocklist passes 1'] = ` +exports['e2e blockHosts passes 1'] = ` ==================================================================================================== @@ -7,18 +7,18 @@ exports['e2e blocklist passes 1'] = ` ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Cypress: 1.2.3 │ │ Browser: FooBrowser 88 │ - │ Specs: 1 found (blocklist_hosts_spec.coffee) │ - │ Searched: cypress/integration/blocklist_hosts_spec.coffee │ + │ Specs: 1 found (block_hosts_spec.coffee) │ + │ Searched: cypress/integration/block_hosts_spec.coffee │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ──────────────────────────────────────────────────────────────────────────────────────────────────── - Running: blocklist_hosts_spec.coffee (1 of 1) + Running: block_hosts_spec.coffee (1 of 1) - blocklist - ✓ forces blocklisted hosts to return 503 + block hosts + ✓ forces blocked hosts to return 503 1 passing @@ -35,7 +35,7 @@ exports['e2e blocklist passes 1'] = ` │ Screenshots: 0 │ │ Video: false │ │ Duration: X seconds │ - │ Spec Ran: blocklist_hosts_spec.coffee │ + │ Spec Ran: block_hosts_spec.coffee │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ @@ -46,7 +46,7 @@ exports['e2e blocklist passes 1'] = ` Spec Tests Passing Failing Pending Skipped ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ - │ ✔ blocklist_hosts_spec.coffee XX:XX 1 1 - - - │ + │ ✔ block_hosts_spec.coffee XX:XX 1 1 - - - │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ ✔ All specs passed! XX:XX 1 1 - - - diff --git a/packages/server/lib/browsers/firefox.ts b/packages/server/lib/browsers/firefox.ts index ff71136ba9de..f533955839e7 100644 --- a/packages/server/lib/browsers/firefox.ts +++ b/packages/server/lib/browsers/firefox.ts @@ -190,7 +190,7 @@ const defaultPreferences = { // Do not wait for the notification button security delay 'security.notification_enable_delay': 0, - // Ensure blocklist updates do not hit the network + // Ensure blocked updates do not hit the network 'services.settings.server': '', // Do not automatically fill sign-in forms with known usernames and diff --git a/packages/server/lib/config.js b/packages/server/lib/config.js index 0d07a19b30c9..61c9f280de61 100644 --- a/packages/server/lib/config.js +++ b/packages/server/lib/config.js @@ -57,7 +57,7 @@ folders.push('componentFolder') const configKeys = toWords(`\ animationDistanceThreshold fileServerFolder baseUrl fixturesFolder -blocklistHosts +blockHosts chromeWebSecurity modifyObstructiveCode integrationFolder env pluginsFile @@ -120,7 +120,7 @@ const CONFIG_DEFAULTS = { isTextTerminal: false, reporter: 'spec', reporterOptions: null, - blocklistHosts: null, + blockHosts: null, clientRoute: '/__/', xhrRoute: '/xhrs/', socketIoRoute: '/__socket.io', @@ -177,7 +177,7 @@ const CONFIG_DEFAULTS = { const validationRules = { animationDistanceThreshold: v.isNumber, baseUrl: v.isFullyQualifiedUrl, - blocklistHosts: v.isStringOrArrayOfStrings, + blockHosts: v.isStringOrArrayOfStrings, browsers: v.isValidBrowserList, chromeWebSecurity: v.isBoolean, configFile: v.isStringOrFalse, @@ -245,7 +245,7 @@ const validateNoBreakingConfig = (cfg) => { case 'videoRecording': return errors.throw('RENAMED_CONFIG_OPTION', key, 'video') case 'blacklistHosts': - return errors.throw('RENAMED_CONFIG_OPTION', key, 'blocklistHosts') + return errors.throw('RENAMED_CONFIG_OPTION', key, 'blockHosts') default: } } diff --git a/packages/server/lib/server.js b/packages/server/lib/server.js index 24b633c79383..f76be937ecb6 100644 --- a/packages/server/lib/server.js +++ b/packages/server/lib/server.js @@ -15,7 +15,7 @@ const compression = require('compression') const debug = require('debug')('cypress:server:server') const { agent, - blocklist, + blocked, concatStream, cors, uri, @@ -240,7 +240,7 @@ class Server { createServer (app, config, project, request, onWarning) { return new Promise((resolve, reject) => { - const { port, fileServerFolder, socketIoRoute, baseUrl, blocklistHosts } = config + const { port, fileServerFolder, socketIoRoute, baseUrl, blockHosts } = config this._server = http.createServer(app) @@ -293,17 +293,17 @@ class Server { // if we are currently matching then we're // not making a direct connection anyway // so we only need to check this if we - // have blocklist hosts and are not matching. + // have blocked hosts and are not matching. // - // if we have blocklisted hosts lets + // if we have blocked hosts lets // see if this matches - if so then // we cannot allow it to make a direct // connection - if (blocklistHosts && !isMatching) { - isMatching = blocklist.matches(urlToCheck, blocklistHosts) + if (blockHosts && !isMatching) { + isMatching = blocked.matches(urlToCheck, blockHosts) - debug(`HTTPS request ${urlToCheck} matches blocklist?`, isMatching) + debug(`HTTPS request ${urlToCheck} matches blockHosts?`, isMatching) } // make a direct connection only if diff --git a/packages/server/test/e2e/1_blocklist_hosts_spec.js b/packages/server/test/e2e/1_block_hosts_spec.js similarity index 84% rename from packages/server/test/e2e/1_blocklist_hosts_spec.js rename to packages/server/test/e2e/1_block_hosts_spec.js index 68a8b450acff..946f656ff6b1 100644 --- a/packages/server/test/e2e/1_blocklist_hosts_spec.js +++ b/packages/server/test/e2e/1_block_hosts_spec.js @@ -14,7 +14,7 @@ const onServer = function (app) { }) } -describe('e2e blocklist', () => { +describe('e2e blockHosts', () => { e2e.setup({ servers: [{ port: 3131, @@ -25,14 +25,14 @@ describe('e2e blocklist', () => { }], settings: { baseUrl: 'http://localhost:3232', - blocklistHosts: 'localhost:3131', + blockHosts: 'localhost:3131', video: false, }, }) it('passes', function () { return e2e.exec(this, { - spec: 'blocklist_hosts_spec.coffee', + spec: 'block_hosts_spec.coffee', snapshot: true, }) }) diff --git a/packages/server/test/integration/cypress_spec.js b/packages/server/test/integration/cypress_spec.js index 1fb91faceefa..762541c514be 100644 --- a/packages/server/test/integration/cypress_spec.js +++ b/packages/server/test/integration/cypress_spec.js @@ -900,7 +900,7 @@ describe('lib/cypress', () => { }, { old: 'blacklistHosts', - new: 'blocklistHosts', + new: 'blockHosts', }, ] diff --git a/packages/server/test/integration/http_requests_spec.js b/packages/server/test/integration/http_requests_spec.js index 5432d3981908..501aaaafe979 100644 --- a/packages/server/test/integration/http_requests_spec.js +++ b/packages/server/test/integration/http_requests_spec.js @@ -3727,11 +3727,11 @@ describe('Routes', () => { }) }) - context('blocklisted hosts', () => { + context('blocked hosts', () => { beforeEach(function () { return this.setup({ config: { - blocklistHosts: [ + blockHosts: [ '*.google.com', 'shop.apple.com', 'cypress.io', @@ -3744,7 +3744,7 @@ describe('Routes', () => { it('returns 503 and custom headers for all hosts', function () { const expectedHeader = (res, val) => { - expect(res.headers['x-cypress-matched-blocklisted-host']).to.eq(val) + expect(res.headers['x-cypress-matched-blocked-host']).to.eq(val) } return Promise.all([ diff --git a/packages/server/test/support/fixtures/projects/e2e/cypress/integration/blocklist_hosts_spec.coffee b/packages/server/test/support/fixtures/projects/e2e/cypress/integration/block_hosts_spec.coffee similarity index 91% rename from packages/server/test/support/fixtures/projects/e2e/cypress/integration/blocklist_hosts_spec.coffee rename to packages/server/test/support/fixtures/projects/e2e/cypress/integration/block_hosts_spec.coffee index 864ab0c8f6a6..16ee8ecc9552 100644 --- a/packages/server/test/support/fixtures/projects/e2e/cypress/integration/blocklist_hosts_spec.coffee +++ b/packages/server/test/support/fixtures/projects/e2e/cypress/integration/block_hosts_spec.coffee @@ -1,5 +1,5 @@ -describe "blocklist", -> - it "forces blocklisted hosts to return 503", -> +describe "block hosts", -> + it "forces blocked hosts to return 503", -> cy .visit("http://localhost:3232") diff --git a/packages/server/test/unit/args_spec.js b/packages/server/test/unit/args_spec.js index 2815354de1d0..0defa0c5742b 100644 --- a/packages/server/test/unit/args_spec.js +++ b/packages/server/test/unit/args_spec.js @@ -198,7 +198,7 @@ describe('lib/util/args', () => { const config = { pageLoadTimeout: 10000, waitForAnimations: false, - blocklistHosts: ['one.com', 'www.two.io'], + blockHosts: ['one.com', 'www.two.io'], hosts: { 'foobar.com': '127.0.0.1', }, @@ -211,7 +211,7 @@ describe('lib/util/args', () => { // as mixed usage const hosts = JSON.stringify(config.hosts) - const blocklistHosts = JSON.stringify(config.blocklistHosts) + const blockHosts = JSON.stringify(config.blockHosts) options = this.setup( '--config', @@ -219,7 +219,7 @@ describe('lib/util/args', () => { 'pageLoadTimeout=10000', 'waitForAnimations=false', `hosts=${hosts}`, - `blocklistHosts=${blocklistHosts}`, + `blockHosts=${blockHosts}`, ].join(','), ) @@ -276,7 +276,7 @@ describe('lib/util/args', () => { context('.toObject', () => { beforeEach(function () { this.hosts = { a: 'b', b: 'c' } - this.blocklistHosts = ['a.com', 'b.com'] + this.blockHosts = ['a.com', 'b.com'] this.specs = [ path.join(cwd, 'foo'), path.join(cwd, 'bar'), @@ -293,7 +293,7 @@ describe('lib/util/args', () => { env: this.env, hosts: this.hosts, requestTimeout: 1234, - blocklistHosts: this.blocklistHosts, + blockHosts: this.blockHosts, reporterOptions: { foo: 'bar', }, @@ -307,7 +307,7 @@ describe('lib/util/args', () => { '--get-key', '--env=foo=bar,baz=quux,bar=foo=quz', '--config', - `requestTimeout=1234,blocklistHosts=${s(this.blocklistHosts)},hosts=${s(this.hosts)}`, + `requestTimeout=1234,blockHosts=${s(this.blockHosts)},hosts=${s(this.hosts)}`, '--reporter-options=foo=bar', '--spec=foo,bar,baz', ) @@ -334,7 +334,7 @@ describe('lib/util/args', () => { it('can transpose back to an array', function () { const mergedConfig = JSON.stringify({ requestTimeout: this.config.requestTimeout, - blocklistHosts: this.blocklistHosts, + blockHosts: this.blockHosts, hosts: this.hosts, env: this.env, reporterOptions: { diff --git a/packages/server/test/unit/config_spec.js b/packages/server/test/unit/config_spec.js index 2ca10bc7e071..85ef9a74870c 100644 --- a/packages/server/test/unit/config_spec.js +++ b/packages/server/test/unit/config_spec.js @@ -649,27 +649,27 @@ describe('lib/config', () => { }) }) - context('blocklistHosts', () => { + context('blockHosts', () => { it('passes if a string', function () { - this.setup({ blocklistHosts: 'google.com' }) + this.setup({ blockHosts: 'google.com' }) return this.expectValidationPasses() }) it('passes if an array of strings', function () { - this.setup({ blocklistHosts: ['google.com'] }) + this.setup({ blockHosts: ['google.com'] }) return this.expectValidationPasses() }) it('fails if not a string or array', function () { - this.setup({ blocklistHosts: 5 }) + this.setup({ blockHosts: 5 }) return this.expectValidationFails('be a string or an array of strings') }) it('fails if not an array of strings', function () { - this.setup({ blocklistHosts: [5] }) + this.setup({ blockHosts: [5] }) this.expectValidationFails('be a string or an array of strings') return this.expectValidationFails('the value was: `[5]`') @@ -717,8 +717,8 @@ describe('lib/config', () => { } }) - it('includes blocklistHosts', function () { - return this.includes('blocklistHosts') + it('includes blockHosts', function () { + return this.includes('blockHosts') }) }) @@ -957,19 +957,19 @@ describe('lib/config', () => { return this.defaults('supportFile', false, { supportFile: false }) }) - it('blocklistHosts=null', function () { - return this.defaults('blocklistHosts', null) + it('blockHosts=null', function () { + return this.defaults('blockHosts', null) }) - it('blocklistHosts=[a,b]', function () { - return this.defaults('blocklistHosts', ['a', 'b'], { - blocklistHosts: ['a', 'b'], + it('blockHosts=[a,b]', function () { + return this.defaults('blockHosts', ['a', 'b'], { + blockHosts: ['a', 'b'], }) }) - it('blocklistHosts=a|b', function () { - return this.defaults('blocklistHosts', ['a', 'b'], { - blocklistHosts: ['a', 'b'], + it('blockHosts=a|b', function () { + return this.defaults('blockHosts', ['a', 'b'], { + blockHosts: ['a', 'b'], }) }) @@ -1097,7 +1097,7 @@ describe('lib/config', () => { projectId: { value: null, from: 'default' }, port: { value: 1234, from: 'cli' }, hosts: { value: null, from: 'default' }, - blocklistHosts: { value: null, from: 'default' }, + blockHosts: { value: null, from: 'default' }, browsers: { value: [], from: 'default' }, userAgent: { value: null, from: 'default' }, reporter: { value: 'json', from: 'cli' }, @@ -1173,7 +1173,7 @@ describe('lib/config', () => { projectId: { value: 'projectId123', from: 'env' }, port: { value: 2020, from: 'config' }, hosts: { value: null, from: 'default' }, - blocklistHosts: { value: null, from: 'default' }, + blockHosts: { value: null, from: 'default' }, browsers: { value: [], from: 'default' }, userAgent: { value: null, from: 'default' }, reporter: { value: 'spec', from: 'default' }, From d7af362e8ceac3c118358969459b7eea3c9a8fdc Mon Sep 17 00:00:00 2001 From: Brian Mann Date: Fri, 10 Jul 2020 16:22:25 -0400 Subject: [PATCH 10/12] skip running external project job because this is an external PR without access to env vars --- circle.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/circle.yml b/circle.yml index 6fc1db5536f9..83484c74992b 100644 --- a/circle.yml +++ b/circle.yml @@ -1589,6 +1589,11 @@ linux-workflow: &linux-workflow - test-kitchensink: requires: - build + filters: + branches: + ignore: + ## TODO: remove this upon merging the PR + - rename-blacklisthosts - test-kitchensink-against-staging: context: test-runner:record-tests filters: @@ -1639,6 +1644,11 @@ linux-workflow: &linux-workflow requires: - build-binary - build-npm-package + filters: + branches: + ignore: + ## TODO: remove this upon merging the PR + - rename-blacklisthosts - test-binary-against-recipe-pull-request: name: Test fetch polyfill filters: From ff75384323471f50fad8c5fd064ad1dbb02b7b6b Mon Sep 17 00:00:00 2001 From: Brian Mann Date: Sat, 11 Jul 2020 19:40:33 -0400 Subject: [PATCH 11/12] add correct branch to ignore --- circle.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/circle.yml b/circle.yml index e9c9ce435312..64740734f74e 100644 --- a/circle.yml +++ b/circle.yml @@ -1595,6 +1595,7 @@ linux-workflow: &linux-workflow ignore: ## TODO: remove this upon merging the PR - rename-blacklisthosts + - pull/7622 - test-kitchensink-against-staging: context: test-runner:record-tests filters: @@ -1650,6 +1651,7 @@ linux-workflow: &linux-workflow ignore: ## TODO: remove this upon merging the PR - rename-blacklisthosts + - pull/7622 - test-binary-against-recipe-pull-request: name: Test TypeScript recipe filters: From 5cbf5c077da5709bab238585a6a58351c3158619 Mon Sep 17 00:00:00 2001 From: Brian Mann Date: Mon, 13 Jul 2020 01:43:59 -0400 Subject: [PATCH 12/12] go github go