Skip to content

Commit

Permalink
Merge branch 'develop' into remove-storing-artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
tgriesser authored Apr 8, 2022
2 parents 2f933fe + b031803 commit e0aa5e9
Show file tree
Hide file tree
Showing 80 changed files with 4,091 additions and 2,623 deletions.
4 changes: 2 additions & 2 deletions browser-versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"chrome:beta": "100.0.4896.30",
"chrome:stable": "99.0.4844.74"
"chrome:beta": "101.0.4951.15",
"chrome:stable": "100.0.4896.75"
}
72 changes: 43 additions & 29 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mainBuildFilters: &mainBuildFilters
only:
- develop
- 10.0-release
- fix-beta-build-caching
- unify-1449-beta-slug-length

# usually we don't build Mac app - it takes a long time
# but sometimes we want to really confirm we are doing the right thing
Expand All @@ -38,7 +38,7 @@ macWorkflowFilters: &mac-workflow-filters
when:
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ fix-beta-build-caching, << pipeline.git.branch >> ]
- equal: [ unify-1449-beta-slug-length, << pipeline.git.branch >> ]
- matches:
pattern: "-release$"
value: << pipeline.git.branch >>
Expand All @@ -48,7 +48,7 @@ windowsWorkflowFilters: &windows-workflow-filters
or:
- equal: [ master, << pipeline.git.branch >> ]
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ fix-beta-build-caching, << pipeline.git.branch >> ]
- equal: [ unify-1449-beta-slug-length, << pipeline.git.branch >> ]
- matches:
pattern: "-release$"
value: << pipeline.git.branch >>
Expand Down Expand Up @@ -418,9 +418,9 @@ commands:
echo Current working directory is $PWD
echo Total containers $CIRCLE_NODE_TOTAL
if [[ -v PACKAGES_RECORD_KEY ]]; then
if [[ -v MAIN_RECORD_KEY ]]; then
# internal PR
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
yarn cypress:run --record --parallel --group 5x-driver-<<parameters.browser>> --browser <<parameters.browser>>
else
# external PR
Expand Down Expand Up @@ -455,7 +455,7 @@ commands:
command: |
cmd=$([[ <<parameters.percy>> == 'true' ]] && echo 'yarn percy exec --parallel -- --') || true
CYPRESS_KONFIG_ENV=production \
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \
PERCY_ENABLE=${PERCY_TOKEN:-0} \
PERCY_PARALLEL_TOTAL=-1 \
Expand Down Expand Up @@ -1302,7 +1302,7 @@ jobs:
- run:
command: |
CYPRESS_KONFIG_ENV=production \
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \
PERCY_ENABLE=${PERCY_TOKEN:-0} \
PERCY_PARALLEL_TOTAL=-1 \
Expand Down Expand Up @@ -1347,7 +1347,7 @@ jobs:
- run:
command: |
CYPRESS_KONFIG_ENV=production \
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \
PERCY_ENABLE=${PERCY_TOKEN:-0} \
PERCY_PARALLEL_TOTAL=-1 \
Expand All @@ -1371,7 +1371,7 @@ jobs:
- run:
command: |
CYPRESS_KONFIG_ENV=production \
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
yarn cypress:run --record --parallel --group ui-components
working_directory: packages/ui-components
- verify-mocha-results
Expand Down Expand Up @@ -1559,25 +1559,25 @@ jobs:
command: yarn workspace @cypress/eslint-plugin-dev test

npm-cypress-schematic:
<<: *defaults
steps:
- restore_cached_workspace
- run:
name: Build + Install
command: |
yarn workspace @cypress/schematic build:all
working_directory: npm/cypress-schematic
- run:
name: Launch
command: |
yarn launch:test
working_directory: npm/cypress-schematic
- run:
name: Run unit tests
command: |
yarn test
working_directory: npm/cypress-schematic
- store-npm-logs
<<: *defaults
steps:
- restore_cached_workspace
- run:
name: Build + Install
command: |
yarn workspace @cypress/schematic build:all
working_directory: npm/cypress-schematic
- run:
name: Launch
command: |
yarn launch:test
working_directory: npm/cypress-schematic
- run:
name: Run unit tests
command: |
yarn test
working_directory: npm/cypress-schematic
- store-npm-logs

