Skip to content

Commit c540284

Browse files
fix: add v8 snapshot usage to cypress in cypress testing (#24860)
1 parent 79f743e commit c540284

File tree

27 files changed

+167
-140
lines changed

27 files changed

+167
-140
lines changed

.circleci/cache-version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Bump this version to force CI to re-create the cache from scratch.
22

3-
12-01-22
3+
12-05-22

.circleci/workflows.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ mainBuildFilters: &mainBuildFilters
2828
only:
2929
- develop
3030
- /^release\/\d+\.\d+\.\d+$/
31-
- 'ryanm/fix/v8-improvements'
32-
- 'mschile/windows_session'
31+
- 'ryanm/fix/cy-in-cy-and-v8-snapshots'
3332

3433
# usually we don't build Mac app - it takes a long time
3534
# but sometimes we want to really confirm we are doing the right thing
@@ -38,17 +37,15 @@ macWorkflowFilters: &darwin-workflow-filters
3837
when:
3938
or:
4039
- equal: [ develop, << pipeline.git.branch >> ]
41-
- equal: [ 'ryanm/fix/v8-improvements', << pipeline.git.branch >> ]
42-
- equal: [ 'mschile/windows_session', << pipeline.git.branch >> ]
40+
- equal: [ 'ryanm/fix/cy-in-cy-and-v8-snapshots', << pipeline.git.branch >> ]
4341
- matches:
4442
pattern: /^release\/\d+\.\d+\.\d+$/
4543
value: << pipeline.git.branch >>
4644
linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
4745
when:
4846
or:
4947
- equal: [ develop, << pipeline.git.branch >> ]
50-
- equal: [ 'ryanm/fix/v8-improvements', << pipeline.git.branch >> ]
51-
- equal: [ 'mschile/windows_session', << pipeline.git.branch >> ]
48+
- equal: [ 'ryanm/fix/cy-in-cy-and-v8-snapshots', << pipeline.git.branch >> ]
5249
- matches:
5350
pattern: /^release\/\d+\.\d+\.\d+$/
5451
value: << pipeline.git.branch >>
@@ -66,8 +63,7 @@ windowsWorkflowFilters: &windows-workflow-filters
6663
when:
6764
or:
6865
- equal: [ develop, << pipeline.git.branch >> ]
69-
- equal: [ 'ryanm/fix/v8-improvements', << pipeline.git.branch >> ]
70-
- equal: [ 'mschile/windows_session', << pipeline.git.branch >> ]
66+
- equal: [ 'ryanm/fix/cy-in-cy-and-v8-snapshots', << pipeline.git.branch >> ]
7167
- matches:
7268
pattern: /^release\/\d+\.\d+\.\d+$/
7369
value: << pipeline.git.branch >>
@@ -133,7 +129,7 @@ commands:
133129
- run:
134130
name: Check current branch to persist artifacts
135131
command: |
136-
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "ryanm/fix/v8-improvements" ]]; then
132+
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "ryanm/fix/cy-in-cy-and-v8-snapshots" ]]; then
137133
echo "Not uploading artifacts or posting install comment for this branch."
138134
circleci-agent step halt
139135
fi

