Skip to content

Commit

Permalink
chore: remove experimentalSessionAndOrigin flag (#24340)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: removed experimentalSessionAndOrigin flag. testIsolation defaults to strict
  • Loading branch information
mschile authored Oct 24, 2022
1 parent 2b557d5 commit 69873ae
Show file tree
Hide file tree
Showing 97 changed files with 521 additions and 1,592 deletions.
105 changes: 9 additions & 96 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ mainBuildFilters: &mainBuildFilters
branches:
only:
- develop
- fix-ci-deps
- issue-23843_electron_21_upgrade
- release/11.0.0
- mschile/issue-21471_remove_experimentalSessionAndOrigin

# 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 @@ -37,8 +37,7 @@ macWorkflowFilters: &darwin-workflow-filters
when:
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ 'correct-dashboard-results', << pipeline.git.branch >> ]
- equal: [ 'issue-23843_electron_21_upgrade', << pipeline.git.branch >> ]
- equal: [ 'release/11.0.0', << pipeline.git.branch >> ]
- matches:
pattern: "-release$"
value: << pipeline.git.branch >>
Expand All @@ -47,8 +46,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
when:
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ 'webkit-multidomain', << pipeline.git.branch >> ]
- equal: [ 'issue-23843_electron_21_upgrade', << pipeline.git.branch >> ]
- equal: [ 'release/11.0.0', << pipeline.git.branch >> ]
- matches:
pattern: "-release$"
value: << pipeline.git.branch >>
Expand All @@ -66,8 +64,7 @@ windowsWorkflowFilters: &windows-workflow-filters
when:
or:
- equal: [ develop, << pipeline.git.branch >> ]
- equal: [ linux-arm64, << pipeline.git.branch >> ]
- equal: [ 'issue-23843_electron_21_upgrade', << pipeline.git.branch >> ]
- equal: [ release/11.0.0, << pipeline.git.branch >> ]
- matches:
pattern: "-release$"
value: << pipeline.git.branch >>
Expand Down Expand Up @@ -132,7 +129,7 @@ commands:
- run:
name: Check current branch to persist artifacts
command: |
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "issue-23843_electron_21_upgrade" ]]; then
if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/11.0.0" ]]; then
echo "Not uploading artifacts or posting install comment for this branch."
circleci-agent step halt
fi
Expand Down Expand Up @@ -458,10 +455,6 @@ commands:
description: chrome channel to install
type: string
default: ''
experimentalSessionAndOrigin:
description: experimental flag to apply
type: boolean
default: false
steps:
- restore_cached_workspace
- when:
Expand All @@ -485,13 +478,8 @@ commands:
if [[ -v MAIN_RECORD_KEY ]]; then
# internal PR
if <<parameters.experimentalSessionAndOrigin>>; then
CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
yarn cypress:run-experimentalSessionAndOrigin --record --parallel --group 5x-driver-<<parameters.browser>>-experimentalSessionAndOrigin --browser <<parameters.browser>>
else
CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
yarn cypress:run --record --parallel --group 5x-driver-<<parameters.browser>> --browser <<parameters.browser>>
fi
CYPRESS_RECORD_KEY=$MAIN_RECORD_KEY \
yarn cypress:run --record --parallel --group 5x-driver-<<parameters.browser>> --browser <<parameters.browser>>
else
# external PR
TESTFILES=$(circleci tests glob "cypress/e2e/**/*.cy.*" | circleci tests split --total=$CIRCLE_NODE_TOTAL)
Expand All @@ -500,11 +488,7 @@ commands:
if [[ -z "$TESTFILES" ]]; then
echo "Empty list of test files"
fi
if <<parameters.experimentalSessionAndOrigin>>; then
yarn cypress:run-experimentalSessionAndOrigin --browser <<parameters.browser>> --spec $TESTFILES
else
yarn cypress:run --browser <<parameters.browser>> --spec $TESTFILES
fi
yarn cypress:run --browser <<parameters.browser>> --spec $TESTFILES
fi
working_directory: packages/driver
- verify-mocha-results
Expand Down Expand Up @@ -1605,53 +1589,6 @@ jobs:
- run-driver-integration-tests:
browser: webkit