npm-release:
<<: *defaults
Expand All @@ -1604,7 +1604,7 @@ jobs:
- run:
name: Check current branch to persist artifacts
command: |
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "fix-beta-build-caching" ]]; then
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "unify-1449-beta-slug-length" ]]; then
echo "Not uploading artifacts or posting install comment for this branch."
circleci-agent step halt
fi
Expand Down Expand Up @@ -2027,6 +2027,7 @@ linux-workflow: &linux-workflow
- build
# unit, integration and e2e tests
- cli-visual-tests:
context: test-runner:percy
requires:
- build
- unit-tests:
Expand Down Expand Up @@ -2067,39 +2068,51 @@ linux-workflow: &linux-workflow
requires:
- system-tests-node-modules-install
- driver-integration-tests-chrome:
context: test-runner:cypress-record-key
requires:
- build
- driver-integration-tests-chrome-beta:
context: test-runner:cypress-record-key
requires:
- build
- driver-integration-tests-firefox:
context: test-runner:cypress-record-key
requires:
- build
- driver-integration-tests-electron:
context: test-runner:cypress-record-key
requires:
- build
- runner-integration-tests-chrome:
context: [test-runner:cypress-record-key, test-runner:percy]
requires:
- build
- runner-integration-tests-firefox:
context: [test-runner:cypress-record-key, test-runner:percy]
requires:
- build
- runner-integration-tests-electron:
context: [test-runner:cypress-record-key, test-runner:percy]
requires:
- build
- runner-ct-integration-tests-chrome:
context: test-runner:percy
requires:
- build
- desktop-gui-integration-tests-7x:
context: [test-runner:cypress-record-key, test-runner:percy]
requires:
- build
- desktop-gui-component-tests:
context: test-runner:percy
requires:
- build
- reporter-integration-tests:
context: [test-runner:cypress-record-key, test-runner:percy]
requires:
- build
- ui-components-integration-tests:
context: test-runner:cypress-record-key
requires:
- build
- npm-webpack-dev-server:
Expand All @@ -2115,6 +2128,7 @@ linux-workflow: &linux-workflow
requires:
- build
- npm-design-system:
context: test-runner:percy
requires:
- build
- npm-vue:
Expand Down
12 changes: 12 additions & 0 deletions cli/__snapshots__/download_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,15 @@ https://download.cypress.io/desktop/0.20.2?platform=OS&arch=ARCH
exports['desktop url from template'] = `
https://download.cypress.io/desktop/0.20.2/darwin-x64/cypress.zip
`

exports['desktop url from template with escaped dollar sign'] = `
https://download.cypress.io/desktop/0.20.2/darwin-x64/cypress.zip
`

exports['desktop url from template wrapped in quote'] = `
https://download.cypress.io/desktop/0.20.2/darwin-x64/cypress.zip
`

