Skip to content

Commit

Permalink
Merge branch 'develop' into lerna-optimize-tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
dkasper-was-taken authored Oct 3, 2023
2 parents 6dd0045 + c573160 commit dfec4ad
Show file tree
Hide file tree
Showing 12 changed files with 223 additions and 250 deletions.
2 changes: 1 addition & 1 deletion .circleci/cache-version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Bump this version to force CI to re-create the cache from scratch.

09-3-23
09-22-23
20 changes: 0 additions & 20 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1061,25 +1061,6 @@ commands:
name: "Waiting on Circle CI jobs: <<parameters.job-names>>"
command: node ./scripts/wait-on-circle-jobs.js --job-names="<<parameters.job-names>>"

build-binary:
steps:
- run:
name: Build the Cypress binary
no_output_timeout: "45m"
command: |
source ./scripts/ensure-node.sh
node --version
if [[ `node ./scripts/get-platform-key.js` == 'linux-arm64' ]]; then
# these are missing on Circle and there is no way to pre-install them on Arm
sudo apt-get update
sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
DISABLE_SNAPSHOT_REQUIRE=1 yarn binary-build --version $(node ./scripts/get-next-version.js) --createTar
else
yarn binary-build --version $(node ./scripts/get-next-version.js) --createTar
fi
- store_artifacts:
path: cypress-dist.tgz

check-if-binary-exists:
steps:
- run:
Expand Down Expand Up @@ -2105,7 +2086,6 @@ jobs:
- restore_cached_workspace
- check-if-binary-exists
- setup_should_persist_artifacts
- build-binary
- trigger-publish-binary-pipeline

get-published-artifacts:
Expand Down
1 change: 1 addition & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ _Released 10/03/2023 (PENDING)_

- Fixed an issue where requests were correlated in the wrong order in the proxy. This could cause an issue where the wrong request is used for `cy.intercept` or assets (e.g. stylesheets or images) may not properly be available in Test Replay. Addressed in [#27892](https://github.com/cypress-io/cypress/pull/27892).
- Fixed an issue where a crashed Chrome renderer can cause the Test Replay recorder to hang. Addressed in [#27909](https://github.com/cypress-io/cypress/pull/27909).
- Fixed an issue where multiple responses yielded from calls to `cy.wait()` would sometimes be out of order. Fixes [#27337](https://github.com/cypress-io/cypress/issues/27337).

## 13.3.0

Expand Down
71 changes: 71 additions & 0 deletions packages/driver/cypress/e2e/commands/waiting.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,77 @@ describe('src/cy/commands/waiting', () => {
expect(xhr2.response.body).to.deep.eq(resp2)
})
})

it('all responses returned in correct order - unique aliases', () => {
const resp1 = { value: 'alpha' }
const resp2 = { value: 'beta' }
const resp3 = { value: 'gamma' }
const resp4 = { value: 'delta' }
const resp5 = { value: 'epsilon' }

cy.intercept(/alpha/, resp1).as('getAlpha')
cy.intercept(/beta/, resp2).as('getBeta')
cy.intercept(/gamma/, resp3).as('getGamma')
cy.intercept(/delta/, resp4).as('getDelta')
cy.intercept(/epsilon/, resp5).as('getEpsilon')

cy.window().then((win) => {
xhrGet(win, '/epsilon')
xhrGet(win, '/beta')
xhrGet(win, '/gamma')
xhrGet(win, '/delta')
xhrGet(win, '/alpha')

return null
})

cy.wait(['@getAlpha', '@getBeta', '@getGamma', '@getDelta', '@getEpsilon']).then((responses) => {
expect(responses[0]?.response?.body.value).to.eq('alpha')
expect(responses[1]?.response?.body.value).to.eq('beta')
expect(responses[2]?.response?.body.value).to.eq('gamma')
expect(responses[3]?.response?.body.value).to.eq('delta')
expect(responses[4]?.response?.body.value).to.eq('epsilon')
})
})

it('all responses returned in correct order - duplicate aliases', () => {
let alphaCount = 0
let betaCount = 0
let gammaCount = 0

cy.intercept(/alpha/, (req) => {
req.reply({ value: `alpha-${alphaCount}` })
alphaCount++
}).as('getAlpha')

cy.intercept(/beta/, (req) => {
req.reply({ value: `beta-${betaCount}` })
betaCount++
}).as('getBeta')

cy.intercept(/gamma/, (req) => {
req.reply({ value: `gamma-${gammaCount}` })
gammaCount++
}).as('getGamma')

cy.window().then((win) => {
xhrGet(win, '/alpha')
xhrGet(win, '/beta')
xhrGet(win, '/gamma')
xhrGet(win, '/alpha')
xhrGet(win, '/gamma')

return null
})

cy.wait(['@getGamma', '@getBeta', '@getGamma', '@getAlpha', '@getAlpha']).then((responses) => {
expect(responses[0]?.response?.body.value).to.eq('gamma-0')
expect(responses[1]?.response?.body.value).to.eq('beta-0')
expect(responses[2]?.response?.body.value).to.eq('gamma-1')
expect(responses[3]?.response?.body.value).to.eq('alpha-0')
expect(responses[4]?.response?.body.value).to.eq('alpha-1')
})
})
})