driver-integration-tests-chrome-experimentalSessionAndOrigin:
<<: *defaults
resource_class: medium
parallelism: 5
steps:
- run-driver-integration-tests:
browser: chrome
install-chrome-channel: stable
experimentalSessionAndOrigin: true

driver-integration-tests-chrome-beta-experimentalSessionAndOrigin:
<<: *defaults
resource_class: medium
parallelism: 5
steps:
- run-driver-integration-tests:
browser: chrome:beta
install-chrome-channel: beta
experimentalSessionAndOrigin: true

driver-integration-tests-firefox-experimentalSessionAndOrigin:
<<: *defaults
resource_class: medium
parallelism: 5
steps:
- run-driver-integration-tests:
browser: firefox
experimentalSessionAndOrigin: true

driver-integration-tests-electron-experimentalSessionAndOrigin:
<<: *defaults
resource_class: medium
parallelism: 5
steps:
- run-driver-integration-tests:
browser: electron
experimentalSessionAndOrigin: true

driver-integration-tests-webkit-experimentalSessionAndOrigin:
<<: *defaults
resource_class: medium
parallelism: 5
steps:
- run-driver-integration-tests:
browser: webkit
experimentalSessionAndOrigin: true

run-reporter-component-tests-chrome:
<<: *defaults
parameters:
Expand Down Expand Up @@ -2422,26 +2359,6 @@ linux-x64-workflow: &linux-x64-workflow
context: test-runner:cypress-record-key
requires:
- build
- driver-integration-tests-chrome-experimentalSessionAndOrigin:
context: test-runner:cypress-record-key
requires:
- build
- driver-integration-tests-chrome-beta-experimentalSessionAndOrigin:
context: test-runner:cypress-record-key
requires:
- build
- driver-integration-tests-firefox-experimentalSessionAndOrigin:
context: test-runner:cypress-record-key
requires:
- build
- driver-integration-tests-electron-experimentalSessionAndOrigin:
context: test-runner:cypress-record-key
requires:
- build
- driver-integration-tests-webkit-experimentalSessionAndOrigin:
context: test-runner:cypress-record-key
requires:
- build
- run-frontend-shared-component-tests-chrome:
context: [test-runner:cypress-record-key, test-runner:launchpad-tests, test-runner:percy]
percy: true
Expand Down Expand Up @@ -2543,10 +2460,6 @@ linux-x64-workflow: &linux-x64-workflow
- driver-integration-tests-chrome
- driver-integration-tests-chrome-beta
- driver-integration-tests-electron
- driver-integration-tests-firefox-experimentalSessionAndOrigin
- driver-integration-tests-chrome-experimentalSessionAndOrigin
- driver-integration-tests-chrome-beta-experimentalSessionAndOrigin
- driver-integration-tests-electron-experimentalSessionAndOrigin
- system-tests-non-root
- system-tests-firefox
- system-tests-electron
Expand Down
13 changes: 3 additions & 10 deletions cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1081,8 +1081,6 @@ declare namespace Cypress {
/**
* Save/Restore browser Cookies, LocalStorage, and SessionStorage data resulting from the supplied `setup` function.
*
* Only available if the `experimentalSessionAndOrigin` config option is enabled.
*
* @see https://on.cypress.io/session
*/
session(id: string | object, setup?: () => void, options?: SessionOptions): Chainable<null>
Expand Down Expand Up @@ -2803,7 +2801,7 @@ declare namespace Cypress {
* The test isolation level applied to ensure a clean slate between tests.
* - legacy - resets/clears aliases, intercepts, clock, viewport, cookies, and local storage before each test.
* - strict - applies all resets/clears from legacy, plus clears the page by visiting 'about:blank' to ensure clean app state before each test.
* @default "legacy", however, when experimentalSessionAndOrigin=true, the default is "strict"
* @default "strict"
*/
testIsolation: 'legacy' | 'strict'
/**
Expand Down Expand Up @@ -2866,11 +2864,6 @@ declare namespace Cypress {
* @default false
*/
experimentalInteractiveRunEvents: boolean
/**
* Enables cross-origin and improved session support, including the `cy.origin` and `cy.session` commands. See https://on.cypress.io/origin and https://on.cypress.io/session.
* @default false
*/
experimentalSessionAndOrigin: boolean
/**
* Whether Cypress will search for and replace obstructive code in third party .js or .html files.
* NOTE: Setting this flag to true removes Subresource Integrity (SRI).
Expand Down Expand Up @@ -3038,7 +3031,7 @@ declare namespace Cypress {
xhrUrl: string
}

interface TestConfigOverrides extends Partial<Pick<ConfigOptions, 'animationDistanceThreshold' | 'blockHosts' | 'defaultCommandTimeout' | 'env' | 'execTimeout' | 'includeShadowDom' | 'numTestsKeptInMemory' | 'pageLoadTimeout' | 'redirectionLimit' | 'requestTimeout' | 'responseTimeout' | 'retries' | 'screenshotOnRunFailure' | 'slowTestThreshold' | 'scrollBehavior' | 'taskTimeout' | 'viewportHeight' | 'viewportWidth' | 'waitForAnimations' | 'experimentalSessionAndOrigin'>>, Partial<Pick<ResolvedConfigOptions, 'baseUrl'>> {
interface TestConfigOverrides extends Partial<Pick<ConfigOptions, 'animationDistanceThreshold' | 'blockHosts' | 'defaultCommandTimeout' | 'env' | 'execTimeout' | 'includeShadowDom' | 'numTestsKeptInMemory' | 'pageLoadTimeout' | 'redirectionLimit' | 'requestTimeout' | 'responseTimeout' | 'retries' | 'screenshotOnRunFailure' | 'slowTestThreshold' | 'scrollBehavior' | 'taskTimeout' | 'viewportHeight' | 'viewportWidth' | 'waitForAnimations'>>, Partial<Pick<ResolvedConfigOptions, 'baseUrl'>> {
browser?: IsBrowserMatcher | IsBrowserMatcher[]
keystrokeDelay?: number
}
Expand Down Expand Up @@ -3094,7 +3087,7 @@ declare namespace Cypress {
}
}

interface ComponentConfigOptions<ComponentDevServerOpts = any> extends Omit<CoreConfigOptions, 'baseUrl' | 'experimentalSessionAndOrigin' | 'experimentalStudio'> {
interface ComponentConfigOptions<ComponentDevServerOpts = any> extends Omit<CoreConfigOptions, 'baseUrl' | 'experimentalStudio'> {
devServer: DevServerFn<ComponentDevServerOpts> | DevServerConfigOptions
devServerConfig?: ComponentDevServerOpts
/**
Expand Down
12 changes: 12 additions & 0 deletions npm/mount-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,18 @@ export function setupHooks (optionalCallback?: Function) {
)
})

Cypress.Commands.overwrite('session', () => {
throw new Error(
'cy.session from a component spec is not allowed',
)
})

Cypress.Commands.overwrite('origin', () => {
throw new Error(
'cy.origin from a component spec is not allowed',
)
})

// @ts-ignore
Cypress.on('test:before:run', () => {
optionalCallback?.()
Expand Down
1 change: 0 additions & 1 deletion npm/vite-dev-server/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { defineConfig } from 'cypress'
export default defineConfig({
projectId: 'ypt4pf',
e2e: {
experimentalSessionAndOrigin: true,
defaultCommandTimeout: 10000, // these take a bit longer b/c they're e2e open mode test
async setupNodeEvents (on, config) {
if (!process.env.HTTP_PROXY_TARGET_FOR_ORIGIN_REQUESTS) {
Expand Down
12 changes: 0 additions & 12 deletions packages/app/cypress/e2e/settings.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,18 +202,6 @@ describe('App: Settings', () => {
})
})

cy.get('[data-cy="experiment-experimentalSessionAndOrigin"]').within(() => {
cy.validateExternalLink({
name: 'cy.session()',
href: 'https://on.cypress.io/session',
})

cy.validateExternalLink({
name: 'cy.origin()',
href: 'https://on.cypress.io/origin',
})
})

cy.get('[data-cy="experiment-experimentalSourceRewriting"]').within(() => {
cy.validateExternalLink({
name: '#5273',
Expand Down
12 changes: 5 additions & 7 deletions packages/config/__snapshots__/index.spec.ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ exports['config/src/index .getBreakingKeys returns list of breaking config keys
"experimentalNetworkStubbing",
"experimentalRunEvents",
"experimentalSessionSupport",
"experimentalSessionAndOrigin",
"experimentalShadowDomSupport",
"firefoxGcInterval",
"ignoreTestFiles",
Expand Down Expand Up @@ -35,7 +36,6 @@ exports['config/src/index .getDefaultValues returns list of public config keys 1
"execTimeout": 60000,
"experimentalFetchPolyfill": false,
"experimentalInteractiveRunEvents": false,
"experimentalSessionAndOrigin": false,
"experimentalModifyObstructiveThirdPartyCode": false,
"experimentalSourceRewriting": false,
"experimentalSingleTabRunMode": false,
Expand All @@ -52,7 +52,6 @@ exports['config/src/index .getDefaultValues returns list of public config keys 1
"port": null,
"projectId": null,
"redirectionLimit": 20,
"repoRoot": null,
"reporter": "spec",
"reporterOptions": null,
"requestTimeout": 5000,
Expand All @@ -70,7 +69,7 @@ exports['config/src/index .getDefaultValues returns list of public config keys 1
"supportFile": "cypress/support/e2e.{js,jsx,ts,tsx}",
"supportFolder": false,
"taskTimeout": 60000,
"testIsolation": "legacy",
"testIsolation": "strict",
"trashAssetsBeforeRuns": true,
"userAgent": null,
"video": true,
Expand All @@ -94,6 +93,7 @@ exports['config/src/index .getDefaultValues returns list of public config keys 1
"isTextTerminal": false,
"morgan": true,
"namespace": "__cypress",
"repoRoot": null,
"reporterRoute": "/__cypress/reporter",
"socketId": null,
"socketIoCookie": "__socket",
Expand All @@ -120,7 +120,6 @@ exports['config/src/index .getDefaultValues returns list of public config keys f
"execTimeout": 60000,
"experimentalFetchPolyfill": false,
"experimentalInteractiveRunEvents": false,
"experimentalSessionAndOrigin": false,
"experimentalModifyObstructiveThirdPartyCode": false,
"experimentalSourceRewriting": false,
"experimentalSingleTabRunMode": false,
Expand All @@ -137,7 +136,6 @@ exports['config/src/index .getDefaultValues returns list of public config keys f
"port": null,
"projectId": null,
"redirectionLimit": 20,
"repoRoot": null,
"reporter": "spec",
"reporterOptions": null,
"requestTimeout": 5000,
Expand All @@ -155,7 +153,7 @@ exports['config/src/index .getDefaultValues returns list of public config keys f
"supportFile": "cypress/support/e2e.{js,jsx,ts,tsx}",
"supportFolder": false,
"taskTimeout": 60000,
"testIsolation": "legacy",
"testIsolation": "strict",
"trashAssetsBeforeRuns": true,
"userAgent": null,
"video": true,
Expand All @@ -179,6 +177,7 @@ exports['config/src/index .getDefaultValues returns list of public config keys f
"isTextTerminal": false,
"morgan": true,
"namespace": "__cypress",
"repoRoot": null,
"reporterRoute": "/__cypress/reporter",
"socketId": null,
"socketIoCookie": "__socket",
Expand All @@ -201,7 +200,6 @@ exports['config/src/index .getPublicConfigKeys returns list of public config key
"execTimeout",
"experimentalFetchPolyfill",
"experimentalInteractiveRunEvents",
"experimentalSessionAndOrigin",
"experimentalModifyObstructiveThirdPartyCode",
"experimentalSourceRewriting",
"experimentalSingleTabRunMode",
Expand Down
Loading

5 comments on commit 69873ae

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 69873ae Oct 24, 2022

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 platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/11.0.0/linux-x64/release/11.0.0-69873ae9884228f15310fd151e42cbc0cb712817/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 69873ae Oct 24, 2022

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 platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/11.0.0/linux-arm64/release/11.0.0-69873ae9884228f15310fd151e42cbc0cb712817/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 69873ae Oct 24, 2022

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 platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/11.0.0/darwin-arm64/release/11.0.0-69873ae9884228f15310fd151e42cbc0cb712817/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 69873ae Oct 24, 2022

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 platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/11.0.0/darwin-x64/release/11.0.0-69873ae9884228f15310fd151e42cbc0cb712817/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 69873ae Oct 24, 2022

Choose a reason for hiding this comment

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

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

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/11.0.0/win32-x64/release/11.0.0-69873ae9884228f15310fd151e42cbc0cb712817/cypress.tgz

Please sign in to comment.