npm/vite-dev-server/cypress.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default defineConfig({
1111

1212
// Delete this as we only want to honor it on parent Cypress when doing E2E Cypress in Cypress testing
1313
delete process.env.HTTP_PROXY_TARGET_FOR_ORIGIN_REQUESTS
14+
delete process.env.CYPRESS_INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT
1415
process.env.CYPRESS_INTERNAL_E2E_TESTING_SELF = 'true'
1516
process.env.CYPRESS_INTERNAL_VITE_OPEN_MODE_TESTING = 'true'
1617
const { e2ePluginSetup } = require('@packages/frontend-shared/cypress/e2e/e2ePluginSetup') as typeof import('@packages/frontend-shared/cypress/e2e/e2ePluginSetup')

npm/vite-dev-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build-prod": "tsc || echo 'built, with type errors'",
99
"check-ts": "tsc --noEmit",
1010
"cypress:run": "yarn cypress:run-cypress-in-cypress node ../../scripts/cypress run --project . --browser chrome",
11-
"cypress:run-cypress-in-cypress": "cross-env HTTP_PROXY_TARGET_FOR_ORIGIN_REQUESTS=http://localhost:4455 CYPRESS_REMOTE_DEBUGGING_PORT=6666 TZ=America/New_York",
11+
"cypress:run-cypress-in-cypress": "cross-env CYPRESS_INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT=1 HTTP_PROXY_TARGET_FOR_ORIGIN_REQUESTS=http://localhost:4455 CYPRESS_REMOTE_DEBUGGING_PORT=6666 TZ=America/New_York",
1212
"cypress:open": "yarn cypress:run-cypress-in-cypress gulp open --project .",
1313
"watch": "tsc -w",
1414
"test": "yarn test-unit",

npm/webpack-dev-server/cypress.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default defineConfig({
1111

1212
// Delete this as we only want to honor it on parent Cypress when doing E2E Cypress in Cypress testing
1313
delete process.env.HTTP_PROXY_TARGET_FOR_ORIGIN_REQUESTS
14+
delete process.env.CYPRESS_INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT
1415
process.env.CYPRESS_INTERNAL_E2E_TESTING_SELF = 'true'
1516
const { e2ePluginSetup } = require('@packages/frontend-shared/cypress/e2e/e2ePluginSetup') as typeof import('@packages/frontend-shared/cypress/e2e/e2ePluginSetup')
1617

npm/webpack-dev-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dev": "tsc --watch",
1212
"clean": "rimraf dist",
1313
"cypress:run": "yarn cypress:run-cypress-in-cypress node ../../scripts/cypress run --project . --browser chrome",
14-
"cypress:run-cypress-in-cypress": "cross-env HTTP_PROXY_TARGET_FOR_ORIGIN_REQUESTS=http://localhost:4455 CYPRESS_REMOTE_DEBUGGING_PORT=6666 TZ=America/New_York",
14+
"cypress:run-cypress-in-cypress": "cross-env CYPRESS_INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT=1 HTTP_PROXY_TARGET_FOR_ORIGIN_REQUESTS=http://localhost:4455 CYPRESS_REMOTE_DEBUGGING_PORT=6666 TZ=America/New_York",
1515
"cypress:open": "yarn cypress:run-cypress-in-cypress gulp open --project .",
1616
"test": "yarn test-unit",
1717
"test-unit": "mocha -r ts-node/register/transpile-only --config ./test/.mocharc.js",

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@
6969
"watch": "yarn gulp watch",
7070
"prepare": "husky install"
7171
},
72-
"dependencies": {
73-
"bytenode": "1.3.7",
74-
"nvm": "0.0.4"
75-
},
7672
"devDependencies": {
7773
"@aws-sdk/credential-providers": "3.53.0",
7874
"@cypress/questions-remain": "1.0.1",
@@ -132,6 +128,7 @@
132128
"babel-eslint": "10.1.0",
133129
"bluebird": "3.5.3",
134130
"bluebird-retry": "0.11.0",
131+
"bytenode": "1.3.7",
135132
"c8": "^7.10.0",
136133
"chai": "4.2.0",
137134
"chai-as-promised": "7.1.1",

packages/app/cypress.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default defineConfig({
3535

3636
// Delete this as we only want to honor it on parent Cypress when doing E2E Cypress in Cypress testing
3737
delete process.env.HTTP_PROXY_TARGET_FOR_ORIGIN_REQUESTS
38+
delete process.env.CYPRESS_INTERNAL_E2E_TESTING_SELF_PARENT_PROJECT
3839
process.env.CYPRESS_INTERNAL_E2E_TESTING_SELF = 'true'
3940
process.env.CYPRESS_INTERNAL_VITE_OPEN_MODE_TESTING = 'true'
4041
// process.env.DEBUG = '*'

packages/app/cypress/e2e/runs.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe('App: Runs', { viewportWidth: 1200 }, () => {
7777
moveToRunsPage()
7878
cy.contains(defaultMessages.runs.connect.buttonUser).click()
7979
cy.withCtx((ctx, o) => {
80-
o.sinon.spy(ctx._apis.authApi, 'logIn')
80+
o.sinon.stub(ctx._apis.authApi, 'logIn')
8181
})
8282

8383
cy.findByRole('dialog', { name: 'Log in to Cypress' }).within(() => {

packages/app/cypress/e2e/settings.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ describe('App: Settings without cloud', () => {
399399
cy.findByText('Cypress Cloud settings').click()
400400
cy.findByText('Project ID').should('not.exist')
401401
cy.withCtx((ctx, o) => {
402-
o.sinon.spy(ctx._apis.authApi, 'logIn')
402+
o.sinon.stub(ctx._apis.authApi, 'logIn')
403403
})
404404

405405
cy.contains('button', 'Log in to Cypress Cloud').click()

0 commit comments

Comments
 (0)