describe('multiple separate alias waits', () => {
Expand Down
19 changes: 18 additions & 1 deletion packages/driver/src/cy/commands/waiting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,24 @@ export default (Commands, Cypress, cy, state) => {
.then((responses) => {
// if we only asked to wait for one alias
// then return that, else return the array of xhr responses
const ret = responses.length === 1 ? responses[0] : responses
const ret = responses.length === 1 ? responses[0] : ((resp) => {
const respMap = new Map()
const respSeq = resp.map((r) => r.routeId)

// responses are sorted in the order the user specified them. if there are multiples of the same
// alias awaited, they're sorted in execution order
resp.sort((a, b) => {
// sort responses based on browser request ID
const requestIdSuffixA = a.browserRequestId.split('.').length > 1 ? a.browserRequestId.split('.')[1] : a.browserRequestId
const requestIdSuffixB = b.browserRequestId.split('.').length > 1 ? b.browserRequestId.split('.')[1] : b.browserRequestId

return parseInt(requestIdSuffixA) < parseInt(requestIdSuffixB) ? -1 : 1
}).forEach((r) => {
respMap.get(r.routeId)?.push(r) ?? respMap.set(r.routeId, [r])
})

return respSeq.map((routeId) => respMap.get(routeId)?.shift())
})(responses)

if (log) {
log.set('consoleProps', () => {
Expand Down
10 changes: 1 addition & 9 deletions scripts/binary/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import electron from '../../packages/electron'
import la from 'lazy-ass'
import { promisify } from 'util'
import glob from 'glob'
import tar from 'tar'

import * as packages from './util/packages'
import * as meta from './meta'
Expand Down Expand Up @@ -40,7 +39,6 @@ interface BuildCypressAppOpts {
version: string
skipSigning?: boolean
keepBuild?: boolean
createTar?: boolean
}

/**
Expand Down Expand Up @@ -78,7 +76,7 @@ async function checkMaxPathLength () {
// For debugging the flow without rebuilding each time

export async function buildCypressApp (options: BuildCypressAppOpts) {
const { platform, version, keepBuild = false, createTar } = options
const { platform, version, keepBuild = false } = options

log('#checkPlatform')
if (platform !== os.platform()) {
Expand Down Expand Up @@ -219,12 +217,6 @@ require('./packages/server/index.js')
log('#transformSymlinkRequires')
await transformRequires(meta.distDir())

// optionally create a tar of the `cypress-build` directory. This is used in CI.
if (createTar) {
log('#create tar from dist dir')
await tar.c({ file: 'cypress-dist.tgz', gzip: true, cwd: os.tmpdir() }, ['cypress-build'])
}

log(`#testDistVersion ${meta.distDir()}`)
await testDistVersion(meta.distDir(), version)

Expand Down
6 changes: 0 additions & 6 deletions scripts/binary/trigger-publish-binary-pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,12 @@ const { getNextVersionForBinary } = require('../get-next-version')

const { nextVersion } = await getNextVersionForBinary()

function getArtifactUrl (fileName) {
return `https://output.circle-artifacts.com/output/job/${process.env.CIRCLE_WORKFLOW_JOB_ID}/artifacts/${process.env.CIRCLE_NODE_INDEX}/${fileName}`
}

const body = JSON.stringify({
branch: 'lerna-optimize-tasks',
parameters: {
temp_dir: os.tmpdir(),
sha: process.env.CIRCLE_SHA1,
job_name: process.env.CIRCLE_JOB,
binary_artifact_url: getArtifactUrl('cypress-dist.tgz'),
built_source_artifact_url: getArtifactUrl('cypress-built-source.tgz'),
triggered_workflow_id: process.env.CIRCLE_WORKFLOW_ID,
triggered_job_url: process.env.CIRCLE_BUILD_URL,
branch: process.env.CIRCLE_BRANCH,
Expand Down
6 changes: 1 addition & 5 deletions system-tests/projects/e2e/cypress/e2e/headless_old.cy.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
describe('e2e headless old spec', function () {
it('has expected launch args', function () {
if (Cypress.isBrowser({ family: 'chromium' }) && Cypress.browserMajorVersion() >= 119) {
cy.fail('headless old is supported in Chromium >= 119, please update this system test.')
}
// TODO: re-enable this once https://bugs.chromium.org/p/chromium/issues/detail?id=1483163 is resolved
// cy.task('get:browser:args').should('contain', '--headless=old')
cy.task('get:browser:args').should('contain', '--headless=old')
})
})
4 changes: 1 addition & 3 deletions system-tests/test/headless_old_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ describe('e2e', () => {
spec: 'headless_old.cy.js',
browser: 'chrome',
processEnv: {
// TODO: re-enable this once https://bugs.chromium.org/p/chromium/issues/detail?id=1483163
// has been resolved and we have updated to a version of Chromium that includes the fix
// CHROMIUM_USE_HEADLESS_OLD: 1,
CHROMIUM_USE_HEADLESS_OLD: 1,
},
})
})
8 changes: 5 additions & 3 deletions tooling/v8-snapshot/cache/darwin/snapshot-meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,6 @@
"./node_modules/tcp-port-used/node_modules/debug/src/index.js",
"./node_modules/throttle/throttle.js",
"./node_modules/tough-cookie/lib/cookie.js",
"./node_modules/tough-cookie/lib/memstore.js",
"./node_modules/trash/node_modules/glob/glob.js",
"./node_modules/trash/node_modules/glob/sync.js",
"./node_modules/trash/node_modules/ignore/ignore.js",
Expand Down Expand Up @@ -841,7 +840,7 @@
"./packages/socket/node_modules/socket.io/node_modules/ws/lib/websocket.js",
"./packages/ts/register.js",
"./packages/types/index.js",
"./tooling/v8-snapshot/dist/setup/v8-snapshot-entry.js"
"./tooling/v8-snapshot/dist/setup/v8-snapshot-entry-cy-in-cy.js"
],
"healthy": [
"./node_modules/@babel/code-frame/lib/index.js",
Expand Down Expand Up @@ -3339,6 +3338,7 @@
"./node_modules/to-regex-range/index.js",
"./node_modules/to-regex-range/node_modules/is-number/index.js",
"./node_modules/toidentifier/index.js",
"./node_modules/tough-cookie/lib/memstore.js",
"./node_modules/tough-cookie/lib/pathMatch.js",
"./node_modules/tough-cookie/lib/permuteDomain.js",
"./node_modules/tough-cookie/lib/pubsuffix-psl.js",
Expand Down Expand Up @@ -3805,6 +3805,8 @@
"./packages/extension/index.js",
"./packages/extension/lib/extension.js",
"./packages/extension/lib/util.js",
"./packages/frontend-shared/cypress/e2e/prod-dependencies.ts",
"./packages/frontend-shared/cypress/e2e/v8-snapshot-entry.ts",
"./packages/graphql/node_modules/chalk/source/templates.js",
"./packages/graphql/node_modules/chalk/source/util.js",
"./packages/graphql/node_modules/debug/node_modules/ms/index.js",
Expand Down Expand Up @@ -4299,5 +4301,5 @@
"./tooling/v8-snapshot/cache/darwin/snapshot-entry.js"
],
"deferredHashFile": "yarn.lock",
"deferredHash": "34ccd9494c6b7dffecf218f43ac005219c6f2c5fac6f5d86fa6496d9b86827cc"
"deferredHash": "20a0e4850189a69601ce25506a99e422cb79debe43a3bea1faf7d3a7f1a64b38"
}
Loading

4 comments on commit dfec4ad

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on dfec4ad Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.3.1/linux-x64/lerna-optimize-tasks-dfec4add6af0fad05d22a4e087e9adc59f3f5d5c/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on dfec4ad Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.3.1/linux-arm64/lerna-optimize-tasks-dfec4add6af0fad05d22a4e087e9adc59f3f5d5c/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on dfec4ad Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.3.1/darwin-arm64/lerna-optimize-tasks-dfec4add6af0fad05d22a4e087e9adc59f3f5d5c/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on dfec4ad Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/13.3.1/darwin-x64/lerna-optimize-tasks-dfec4add6af0fad05d22a4e087e9adc59f3f5d5c/cypress.tgz

Please sign in to comment.