exports['desktop url from template with escaped dollar sign wrapped in quote'] = `
https://download.cypress.io/desktop/0.20.2/darwin-x64/cypress.zip
`
4 changes: 2 additions & 2 deletions cli/__snapshots__/install_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,11 @@ exports['/lib/tasks/install .start non-stable builds logs a warning about instal
Bugs may be present which do not exist in production builds.
This build was created from:
* Commit SHA: abc123
* Commit SHA: 3b7f0b5c59def1e9b5f385bd585c9b2836706c29
* Commit Branch: aBranchName
* Commit Timestamp: 1996-11-27Txx:xx:xx.000Z
Installing Cypress (version: https://cdn.cypress.io/beta/binary/0.0.0-development/darwin-x64/aBranchName-abc123/cypress.zip)
Installing Cypress (version: https://cdn.cypress.io/beta/binary/0.0.0-development/darwin-x64/aBranchName-3b7f0b5c59def1e9b5f385bd585c9b2836706c29/cypress.zip)
⠋ Downloaded Cypress
Expand Down
16 changes: 15 additions & 1 deletion cli/lib/exec/spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,21 @@ const isXlibOrLibudevRe = /^(?:Xlib|libudev)/
const isHighSierraWarningRe = /\*\*\* WARNING/
const isRenderWorkerRe = /\.RenderWorker-/

const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe, isRenderWorkerRe]
// Chromium (which Electron uses) always makes several attempts to connect to the system dbus.
// This works fine in most desktop environments, but in a docker container, there is no dbus service
// and Chromium emits several error lines, similar to these:

// [1957:0406/160550.146820:ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
// [1957:0406/160550.147994:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon

// These warnings are absolutely harmless. Failure to connect to dbus means that electron won't be able to access the user's
// credential wallet (none exists in a docker container) and won't show up in the system tray (again, none exists).
// Failure to connect is expected and normal here, but users frequently misidentify these errors as the cause of their problems.

// https://github.com/cypress-io/cypress/issues/19299
const isDbusWarning = /Failed to connect to the bus:/

const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe, isRenderWorkerRe, isDbusWarning]

const isGarbageLineWarning = (str) => {
return _.some(GARBAGE_WARNINGS, (re) => {
Expand Down
9 changes: 7 additions & 2 deletions cli/lib/tasks/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,15 @@ const getCA = () => {
const prepend = (urlPath) => {
const endpoint = url.resolve(getBaseUrl(), urlPath)
const platform = os.platform()
const pathTemplate = util.getEnv('CYPRESS_DOWNLOAD_PATH_TEMPLATE')
const pathTemplate = util.getEnv('CYPRESS_DOWNLOAD_PATH_TEMPLATE', true)

return pathTemplate
? pathTemplate.replace('${endpoint}', endpoint).replace('${platform}', platform).replace('${arch}', arch())
? (
pathTemplate
.replace(/\\?\$\{endpoint\}/, endpoint)
.replace(/\\?\$\{platform\}/, platform)
.replace(/\\?\$\{arch\}/, arch())
)
: `${endpoint}?platform=${platform}&arch=${arch()}`
}

Expand Down
2 changes: 1 addition & 1 deletion cli/lib/tasks/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const getBinaryDir = (version = util.pkgVersion()) => {

const getVersionDir = (version = util.pkgVersion(), buildInfo = util.pkgBuildInfo()) => {
if (buildInfo && !buildInfo.stable) {
version = ['beta', version, buildInfo.commitBranch, buildInfo.commitSha].join('-')
version = ['beta', version, buildInfo.commitBranch, buildInfo.commitSha.slice(0, 8)].join('-')
}

return path.join(getCacheDir(), version)
Expand Down
2 changes: 1 addition & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"listr2": "^3.8.3",
"lodash": "^4.17.21",
"log-symbols": "^4.0.0",
"minimist": "^1.2.5",
"minimist": "^1.2.6",
"ospath": "^1.2.2",
"pretty-bytes": "^5.6.0",
"proxy-from-env": "1.0.0",
Expand Down
3 changes: 3 additions & 0 deletions cli/test/lib/exec/spawn_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ describe('lib/exec/spawn', function () {
[46454:0702/140217.292555:ERROR:gles2_cmd_decoder.cc(4439)] [.RenderWorker-0x7f8bc5815a00.GpuRasterization]GL ERROR :GL_INVALID_FRAMEBUFFER_OPERATION : glDrawElements: framebuffer incomplete
[46454:0702/140217.292584:ERROR:gles2_cmd_decoder.cc(4439)] [.RenderWorker-0x7f8bc5815a00.GpuRasterization]GL ERROR :GL_INVALID_FRAMEBUFFER_OPERATION : glClear: framebuffer incomplete
[46454:0702/140217.292612:ERROR:gles2_cmd_decoder.cc(4439)] [.RenderWorker-0x7f8bc5815a00.GpuRasterization]GL ERROR :GL_INVALID_FRAMEBUFFER_OPERATION : glDrawElements: framebuffer incomplete'
[1957:0406/160550.146820:ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[1957:0406/160550.147994:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
`

const lines = _
Expand Down
21 changes: 21 additions & 0 deletions cli/test/lib/tasks/download_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,27 @@ describe('lib/tasks/download', function () {
snapshot('desktop url from template', normalize(url))
})

it('returns custom url from template with escaped dollar sign', () => {
process.env.CYPRESS_DOWNLOAD_PATH_TEMPLATE = '\\${endpoint}/\\${platform}-\\${arch}/cypress.zip'
const url = download.getUrl('0.20.2')

snapshot('desktop url from template with escaped dollar sign', normalize(url))
})

it('returns custom url from template wrapped in quote', () => {
process.env.CYPRESS_DOWNLOAD_PATH_TEMPLATE = '"${endpoint}/${platform}-${arch}/cypress.zip"'
const url = download.getUrl('0.20.2')

snapshot('desktop url from template wrapped in quote', normalize(url))
})

it('returns custom url from template with escaped dollar sign wrapped in quote', () => {
process.env.CYPRESS_DOWNLOAD_PATH_TEMPLATE = '"\\${endpoint}/\\${platform}-\\${arch}/cypress.zip"'
const url = download.getUrl('0.20.2')

snapshot('desktop url from template with escaped dollar sign wrapped in quote', normalize(url))
})

it('returns input if it is already an https link', () => {
const url = 'https://somewhere.com'
const result = download.getUrl(url)
Expand Down
24 changes: 15 additions & 9 deletions cli/test/lib/tasks/install_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,29 +74,35 @@ describe('/lib/tasks/install', function () {
})

describe('non-stable builds', () => {
const buildInfo = {
stable: false,
commitSha: '3b7f0b5c59def1e9b5f385bd585c9b2836706c29',
commitBranch: 'aBranchName',
commitDate: new Date('11-27-1996').toISOString(),
}

function runInstall () {
return install.start({
buildInfo: {
stable: false,
commitSha: 'abc123',
commitBranch: 'aBranchName',
commitDate: new Date('11-27-1996').toISOString(),
},
})
return install.start({ buildInfo })
}

it('install from a constructed CDN URL', async function () {
await runInstall()

expect(download.start).to.be.calledWithMatch({
version: 'https://cdn.cypress.io/beta/binary/0.0.0-development/darwin-x64/aBranchName-abc123/cypress.zip',
version: 'https://cdn.cypress.io/beta/binary/0.0.0-development/darwin-x64/aBranchName-3b7f0b5c59def1e9b5f385bd585c9b2836706c29/cypress.zip',
})
})

it('logs a warning about installing a pre-release', async function () {
await runInstall()
snapshot(normalize(this.stdout.toString()))
})

it('installs to the expected pre-release cache dir', async function () {
state.getVersionDir.restore()
await runInstall()
expect(unzip.start).to.be.calledWithMatch({ installDir: sinon.match(/\/Cypress\/beta\-1\.2\.3\-aBranchName\-3b7f0b5c$/) })
})
})

describe('override version', function () {
Expand Down
2 changes: 1 addition & 1 deletion cli/types/cypress-eventemitter.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ interface NodeEventEmitter {

// We use the Buffer class for dealing with binary data, especially around the
// selectFile interface.
type BufferType = import("buffer/").Buffer
type BufferType = typeof import("buffer/").Buffer
3 changes: 2 additions & 1 deletion cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2341,7 +2341,7 @@ declare namespace Cypress {
type Agent<T extends sinon.SinonSpy> = SinonSpyAgent<T> & T

interface CookieDefaults {
preserve: string | string[] | RegExp | ((cookie: any) => boolean)
preserve: string | string[] | RegExp | ((cookie: Cookie) => boolean)
}

interface Failable {
Expand Down Expand Up @@ -5712,6 +5712,7 @@ declare namespace Cypress {
name: string
/** Override *name* for display purposes only */
displayName: string
/** additional information to include in the log */
message: any
/** Set to false if you want to control the finishing of the command in the log yourself */
autoEnd: boolean
Expand Down
Loading

0 comments on commit e0aa5e9

Please sign in to comment.