chore(dependency): Upgrade Electron 27 (#28792)

* dependency: upgrades electron from 25 to 26

* bump cache run ci

* fix docker img names

* ref electron upgrade branch

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* debug

* debug

* debug

* update search string for resize observer error swallow

* debug

* update integrity check

* update electron readme with upgrade troubleshooting section

* point to new publish binary workflow branch for electron 27

* update electron readme with locations of chromium & node versions for a given electron version

* update node versions and docker image refs

* update electron version to 27.1.3

* fix db nativeBinding arg

* chore: updating v8 snapshot cache

* install setuptools on mac when updating v8 snapshot cache

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* run workflows on this branch run ci

* require addon directly and pass to better-sqlite3 init; debug

* rm debug

* try loading better-sqlite with a more dynamic filename

* bump electron version

* bump electron version

* bump electron version -- run ci

* bump electron version -- run ci

* bump electron version -- run ci

* bump electron version -- run ci

* bump electron version -- run ci

* add a step to update workflows.yml to electron upgrade process

* reduce retry limit on issue 1244 test to prevent circle from thinking tests have hanged

* target main branch of binary publish workflow? run ci

* Update .node-version -- run ci

* Update CHANGELOG.md

* Update module_api_spec.ts

* point publish binary back to electron upgrade branch

* Adds some logging re: cachedDataVersion

* use precise electron version for better-sqlite3 for centos7

* Update CHANGELOG.md

* chore: fix issue with bytenode (#28568)

* fix jsc for 27 -- run ci

* Update smoke.js

* fix build

* update electron upgrade steps

* Update packages/electron/README.md

Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>

* Update cli/CHANGELOG.md

Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>

* fix DebugEmptyStates component test

* try to fix downstream build -- run ci (#28649)

Co-authored-by: Cacie Prins <cacieprins@users.noreply.github.com>

* point to consolidated binary publish branch

* revert webpack-preprocessor-awesome-typescript-loader update

* revert certain system tests

* increase padding for module api system test duration window

* account for differing screenshot sizes

* screenshot size differs locally vs ci

* update protocol snapshots

* Update after-pack-hook.js

* fix flaky slideshow

* correct the chromium version in changelog

* use 18.17.1 internal images

* workflow filters

* fix trailing checkbox in electron readme

* add solution to crashing better-sqlite3 in electron readme

* Update packages/electron/README.md

Co-authored-by: Bill Glesias <bglesias@gmail.com>

* Update scripts/after-pack-hook.js

Co-authored-by: Ryan Manuel <ryanm@cypress.io>

* Update scripts/after-pack-hook.js

Co-authored-by: Ryan Manuel <ryanm@cypress.io>

* Update scripts/after-pack-hook.js

Co-authored-by: Ryan Manuel <ryanm@cypress.io>

* add branch to setup_should_persist_artifacts

* debug app e2e test

* bump cache

* upgrade browsers-internal to chrome 121

* revert to chrome 118 images

* bump cache

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* bump cache

---------

Co-authored-by: cypress-bot[bot] <+cypress-bot[bot]@users.noreply.github.com>
Co-authored-by: Ryan Manuel <ryanm@cypress.io>
Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>
Co-authored-by: Bill Glesias <bglesias@gmail.com>
This commit is contained in:
Cacie Prins
2024-02-15 10:33:51 -05:00
committed by GitHub
parent e0255f99c2
commit 3288aa5069
45 changed files with 372 additions and 215 deletions

View File

@@ -1,3 +1,3 @@
# Bump this version to force CI to re-create the cache from scratch.
01-04-24
02-09-24

View File

@@ -29,6 +29,7 @@ mainBuildFilters: &mainBuildFilters
- develop
- /^release\/\d+\.\d+\.\d+$/
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- 'cacie/dep/electron-27'
- 'chore/update_octokit'
- 'publish-binary'
- 'em/circle2'
@@ -42,6 +43,7 @@ macWorkflowFilters: &darwin-workflow-filters
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'cacie/dep/electron-27', << pipeline.git.branch >> ]
- equal: [ 'chore/update_octokit', << pipeline.git.branch >> ]
- equal: [ 'ryanm/fix/service-worker-capture', << pipeline.git.branch >> ]
- matches:
@@ -54,6 +56,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'cacie/dep/electron-27', << pipeline.git.branch >> ]
- equal: [ 'chore/update_octokit', << pipeline.git.branch >> ]
- equal: [ 'em/circle2', << pipeline.git.branch >> ]
- matches:
@@ -78,6 +81,7 @@ windowsWorkflowFilters: &windows-workflow-filters
- equal: [ develop, << pipeline.git.branch >> ]
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'cacie/dep/electron-27', << pipeline.git.branch >> ]
- equal: [ 'chore/update_octokit', << pipeline.git.branch >> ]
- equal: [ 'lerna-optimize-tasks', << pipeline.git.branch >> ]
- equal: [ 'mschile/mochaEvents_win_sep', << pipeline.git.branch >> ]
@@ -89,7 +93,7 @@ executors:
# the Docker image with Cypress dependencies and Chrome browser
cy-doc:
docker:
- image: cypress/browsers-internal:node18.15.0-chrome114-ff115
- image: cypress/browsers-internal:node18.17.1-chrome118-ff115
# by default, we use "medium" to balance performance + CI costs. bump or reduce on a per-job basis if needed.
resource_class: medium
environment:
@@ -99,7 +103,7 @@ executors:
# Docker image with non-root "node" user
non-root-docker-user:
docker:
- image: cypress/browsers-internal:node18.15.0-chrome114-ff115
- image: cypress/browsers-internal:node18.17.1-chrome118-ff115
user: node
environment:
PLATFORM: linux
@@ -150,7 +154,7 @@ commands:
name: Set environment variable to determine whether or not to persist artifacts
command: |
echo "Setting SHOULD_PERSIST_ARTIFACTS variable"
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "publish-binary" && "$CIRCLE_BRANCH" != "chore/update_octokit" ]]; then
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "publish-binary" && "$CIRCLE_BRANCH" != "chore/update_octokit" && "$CIRCLE_BRANCH" != "cacie/dep/electron-27" ]]; then
export SHOULD_PERSIST_ARTIFACTS=true
fi' >> "$BASH_ENV"
# You must run `setup_should_persist_artifacts` command and be using bash before running this command
@@ -552,7 +556,7 @@ commands:
if [[ ! -f better_sqlite3.node ]]; then
docker run -d --name centos7-builder centos7-builder /bin/bash -c "sleep 1000000000"
docker cp ~/cypress/node_modules/better-sqlite3 centos7-builder:/better-sqlite3
docker exec -it centos7-builder /bin/bash -c "cd /better-sqlite3 && source /root/.bashrc && chown -R root:root . && npm install --ignore-scripts && npx --no-install prebuild -r electron -t 25.0.0 --include-regex 'better_sqlite3.node$'"
docker exec -it centos7-builder /bin/bash -c "cd /better-sqlite3 && source /root/.bashrc && chown -R root:root . && npm install --ignore-scripts && npx --no-install prebuild -r electron -t 27.1.3 --include-regex 'better_sqlite3.node$'"
docker cp centos7-builder:/better-sqlite3/build/Release/better_sqlite3.node ~/cypress/node_modules/better-sqlite3/build/Release/better_sqlite3.node
docker rm -f centos7-builder
cp ~/cypress/node_modules/better-sqlite3/build/Release/better_sqlite3.node ~/cypress/better_sqlite3.node
@@ -666,6 +670,9 @@ commands:
echo Total containers $CIRCLE_NODE_TOTAL
if [[ -v MAIN_RECORD_KEY ]]; then
if [[ <<parameters.package>> == 'app' && <<parameters.type>> == 'e2e' ]]; then
export DEBUG=cypress:*
fi
# internal PR
cmd=$([[ <<parameters.percy>> == 'true' ]] && echo 'yarn percy exec --parallel -- --') || true
DEBUG=<<parameters.debug>> \
@@ -1225,6 +1232,12 @@ commands:
else
yarn binary-package --version $(node ./scripts/get-next-version.js)
fi
- run:
name: Smoke Test the Cypress binary
command: |
source ./scripts/ensure-node.sh
node --version
yarn binary-smoke-test --version $(node ./scripts/get-next-version.js)
- run:
name: Zip the binary
command: |
@@ -2325,7 +2338,7 @@ jobs:
<<: *defaults
resource_class: small
docker:
- image: cypress/base-internal:18.15.0
- image: cypress/base-internal:18.17.1
steps:
- maybe_skip_binary_jobs
- restore_workspace_binaries

View File

@@ -43,7 +43,7 @@ body:
attributes:
label: Node version
description: What version of node.js are you using to run Cypress?
placeholder: ex. v18.15.0
placeholder: ex. v18.17.0
validations:
required: true
- type: input

View File

@@ -51,7 +51,7 @@ body:
attributes:
label: Node version
description: What version of node.js are you using to run Cypress?
placeholder: ex. v18.15.0
placeholder: ex. v18.17.0
validations:
required: true
- type: input

View File

@@ -38,7 +38,7 @@ body:
attributes:
label: Node version
description: What version of node.js are you using to run Cypress?
placeholder: ex. v18.15.0
placeholder: ex. v18.17.0
validations:
required: true
- type: dropdown

View File

@@ -48,6 +48,9 @@ jobs:
- name: Determine snapshot files - Mac
if: ${{ matrix.platform == 'macos-latest' }}
run: echo "SNAPSHOT_FILES='tooling/v8-snapshot/cache/darwin/snapshot-meta.json'" >> $GITHUB_ENV
- name: Install setuptools - Mac
if: ${{ matrix.platform == 'macos-latest' }}
run: sudo -H pip install setuptools
- name: Checkout
uses: actions/checkout@v4
with:

View File

@@ -1 +1 @@
18.15.0
18.17.1

View File

@@ -1,5 +1,5 @@
FROM centos:7
# Install dependencies for re-building better-sqlite and setting devtoolset-8 as the default compiler
# Install dependencies for re-building better-sqlite and setting devtoolset-8 as the default compiler.
RUN yum -y install centos-release-scl curl python3 make atk-devel atk java-atk-wrapper at-spi2-atk gtk3 libXt libdrm mesa-libgbm Xvfb && yum -y install devtoolset-8-gcc devtoolset-8-gcc-c++
RUN echo >> /etc/profile.d/devtoolset-8.sh 'source scl_source enable devtoolset-8'
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash

View File

@@ -11,6 +11,9 @@ _Released 2/13/2024 (PENDING)_
**Dependency Updates:**
- Upgraded `electron` from `25.8.4` to `27.1.3`
- Upgraded bundled Node.js version from `18.15.0` to `18.17.0`
- Upgraded bundled Chromium version from `114.0.5735.289` to `118.0.5993.117`
- Updated [`is-ci`](https://www.npmjs.com/package/is-ci) from `3.0.0` to `3.0.1`. Addressed in [#28933](https://github.com/cypress-io/cypress/pull/28933).
**Misc:**
@@ -72,6 +75,7 @@ _Released 1/16/2024_
- Improved accessibility of some areas of the Cypress App. Addressed in [#28628](https://github.com/cypress-io/cypress/pull/28628).
- Updated some documentation links to go through on.cypress.io. Addressed in [#28623](https://github.com/cypress-io/cypress/pull/28623).
## 13.6.2
_Released 12/26/2023_

View File

@@ -33,7 +33,7 @@ services:
- .:/opt/cypress
ci:
# This should mirror the image used in workflows.yml
image: cypress/browsers-internal:node18.15.0-chrome114-ff115
image: cypress/browsers-internal:node18.17.1-chrome118-ff115
ports:
- 5566:5566
- 5567:5567

View File

@@ -38,3 +38,9 @@ You can build the Cypress binary locally by running `yarn binary-build`, then pa
If you're on macOS and building locally, you'll need a code-signing certificate in your keychain, which you can get by following the [instructions on Apple's website](https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html#//apple_ref/doc/uid/TP40005929-CH4-SW30). Also, you'll also most likely want to skip notarization since it requires an Apple Developer Program account - set `SKIP_NOTARIZATION=1` when building locally to do this. [More info about code signing in CI](./code-signing.md).
`yarn binary-zip` can be used to zip the built binary together.
### Tips
If you want to speed up the time it takes to package the binary, set `V8_SNAPSHOT_DISABLE_MINIFY=1`
If you are on an M1, you need to set `RESET_ADHOC_SIGNATURE=1` in order to be able to actually run the binary after packaging it.

View File

@@ -10,6 +10,7 @@
"binary-ensure": "node ./scripts/binary.js ensure",
"binary-purge": "node ./scripts/binary.js purge-version",
"binary-release": "node ./scripts/binary.js release",
"binary-smoke-test": "node ./scripts/binary.js smoke",
"binary-upload": "node ./scripts/binary.js upload",
"binary-zip": "node ./scripts/binary.js zip",
"binary-package": "cross-env NODE_OPTIONS=--max_old_space_size=8192 node ./scripts/binary.js package",
@@ -145,7 +146,7 @@
"dedent": "^0.7.0",
"del": "3.0.0",
"detect-port": "^1.3.0",
"electron": "25.8.4",
"electron": "27.1.3",
"electron-builder": "^23.6.0",
"enzyme-adapter-react-16": "1.12.1",
"eslint": "7.22.0",
@@ -211,7 +212,7 @@
"yarn-deduplicate": "3.1.0"
},
"engines": {
"node": ">=18.15.0",
"node": ">=18.17.0",
"yarn": ">=1.17.3"
},
"productName": "Cypress",

View File

@@ -48,5 +48,5 @@ registerMountFn({ plugins: [() => createRouter(), () => pinia] })
installCustomPercyCommand()
Cypress.on('uncaught:exception', (err) => !err.message.includes('ResizeObserver loop limit exceeded'))
Cypress.on('uncaught:exception', (err) => !err.message.includes('ResizeObserver loop completed with undelivered notifications.'))
Cypress.Commands.add('tabUntil', tabUntil)

View File

@@ -2,7 +2,7 @@
<div class="relative">
<!-- leave-to classes are marked absolute to allow the entering component to
animate on top of the leaving component, creating a fading animation with no thrashing -->
<transition
<transition-group
enter-from-class="opacity-0"
enter-active-class="transition duration-300 ease-out"
enter-to-class="opacity-100"
@@ -18,7 +18,7 @@
:go-forward="increment"
:reset="reset"
/>
</transition>
</transition-group>
</div>
</template>

View File

@@ -66,8 +66,7 @@ describe('Debug page empty states', { defaultCommandTimeout: 250 }, () => {
// ensure the promos are done transitioning before clicking on the control
// since 2 buttons could display if both promos are easing in and out
cy.findByTestId('promo-action')
.should('not.have.class', 'ease-in')
cy.findAllByTestId('guide-card', { timeout: 350 }).should('not.have.class', 'ease-in')
.and('not.have.class', 'ease-out')
cy.findByTestId('promo-action-control').click()

View File

@@ -20,14 +20,17 @@
<GuideCard1
v-if="step === 0"
:action="goForward"
data-cy="guide-card"
/>
<GuideCard2
v-else-if="step === 1"
:action="goForward"
data-cy="guide-card"
/>
<GuideCard3
v-else-if="step === 2"
:action="reset"
data-cy="guide-card"
/>
</template>
</Promo>

View File

@@ -36,7 +36,7 @@ Upgrading `electron` involves more than just bumping this package's `package.jso
- the major version number of Node.js changes, since users rely on the bundled Node.js to load plugins and `.js` fixtures, or
- there are changes to Electron that require new shared libraries to be installed on Linux, breaking existing CI setups, or
- there is some other change that would break existing usage of Cypress (for example, a Web API feature being removed/added to the bundled Chromium)
- [ ] **Create and publish Docker `base-internal` and `browsers-internal` family images matching the Node.js and Chromium versions in Electron.** These images live inside the [`cypress-docker-images`](https://github.com/cypress-io/cypress-docker-images/) repository. The `browsers-internal` image will be used inside our CI pipelines. The `base-internal` image will be used by the `browsers-internal` image and possibly other system images (described below). For general use of Cypress in Docker, we encourage the use of the [Cypress Docker Factory](https://github.com/cypress-io/cypress-docker-images#cypressfactory). This works great for using Cypress as an end user, but doesn't fully suit the needs for developing Cypress, as we require:
- [ ] **Create and publish Docker `base-internal` and `browsers-internal` family images matching the Node.js and Chromium versions in Electron.** These images live inside the [`cypress-docker-images`](https://github.com/cypress-io/cypress-docker-images/) repository. The `browsers-internal` image will be used inside our CI pipelines. The `base-internal` image will be used by the `browsers-internal` image and possibly other system images (described below). The Chromium version can be determined from the [DEPS](https://github.com/electron/electron/blob/main/DEPS) file in Electron's repository on the correct tag. The Node version can be determined from the [Electron Releases page](https://www.electronjs.org/docs/latest/tutorial/electron-timelines). For general use of Cypress in Docker, we encourage the use of the [Cypress Docker Factory](https://github.com/cypress-io/cypress-docker-images#cypressfactory). This works great for using Cypress as an end user, but doesn't fully suit the needs for developing Cypress, as we require:
- The installation of packages, such as `curl`, `xauth`, and `build-essential`/`make` needed for our [`circleci`](../../.circleci/config.yml) jobs/pipelines.
- Specific images targeted to test Cypress on various node versions and distributions of linux, such as different versions of `ubuntu`.
@@ -45,19 +45,49 @@ Upgrading `electron` involves more than just bumping this package's `package.jso
- The Ubuntu images in [base-internal](https://github.com/cypress-io/cypress-docker-images/tree/master/base-internal) are updated to be used in the [system binary tests](../../system-tests/test-binary) if any of the following are true for the images used inside the system binary tests:
- The last two major [Ubuntu LTS Releases](https://ubuntu.com/about/release-cycle) are out-of-date.
- The [NodeJS](https://nodejs.org/en) version is not the active LTS.
- [ ] **Update `workflows.yml`**
- [ ] Ensure it references the new `base-internal` and `browsers-internal` Docker images
- [ ] Ensure the new Electron version is used as a build target in the `Build better-sqlite3 for CentOS 7` step
- [ ] **Ensure that a matching Node.js version is enforced in the monorepo for local development and CI.** When Electron is upgraded, oftentimes, the bundled Node.js version that comes with Electron is updated as well. Because all unit and integration tests run in normal Node.js (not Electron's Node.js), it's important for this Node.js version to be synced with the monorepo. There are a few places where this needs to be done:
- [ ] [`/.node-version`](../../.node-version) - used by `nvm` and other Node version managers
- [ ] `@types/node` used throughout the monorepo to determine compatible node types. The major version of this package must reflect the node version set in [`/.node-version`](../../.node-version).
- [ ] [github workflows](../../.github) - used for repository templates, vulnerability detection, and V8 snapshots. If the node version for Snyk needs to be updated, then the required pull request check into `develop` must also be updated. A repository administrator will need to accomplish this.
- [ ] [`/package.json`](../../package.json) - update `engines`
- [ ] [`/scripts/run-docker-local.sh`](../../scripts/run-docker-local.sh) - update Docker image to the new matching `browsers` image
- [ ] [`docker-compose.yml`](../../docker-compose.yml) - update Docker image to the new matching `browsers` image
- [ ] [`/system-tests/test-binary/*`](../../system-tests/test-binary) - update binary system tests to use the newly published Ubuntu and Node images mentioned above, if applicable
- [ ] [`/.circleci/config.yml`](../../.circleci/config.yml)
- Update the Docker `image`s to the new matching `browsers` image.
- Update the `xcode` version to one with the same major Node.js version bundled. There is usually not an exact match, this is ok as long as the major version number as the same.
- [ ] Do a global search for the old Node.js version to identify any new areas that may need updating/unification, and update those locations (and this document!)
- [ ] Do a global search for the old Node.js version to identify any new areas that may need updating/unification, and update those locations (and this document!)
- [ ] **Update `cypress-publish-binary`** For **binary publishing**, make sure the `electron` version that we updated in [`/package.json`](../../package.json) matches the `electron` version inside the [publish binary project](https://github.com/cypress-io/cypress-publish-binary/blob/main/package.json). This is to make sure add-on tests inside the publish-binary repository work locally, but are not required to install the correct version of `electron` in CI when publishing the binary. Ensure the `electron` target in this project's `.circleci` configuration is updated as well. Set the Remove this before merging, and ensure that branch is merged as well.
- [ ] Create a new branch in `cypress-publish-binary`
- [ ] Update `electron` version in `package.json`
- [ ] Update the target `electron` version in the circle configuration
- [ ] Update the docker image to the new browsers-internal image made in the previous step
- [ ] Temporarily update the circle configuration to allow `cypress` to run against the branch
- [ ] Temporarily set target `cypress-publish-binary` branch as a `branch` property on the request body in [../../scripts/binary/trigger-publish-binary-pipeline.js](../../scripts/binary/trigger-publish-binary-pipeline.js) script, so that you can test against this branch from the electron upgrade branch
- [ ] **Manually smoke test `cypress open`.** Upgrading Electron can break the `desktop-gui` in unexpected ways. Since testing in this area is weak, double-check that things like launching `cypress open`, signing into Cypress Cloud, and launching Electron tests still work.
- [ ] **Manually smoke test `cypress run` in record mode** Upgrading Electron can cause `better-sqlite3` to SIGSEGV the Electron process.
- [ ] **Fix failing tests.** Usually, these are due to breaking changes in either Node.js or Electron. Check the changelogs of both to find relevant changes.
- [ ] For **binary publishing**, make sure the `electron` version that we updated in [`/package.json`](../../package.json) matches the `electron` version inside the [publish binary project](https://github.com/cypress-io/cypress-publish-binary/blob/main/package.json). This is to make sure add-on tests inside the publish-binary repository work locally, but are not required to install the correct version of `electron` in CI when publishing the binary.
- [ ] If needed, update the **[V8 Snapshot Cache](https://github.com/cypress-io/cypress/actions/workflows/update_v8_snapshot_cache.yml)** by running the workflow. Make sure to use the branch that contains the electron updates to populate the `'workflow from'` and `'branch to update'` arguments. Select `'Generate from scratch'` and `'commit directly to branch'`. This will usually take 6-8 hours to complete and is best to not be actively developing on the branch when this workflow runs.
- [ ] If needed, update the **[V8 Snapshot Cache](https://github.com/cypress-io/cypress/actions/workflows/update_v8_snapshot_cache.yml)** by running the GitHub workflow. Make sure to use the branch that contains the electron updates to populate the `'workflow from'` and `'branch to update'` arguments. Select `'Generate from scratch'` and `'commit directly to branch'`. This will usually take 6-8 hours to complete and is best to not be actively developing on the branch when this workflow runs.
### Common Upgrade Issues
#### Integrity Check Failures
*Solution*: Update the string representation of `fs.readFileSync` in [scripts/binary/binary-integrity-check-source.js](../../scripts/binary/binary-integrity-check-source.js) to match the string generated by the new version of electron. Create a throw-away script and simply `console.log(fs.readFileSync.toString())`, and execute it with *Electron* rather than *Node*.
#### ResizeObserver errors in Component Test
*Solution*: This error is benign. From time to time, the error message we match against in order to swallow the error changes. Update the necessary support files with the new error message.
#### Electron crashes immediately after initializing the Protocol database
*Solution*: This is often due to a mismatched prebuild of `better-sqlite3`. Ensure your repository is clear of untracked files with `git clean -xfd`, and run `yarn` again. If the issue persists, ensure you are running the latest version of your operating system. Electron prebuilds key to darwin/linux/windows, and do not differentiate between versions of the same.

View File

@@ -82,7 +82,7 @@ function validateWithinViewport (subject: JQuery<HTMLElement>): Cypress.Chainabl
Cypress.Commands.add('validateWithinViewport', { prevSubject: true }, validateWithinViewport)
Cypress.on('uncaught:exception', (err) => !err.message.includes('ResizeObserver loop limit exceeded'))
Cypress.on('uncaught:exception', (err) => !err.message.includes('ResizeObserver loop completed with undelivered notifications.'))
registerMountFn()
addVueCommand()

View File

@@ -557,7 +557,7 @@ function getAutIframe () {
return cy.get('iframe.aut-iframe').its('0.contentDocument.documentElement').then(cy.wrap) as Cypress.Chainable<JQuery<HTMLIFrameElement>>
}
Cypress.on('uncaught:exception', (err) => !err.message.includes('ResizeObserver loop limit exceeded'))
Cypress.on('uncaught:exception', (err) => !err.message.includes('ResizeObserver loop completed with undelivered notifications.'))
Cypress.Commands.add('scaffoldProject', scaffoldProject)

View File

@@ -6,10 +6,23 @@ const path = require('path')
const { setupV8Snapshots } = require('@tooling/v8-snapshot')
const { flipFuses, FuseVersion, FuseV1Options } = require('@electron/fuses')
const { buildEntryPointAndCleanup, cleanupUnneededDependencies } = require('./binary/binary-cleanup')
const { getIntegrityCheckSource, getBinaryEntryPointSource, getEncryptionFileSource, getCloudEnvironmentFileSource, validateEncryptionFile, getProtocolFileSource, validateCloudEnvironmentFile, validateProtocolFile } = require('./binary/binary-sources')
const { getIntegrityCheckSource, getBinaryEntryPointSource, getBinaryByteNodeEntryPointSource, getEncryptionFileSource, getCloudEnvironmentFileSource, validateEncryptionFile, getProtocolFileSource, validateCloudEnvironmentFile, validateProtocolFile, getIndexJscHash, DUMMY_INDEX_JSC_HASH } = require('./binary/binary-sources')
const verify = require('../cli/lib/tasks/verify')
const execa = require('execa')
const meta = require('./binary/meta')
const CY_ROOT_DIR = path.join(__dirname, '..')
const createJscFromCypress = async () => {
const args = []
if (verify.needsSandbox()) {
args.push('--no-sandbox')
}
await execa(`${meta.buildAppExecutable()}`, args)
}
module.exports = async function (params) {
try {
console.log('****************************')
@@ -58,6 +71,7 @@ module.exports = async function (params) {
}
if (!['1', 'true'].includes(process.env.DISABLE_SNAPSHOT_REQUIRE)) {
const binaryByteNodeEntryPointSource = await getBinaryByteNodeEntryPointSource()
const binaryEntryPointSource = await getBinaryEntryPointSource()
const encryptionFilePath = path.join(CY_ROOT_DIR, 'packages/server/lib/cloud/encryption.ts')
const encryptionFileSource = await getEncryptionFileSource(encryptionFilePath)
@@ -76,6 +90,10 @@ module.exports = async function (params) {
fs.writeFile(path.join(outputFolder, 'index.js'), binaryEntryPointSource),
])
const integrityCheckSource = getIntegrityCheckSource(outputFolder)
await fs.writeFile(path.join(outputFolder, 'index.js'), binaryByteNodeEntryPointSource)
await Promise.all([
validateEncryptionFile(encryptionFilePath),
validateCloudEnvironmentFile(cloudEnvironmentFilePath),
@@ -87,6 +105,7 @@ module.exports = async function (params) {
exePathPerPlatform[os.platform()],
{
version: FuseVersion.V1,
resetAdHocDarwinSignature: os.platform() === 'darwin' && os.arch() === 'arm64',
[FuseV1Options.LoadBrowserProcessSpecificV8Snapshot]: true,
[FuseV1Options.EnableNodeCliInspectArguments]: false,
},
@@ -99,7 +118,34 @@ module.exports = async function (params) {
await cleanupUnneededDependencies(outputFolder)
await setupV8Snapshots({
cypressAppPath: params.appOutDir,
integrityCheckSource: getIntegrityCheckSource(outputFolder),
integrityCheckSource,
})
// Use Cypress to create the JSC entry point file
await createJscFromCypress()
const indexJscHash = await getIndexJscHash(outputFolder)
// This file is not needed at this point since it's been replaced by the jsc. So we remove it.
await fs.remove(path.join(outputFolder, 'packages/server/index.js'))
await fs.writeFile(path.join(outputFolder, 'index.js'), binaryEntryPointSource)
await flipFuses(
exePathPerPlatform[os.platform()],
{
version: FuseVersion.V1,
[FuseV1Options.LoadBrowserProcessSpecificV8Snapshot]: true,
[FuseV1Options.EnableNodeCliInspectArguments]: false,
},
)
// Regenerate the v8 snapshots. This time, we replace the JSC hash with what we calculated earlier. We use the existing snapshot script to avoid having to go through the entire v8 snapshot process
await setupV8Snapshots({
cypressAppPath: params.appOutDir,
useExistingSnapshotScript: true,
updateSnapshotScriptContents: (contents) => {
return contents.replace(DUMMY_INDEX_JSC_HASH, indexJscHash)
},
})
} else {
console.log(`value of DISABLE_SNAPSHOT_REQUIRE was ${process.env.DISABLE_SNAPSHOT_REQUIRE}. Skipping snapshot require...`)

View File

@@ -0,0 +1,13 @@
const compile = async () => {
const bytenode = await import('bytenode')
const path = require('path')
await bytenode.compileFile({
filename: path.join(__dirname, 'packages', 'server', 'index.js'),
output: path.join(__dirname, 'packages', 'server', 'index.jsc'),
})
}
compile().then(() => {
process.exit()
})

View File

@@ -142,19 +142,8 @@ const createServerEntryPointBundle = async (buildAppDir) => {
await fs.copy(path.join(workingDir, 'index.js'), path.join(buildAppDir, 'packages', 'server', 'index.js'))
console.log(`compiling server entry point bundle to ${path.join(buildAppDir, 'packages', 'server', 'index.jsc')}`)
// Use bytenode to compile the entry point bundle. This will save time on the v8 compile step and ensure the integrity of the entry point
const bytenode = await import('bytenode')
await bytenode.compileFile({
filename: path.join(buildAppDir, 'packages', 'server', 'index.js'),
output: path.join(buildAppDir, 'packages', 'server', 'index.jsc'),
electron: true,
})
// Convert these inputs to a relative file path. Note that these paths are posix paths.
return [...Object.keys(esbuildResult.metafile.inputs)].map((input) => `./${input}`)
return [...Object.keys(esbuildResult.metafile.inputs)].filter((input) => input !== 'packages/server/index.js').map((input) => `./${input}`)
}
const buildEntryPointAndCleanup = async (buildAppDir) => {

View File

@@ -94,7 +94,7 @@ function validateElectron (electron) {
function validateFs (fs) {
// Hard coded function as this is electron code and there's not an easy way to get the function string at package time. If this fails on an updated version of electron, we'll need to update this.
if (originalToString.call(fs.readFileSync) !== `function(e,s){const r=splitPath(e);if(!r.isAsar)return F.apply(this,arguments);const{asarPath:n,filePath:a}=r,o=getOrCreateArchive(n);if(!o)throw createError("INVALID_ARCHIVE",{asarPath:n});const c=o.getFileInfo(a);if(!c)throw createError("NOT_FOUND",{asarPath:n,filePath:a});if(0===c.size)return s?"":i.Buffer.alloc(0);if(c.unpacked){const e=o.copyFileOut(a);return t.readFileSync(e,s)}if(s){if("string"==typeof s)s={encoding:s};else if("object"!=typeof s)throw new TypeError("Bad arguments")}else s={encoding:null};const{encoding:f}=s,l=i.Buffer.alloc(c.size),u=o.getFdAndValidateIntegrityLater();if(!(u>=0))throw createError("NOT_FOUND",{asarPath:n,filePath:a});return logASARAccess(n,a,c.offset),t.readSync(u,l,0,c.size,c.offset),validateBufferIntegrity(l,c.integrity),f?l.toString(f):l}`) {
if (originalToString.call(fs.readFileSync) !== `function(e,s){const r=splitPath(e);if(!r.isAsar)return F.apply(this,arguments);const{asarPath:n,filePath:i}=r,o=getOrCreateArchive(n);if(!o)throw createError("INVALID_ARCHIVE",{asarPath:n});const c=o.getFileInfo(i);if(!c)throw createError("NOT_FOUND",{asarPath:n,filePath:i});if(0===c.size)return s?"":a.Buffer.alloc(0);if(c.unpacked){const e=o.copyFileOut(i);return t.readFileSync(e,s)}if(s){if("string"==typeof s)s={encoding:s};else if("object"!=typeof s)throw new TypeError("Bad arguments")}else s={encoding:null};const{encoding:f}=s,l=a.Buffer.alloc(c.size),u=o.getFdAndValidateIntegrityLater();if(!(u>=0))throw createError("NOT_FOUND",{asarPath:n,filePath:i});return logASARAccess(n,i,c.offset),t.readSync(u,l,0,c.size,c.offset),validateBufferIntegrity(l,c.integrity),f?l.toString(f):l}`) {
console.error(`Integrity check failed for toString.call(fs.readFileSync)`)
throw new Error(integrityErrorMessage)
}

View File

@@ -4,6 +4,8 @@ const path = require('path')
const esbuild = require('esbuild')
const escapeString = (string) => string.replaceAll(`\``, `\\\``).replaceAll(`$`, `\\$`)
const secret = require('crypto').randomBytes(48).toString('hex')
const DUMMY_INDEX_JSC_HASH = 'abcddcbaabcddcbaabcddcbaabcddcba'
function read (file) {
const pathToFile = require.resolve(`./${file}`)
@@ -24,22 +26,37 @@ const getBinaryEntryPointSource = async () => {
return esbuildResult.outputFiles[0].text
}
const getBinaryByteNodeEntryPointSource = async () => {
const esbuildResult = await esbuild.build({
entryPoints: [require.resolve('./binary-byte-node-entry-point-source.js')],
bundle: true,
platform: 'node',
write: false,
minify: true,
treeShaking: true,
})
return esbuildResult.outputFiles[0].text
}
const getIntegrityCheckSource = (baseDirectory) => {
const fileSource = read('binary-integrity-check-source.js')
const secret = require('crypto').randomBytes(48).toString('hex')
const mainIndexHash = crypto.createHmac('md5', secret).update(fs.readFileSync(path.join(baseDirectory, './index.js'), 'utf8')).digest('hex')
const indexJscHash = crypto.createHmac('md5', secret).update(fs.readFileSync(path.join(baseDirectory, './packages/server/index.jsc'), 'utf8')).digest('hex')
return fileSource.split('\n').join(`\n `)
.replaceAll('MAIN_INDEX_HASH', mainIndexHash)
.replaceAll('INDEX_JSC_HASH', indexJscHash)
.replaceAll('INDEX_JSC_HASH', DUMMY_INDEX_JSC_HASH)
.replaceAll('HMAC_SECRET', secret)
.replaceAll('CRYPTO_CREATE_HMAC_TO_STRING', escapeString(crypto.createHmac.toString()))
.replaceAll('CRYPTO_HMAC_UPDATE_TO_STRING', escapeString(crypto.Hmac.prototype.update.toString()))
.replaceAll('CRYPTO_HMAC_DIGEST_TO_STRING', escapeString(crypto.Hmac.prototype.digest.toString()))
}
const getIndexJscHash = (baseDirectory) => {
return crypto.createHmac('md5', secret).update(fs.readFileSync(path.join(baseDirectory, './packages/server/index.jsc'), 'utf8')).digest('hex')
}
const getEncryptionFileSource = async (encryptionFilePath) => {
const fileContents = await fs.readFile(encryptionFilePath, 'utf8')
@@ -102,6 +119,7 @@ const validateProtocolFile = async (protocolFilePath) => {
module.exports = {
getBinaryEntryPointSource,
getBinaryByteNodeEntryPointSource,
getIntegrityCheckSource,
getEncryptionFileSource,
validateEncryptionFile,
@@ -109,4 +127,6 @@ module.exports = {
validateCloudEnvironmentFile,
getProtocolFileSource,
validateProtocolFile,
getIndexJscHash,
DUMMY_INDEX_JSC_HASH,
}

View File

@@ -8,17 +8,13 @@ import electron from '../../packages/electron'
import la from 'lazy-ass'
import { promisify } from 'util'
import glob from 'glob'
import * as packages from './util/packages'
import * as meta from './meta'
import xvfb from '../../cli/lib/exec/xvfb'
import smoke from './smoke'
import { spawn, execSync } from 'child_process'
import { transformRequires } from './util/transform-requires'
import execa from 'execa'
import { testStaticAssets } from './util/testStaticAssets'
import performanceTracking from '../../system-tests/lib/performance'
import verify from '../../cli/lib/tasks/verify'
import * as electronBuilder from 'electron-builder'
const globAsync = promisify(glob)
@@ -307,26 +303,6 @@ export async function packageElectronApp (options: BuildCypressAppOpts) {
console.log(stdout)
// runSmokeTests
let usingXvfb = xvfb.isNeeded()
try {
if (usingXvfb) {
await xvfb.start()
}
log(`#testExecutableVersion ${meta.buildAppExecutable()}`)
await testExecutableVersion(meta.buildAppExecutable(), version)
const executablePath = meta.buildAppExecutable()
await smoke.test(executablePath, meta.buildAppDir())
} finally {
if (usingXvfb) {
await xvfb.stop()
}
}
// verifyAppCanOpen
if (platform === 'darwin' && !skipSigning) {
const appFolder = meta.zipDir()
@@ -417,26 +393,3 @@ async function testDistVersion (distDir: string, version: string) {
console.log('✅ using node --version works')
}
async function testExecutableVersion (buildAppExecutable: string, version: string) {
log('#testVersion')
console.log('testing built app executable version')
console.log(`by calling: ${buildAppExecutable} --version`)
const args = ['--version']
if (verify.needsSandbox()) {
args.push('--no-sandbox')
}
const result = await execa(buildAppExecutable, args)
la(result.stdout, 'missing output when getting built version', result)
console.log('built app version', result.stdout)
la(result.stdout.trim() === version.trim(), 'different version reported',
result.stdout, 'from input version to build', version)
console.log('✅ using --version on the Cypress binary works')
}

View File

@@ -23,6 +23,17 @@ const uploadUtils = require('./util/upload')
const { uploadArtifactToS3 } = require('./upload-build-artifact')
const { moveBinaries } = require('./move-binaries')
const { exec } = require('child_process')
const xvfb = require('../../cli/lib/exec/xvfb')
const smoke = require('./smoke')
const verify = require('../../cli/lib/tasks/verify')
const execa = require('execa')
const log = function (msg) {
const time = new Date()
const timeStamp = time.toLocaleTimeString()
console.log(timeStamp, chalk.yellow(msg), chalk.blue(meta.PLATFORM))
}
const success = (str) => {
return console.log(chalk.bgGreen(` ${chalk.black(str)} `))
@@ -50,6 +61,29 @@ const askMissingOptions = function (properties = []) {
return questionsRemain(pickedQuestions)
}
async function testExecutableVersion (buildAppExecutable, version) {
log('#testVersion')
console.log('testing built app executable version')
console.log(`by calling: ${buildAppExecutable} --version`)
const args = ['--version']
if (verify.needsSandbox()) {
args.push('--no-sandbox')
}
const result = await execa(buildAppExecutable, args)
la(result.stdout, 'missing output when getting built version', result)
console.log('built app version', result.stdout)
la(result.stdout.trim() === version.trim(), 'different version reported',
result.stdout, 'from input version to build', version)
console.log('✅ using --version on the Cypress binary works')
}
// hack for @packages/server modifying cwd
process.chdir(cwd)
@@ -214,6 +248,38 @@ const deploy = {
})
},
async smoke (options) {
console.log('#smoke')
if (options == null) {
options = this.parseOptions(process.argv)
}
debug('parsed build options %o', options)
await askMissingOptions(['version'])(options)
// runSmokeTests
let usingXvfb = xvfb.isNeeded()
try {
if (usingXvfb) {
await xvfb.start()
}
log(`#testExecutableVersion ${meta.buildAppExecutable()}`)
await testExecutableVersion(meta.buildAppExecutable(), options.version)
const executablePath = meta.buildAppExecutable()
await smoke.test(executablePath, meta.buildAppDir())
} finally {
if (usingXvfb) {
await xvfb.stop()
}
}
},
zip (options) {
console.log('#zip')
if (!options) {

View File

@@ -299,7 +299,7 @@ const runIntegrityTest = async function (buildAppExecutable, buildAppDir, e2e) {
console.error(`extra keys in electron process: ${extraKeys}`)
}
const allowList = ['regeneratorRuntime', '__core-js_shared__', 'getSnapshotResult', 'supportTypeScript']
const allowList = ['regeneratorRuntime', '__core-js_shared__', 'getSnapshotResult', 'supportTypeScript', 'Iterator']
await testAlteringEntryPoint(`(${compareGlobals.toString()})()`, `extra keys in electron process: ${allowList}\nIntegrity check failed with expected stack length 9 but got 10`)

View File

@@ -10,6 +10,7 @@ const { getNextVersionForBinary } = require('../get-next-version')
const { nextVersion } = await getNextVersionForBinary()
const body = JSON.stringify({
branch: 'cacie/upgrade-electron-27',
parameters: {
temp_dir: os.tmpdir(),
sha: process.env.CIRCLE_SHA1,

View File

@@ -786,9 +786,9 @@ exports['experimentalSingleTabRunMode / executes all specs in a single tab'] = `
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/1_fails.cy.js/simple failing spec -- fails (fai (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/1_fails.cy.js/simple failing spec -- fails (fai (1280x599)
led).png
- /XXX/XXX/XXX/cypress/screenshots/1_fails.cy.js/simple failing spec -- fails agai (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/1_fails.cy.js/simple failing spec -- fails agai (1280x599)
n (failed).png

View File

@@ -6784,50 +6784,6 @@ exports['component events - experimentalSingleTabRunMode: true'] = `
"pageLoading": [],
"resetTest": [],
"responseEndedWithEmptyBody": [
{
"requestId": "Any.Number",
"isCached": true,
"timings": {
"cdpRequestWillBeSentTimestamp": "Any.Number",
"cdpRequestWillBeSentReceivedTimestamp": "Any.Number",
"proxyRequestReceivedTimestamp": "Any.Number",
"cdpLagDuration": "Any.Number",
"proxyRequestCorrelationDuration": "Any.Number"
}
},
{
"requestId": "Any.Number",
"isCached": true,
"timings": {
"cdpRequestWillBeSentTimestamp": "Any.Number",
"cdpRequestWillBeSentReceivedTimestamp": "Any.Number",
"proxyRequestReceivedTimestamp": "Any.Number",
"cdpLagDuration": "Any.Number",
"proxyRequestCorrelationDuration": "Any.Number"
}
},
{
"requestId": "Any.Number",
"isCached": true,
"timings": {
"cdpRequestWillBeSentTimestamp": "Any.Number",
"cdpRequestWillBeSentReceivedTimestamp": "Any.Number",
"proxyRequestReceivedTimestamp": "Any.Number",
"cdpLagDuration": "Any.Number",
"proxyRequestCorrelationDuration": "Any.Number"
}
},
{
"requestId": "Any.Number",
"isCached": true,
"timings": {
"cdpRequestWillBeSentTimestamp": "Any.Number",
"cdpRequestWillBeSentReceivedTimestamp": "Any.Number",
"proxyRequestReceivedTimestamp": "Any.Number",
"cdpLagDuration": "Any.Number",
"proxyRequestCorrelationDuration": "Any.Number"
}
},
{
"requestId": "Any.Number",
"isCached": true,

View File

@@ -164,8 +164,8 @@ exports['retries / supports retries (chrome)'] = `
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/fail-twice.cy.js/fail twice (failed).png (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/fail-twice.cy.js/fail twice (failed) (attempt 2 (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/fail-twice.cy.js/fail twice (failed).png (1280x599)
- /XXX/XXX/XXX/cypress/screenshots/fail-twice.cy.js/fail twice (failed) (attempt 2 (1280x599)
).png

View File

@@ -82,7 +82,7 @@ We dynamically generated a new test to display this failure.
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/AppCompilationError.cy.jsx/An uncaught error wa (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/AppCompilationError.cy.jsx/An uncaught error wa (1280x599)
s detected outside of a test (failed).png
@@ -165,12 +165,12 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- error on mount (failed) (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- error on mount (failed) (1280x599)
.png
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- sync error (failed).png (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- async error (failed).pn (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- sync error (failed).png (1280x599)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- async error (failed).pn (1280x599)
g
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- command failure (failed (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- command failure (failed (1280x599)
).png
@@ -216,7 +216,7 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/MissingReact.cy.jsx/is missing React (failed).p (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/MissingReact.cy.jsx/is missing React (failed).p (1280x599)
ng
@@ -254,7 +254,7 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/MissingReactInSpec.cy.jsx/is missing React in t (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/MissingReactInSpec.cy.jsx/is missing React in t (1280x599)
his file (failed).png
@@ -485,7 +485,7 @@ We dynamically generated a new test to display this failure.
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/AppCompilationError.cy.jsx/An uncaught error wa (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/AppCompilationError.cy.jsx/An uncaught error wa (1280x599)
s detected outside of a test (failed).png
@@ -568,12 +568,12 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- error on mount (failed) (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- error on mount (failed) (1280x599)
.png
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- sync error (failed).png (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- async error (failed).pn (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- sync error (failed).png (1280x599)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- async error (failed).pn (1280x599)
g
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- command failure (failed (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- command failure (failed (1280x599)
).png
@@ -619,7 +619,7 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/MissingReact.cy.jsx/is missing React (failed).p (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/MissingReact.cy.jsx/is missing React (failed).p (1280x599)
ng
@@ -657,7 +657,7 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/MissingReactInSpec.cy.jsx/is missing React in t (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/MissingReactInSpec.cy.jsx/is missing React in t (1280x599)
his file (failed).png
@@ -888,7 +888,7 @@ We dynamically generated a new test to display this failure.
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/AppCompilationError.cy.jsx/An uncaught error wa (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/AppCompilationError.cy.jsx/An uncaught error wa (1280x599)
s detected outside of a test (failed).png
@@ -971,12 +971,12 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- error on mount (failed) (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- error on mount (failed) (1280x599)
.png
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- sync error (failed).png (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- async error (failed).pn (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- sync error (failed).png (1280x599)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- async error (failed).pn (1280x599)
g
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- command failure (failed (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- command failure (failed (1280x599)
).png
@@ -1022,7 +1022,7 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/MissingReact.cy.jsx/is missing React (failed).p (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/MissingReact.cy.jsx/is missing React (failed).p (1280x599)
ng
@@ -1060,7 +1060,7 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/MissingReactInSpec.cy.jsx/is missing React in t (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/MissingReactInSpec.cy.jsx/is missing React in t (1280x599)
his file (failed).png
@@ -1291,7 +1291,7 @@ We dynamically generated a new test to display this failure.
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/AppCompilationError.cy.jsx/An uncaught error wa (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/AppCompilationError.cy.jsx/An uncaught error wa (1280x599)
s detected outside of a test (failed).png
@@ -1374,12 +1374,12 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- error on mount (failed) (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- error on mount (failed) (1280x599)
.png
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- sync error (failed).png (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- async error (failed).pn (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- sync error (failed).png (1280x599)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- async error (failed).pn (1280x599)
g
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- command failure (failed (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- command failure (failed (1280x599)
).png
@@ -1425,7 +1425,7 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/MissingReact.cy.jsx/is missing React (failed).p (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/MissingReact.cy.jsx/is missing React (failed).p (1280x599)
ng
@@ -1463,7 +1463,7 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/MissingReactInSpec.cy.jsx/is missing React in t (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/MissingReactInSpec.cy.jsx/is missing React in t (1280x599)
his file (failed).png

View File

@@ -321,7 +321,7 @@ We dynamically generated a new test to display this failure.
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/AppCompilationError.cy.jsx/An uncaught error wa (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/AppCompilationError.cy.jsx/An uncaught error wa (1280x599)
s detected outside of a test (failed).png
@@ -404,12 +404,12 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- error on mount (failed) (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- error on mount (failed) (1280x599)
.png
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- sync error (failed).png (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- async error (failed).pn (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- sync error (failed).png (1280x599)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- async error (failed).pn (1280x599)
g
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- command failure (failed (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- command failure (failed (1280x599)
).png
@@ -455,7 +455,7 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/MissingReact.cy.jsx/is missing React (failed).p (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/MissingReact.cy.jsx/is missing React (failed).p (1280x599)
ng
@@ -493,7 +493,7 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/MissingReactInSpec.cy.jsx/is missing React in t (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/MissingReactInSpec.cy.jsx/is missing React in t (1280x599)
his file (failed).png
@@ -744,7 +744,7 @@ We dynamically generated a new test to display this failure.
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/AppCompilationError.cy.jsx/An uncaught error wa (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/AppCompilationError.cy.jsx/An uncaught error wa (1280x599)
s detected outside of a test (failed).png
@@ -827,12 +827,12 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- error on mount (failed) (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- error on mount (failed) (1280x599)
.png
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- sync error (failed).png (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- async error (failed).pn (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- sync error (failed).png (1280x599)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- async error (failed).pn (1280x599)
g
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- command failure (failed (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- command failure (failed (1280x599)
).png
@@ -878,7 +878,7 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/MissingReact.cy.jsx/is missing React (failed).p (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/MissingReact.cy.jsx/is missing React (failed).p (1280x599)
ng
@@ -916,7 +916,7 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/MissingReactInSpec.cy.jsx/is missing React in t (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/MissingReactInSpec.cy.jsx/is missing React in t (1280x599)
his file (failed).png
@@ -1158,7 +1158,7 @@ We dynamically generated a new test to display this failure.
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/AppCompilationError.cy.jsx/An uncaught error wa (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/AppCompilationError.cy.jsx/An uncaught error wa (1280x599)
s detected outside of a test (failed).png
@@ -1241,12 +1241,12 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- error on mount (failed) (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- error on mount (failed) (1280x599)
.png
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- sync error (failed).png (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- async error (failed).pn (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- sync error (failed).png (1280x599)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- async error (failed).pn (1280x599)
g
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- command failure (failed (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- command failure (failed (1280x599)
).png
@@ -1292,7 +1292,7 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/MissingReact.cy.jsx/is missing React (failed).p (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/MissingReact.cy.jsx/is missing React (failed).p (1280x599)
ng
@@ -1330,7 +1330,7 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/MissingReactInSpec.cy.jsx/is missing React in t (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/MissingReactInSpec.cy.jsx/is missing React in t (1280x599)
his file (failed).png
@@ -1584,7 +1584,7 @@ We dynamically generated a new test to display this failure.
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/AppCompilationError.cy.jsx/An uncaught error wa (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/AppCompilationError.cy.jsx/An uncaught error wa (1280x599)
s detected outside of a test (failed).png
@@ -1667,12 +1667,12 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- error on mount (failed) (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- error on mount (failed) (1280x599)
.png
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- sync error (failed).png (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- async error (failed).pn (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- sync error (failed).png (1280x599)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- async error (failed).pn (1280x599)
g
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- command failure (failed (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/Errors.cy.jsx/Errors -- command failure (failed (1280x599)
).png
@@ -1718,7 +1718,7 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/MissingReact.cy.jsx/is missing React (failed).p (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/MissingReact.cy.jsx/is missing React (failed).p (1280x599)
ng
@@ -1756,7 +1756,7 @@ https://on.cypress.io/uncaught-exception-from-application
(Screenshots)
- /XXX/XXX/XXX/cypress/screenshots/MissingReactInSpec.cy.jsx/is missing React in t (1280x603)
- /XXX/XXX/XXX/cypress/screenshots/MissingReactInSpec.cy.jsx/is missing React in t (1280x599)
his file (failed).png

View File

@@ -248,7 +248,7 @@ export const expectCorrectModuleApiResult = (json, opts: {
run,
'stats.duration',
wallClocks,
wallClocks + 600, // add 600ms to account for padding
wallClocks + 1000, // add 600ms to account for padding
1234,
)
@@ -256,7 +256,7 @@ export const expectCorrectModuleApiResult = (json, opts: {
run,
'reporterStats.duration',
wallClocks,
wallClocks + 600, // add 600ms to account for padding
wallClocks + 1000, // add 600ms to account for padding
1234,
)

View File

@@ -16,7 +16,7 @@ describe('windowSize', () => {
// availHeight: top.screen.availHeight,
}).deep.eq({
innerWidth: 1280,
innerHeight: 603,
innerHeight: 599, // chrome 118 reduced the size here from 603 to 599
// screenWidth: 1280,
// screenHeight: 603,
// availWidth: 1280,

View File

@@ -3,7 +3,7 @@ import systemTests from '../lib/system-tests'
describe('module API', () => {
systemTests.it('can run module API Mocha spec', {
timeout: 240000,
dockerImage: 'cypress/base-internal:18.15.0',
dockerImage: 'cypress/base-internal:18.17.1',
withBinary: true,
project: 'module-api',
browser: 'electron',

View File

@@ -33,7 +33,7 @@ describe('binary node versions', () => {
describe('type: module', () => {
[
'cypress/base:18.6.0',
'cypress/base:18.15.0',
'cypress/base:20.5.0',
].forEach((dockerImage) => {
systemTests.it(`can run in ${dockerImage}`, {

View File

@@ -1064,6 +1064,8 @@
"./node_modules/@cypress/commit-info/src/index.js",
"./node_modules/@cypress/commit-info/src/utils.js",
"./node_modules/@cypress/get-windows-proxy/node_modules/debug/src/common.js",
"./node_modules/@cypress/get-windows-proxy/node_modules/registry-js/dist/lib/index.js",
"./node_modules/@cypress/get-windows-proxy/node_modules/registry-js/dist/lib/registry.js",
"./node_modules/@cypress/get-windows-proxy/src/index.js",
"./node_modules/@cypress/parse-domain/build/tries/icann.complete.json",
"./node_modules/@cypress/parse-domain/build/tries/private.complete.json",
@@ -3179,6 +3181,8 @@
"./node_modules/recast/parsers/babel.js",
"./node_modules/recast/parsers/esprima.js",
"./node_modules/recast/parsers/typescript.js",
"./node_modules/registry-js/dist/lib/index.js",
"./node_modules/registry-js/dist/lib/registry.js",
"./node_modules/request-promise-core/configure/request2.js",
"./node_modules/request-promise-core/errors.js",
"./node_modules/request-promise-core/lib/errors.js",
@@ -4312,5 +4316,5 @@
"./tooling/v8-snapshot/cache/darwin/snapshot-entry.js"
],
"deferredHashFile": "yarn.lock",
"deferredHash": "639592455164ce2c6efa4bae985b1c948e2b301ce0857a7653feeb2d6ace1ef7"
"deferredHash": "4aadec3ebe54a4c84b842e08ede20eaf495534d28f4555eb7933d651e6742e07"
}

View File

@@ -4315,5 +4315,5 @@
"./tooling/v8-snapshot/cache/linux/snapshot-entry.js"
],
"deferredHashFile": "yarn.lock",
"deferredHash": "639592455164ce2c6efa4bae985b1c948e2b301ce0857a7653feeb2d6ace1ef7"
"deferredHash": "4aadec3ebe54a4c84b842e08ede20eaf495534d28f4555eb7933d651e6742e07"
}

View File

@@ -4315,5 +4315,5 @@
"./tooling/v8-snapshot/cache/win32/snapshot-entry.js"
],
"deferredHashFile": "yarn.lock",
"deferredHash": "d259022089e888426ee01b62b1116c69b1f34386814fb5dcd5df3699037e2be8"
"deferredHash": "aa7ca4b10c9c571cb3ac1a0dd1a04076a20ba1e8508ece952c63861804974c69"
}

View File

@@ -86,6 +86,8 @@ export type GenerationOpts = {
minify: boolean
supportTypeScript: boolean
integrityCheckSource: string | undefined
useExistingSnapshotScript?: boolean
updateSnapshotScriptContents?: (contents: string) => string
}
function getDefaultGenerationOpts (projectBaseDir: string): GenerationOpts {
@@ -98,6 +100,8 @@ function getDefaultGenerationOpts (projectBaseDir: string): GenerationOpts {
minify: false,
supportTypeScript: false,
integrityCheckSource: undefined,
useExistingSnapshotScript: false,
updateSnapshotScriptContents: undefined,
}
}
@@ -153,6 +157,14 @@ export class SnapshotGenerator {
* Path where v8context bin is stored, derived from {@link GenerationOpts} snapshotBinDir
*/
private v8ContextFile?: string
/**
* Whether to use an existing snapshot script instead of creating a new one.
*/
useExistingSnapshotScript?: boolean
/**
* Function to update the contents of an existing snapshot script.
*/
updateSnapshotScriptContents?: ((contents: string) => string)
/**
* Generated snapshot script, needs to be set before calling `makeSnapshot`.
@@ -186,6 +198,8 @@ export class SnapshotGenerator {
nodeEnv,
minify,
integrityCheckSource,
useExistingSnapshotScript,
updateSnapshotScriptContents,
}: GenerationOpts = Object.assign(
getDefaultGenerationOpts(projectBaseDir),
opts,
@@ -210,6 +224,8 @@ export class SnapshotGenerator {
this.bundlerPath = getBundlerPath()
this.minify = minify
this.integrityCheckSource = integrityCheckSource
this.useExistingSnapshotScript = useExistingSnapshotScript
this.updateSnapshotScriptContents = updateSnapshotScriptContents
const auxiliaryDataKeys = Object.keys(this.auxiliaryData || {})
@@ -235,6 +251,19 @@ export class SnapshotGenerator {
* Creates the snapshot script for the provided configuration
*/
async createScript () {
if (this.useExistingSnapshotScript) {
let contents = await fs.promises.readFile(this.snapshotScriptPath, 'utf8')
if (this.updateSnapshotScriptContents) {
contents = this.updateSnapshotScriptContents(contents)
}
this.snapshotScript = Buffer.from(contents)
await fs.promises.writeFile(this.snapshotScriptPath, this.snapshotScript)
return
}
let deferred
let norewrite

View File

@@ -1,6 +1,6 @@
import path from 'path'
type SnapshotConfig = {
export type SnapshotConfig = {
appEntryFile: string
cypressAppSnapshotDir: string
nodeModulesOnly: boolean
@@ -11,6 +11,8 @@ type SnapshotConfig = {
metaFile: string
minify: boolean
integrityCheckSource: string | undefined
useExistingSnapshotScript?: boolean
updateSnapshotScriptContents?: (contents: string) => string
}
const platformString = process.platform
@@ -74,11 +76,15 @@ export function createConfig ({
cypressAppPath,
integrityCheckSource,
supportCypressInCypress,
useExistingSnapshotScript,
updateSnapshotScriptContents,
}: {
env?: 'dev' | 'prod'
cypressAppPath?: string
integrityCheckSource: string | undefined
supportCypressInCypress?: boolean
useExistingSnapshotScript?: boolean
updateSnapshotScriptContents?: (contents: string) => string
}): SnapshotConfig {
/**
* If true only node_module dependencies are included in the snapshot. Otherwise app files are included as well
@@ -105,6 +111,8 @@ export function createConfig ({
snapshotEntryFile,
minify,
integrityCheckSource,
useExistingSnapshotScript,
updateSnapshotScriptContents,
}
}

View File

@@ -5,10 +5,10 @@ import minimist from 'minimist'
import { generateEntry } from './generate-entry'
import { installSnapshot } from './install-snapshot'
const setupV8Snapshots = async ({ cypressAppPath, integrityCheckSource, supportCypressInCypress }: { cypressAppPath?: string, integrityCheckSource?: string, supportCypressInCypress?: boolean} = {}) => {
const setupV8Snapshots = async ({ cypressAppPath, integrityCheckSource, supportCypressInCypress, useExistingSnapshotScript, updateSnapshotScriptContents }: { cypressAppPath?: string, integrityCheckSource?: string, supportCypressInCypress?: boolean, useExistingSnapshotScript?: boolean, updateSnapshotScriptContents?: (contents: string) => string } = {}) => {
try {
const args = minimist(process.argv.slice(2))
const config = createConfig({ env: args.env, cypressAppPath, integrityCheckSource, supportCypressInCypress })
const config = createConfig({ env: args.env, cypressAppPath, integrityCheckSource, supportCypressInCypress, useExistingSnapshotScript, updateSnapshotScriptContents })
await consolidateDeps(config)

View File

@@ -3,6 +3,7 @@ import { SnapshotGenerator } from '../generator/snapshot-generator'
import { prettyPrintError } from '../utils'
import fs from 'fs-extra'
import forceNoRewrite from './force-no-rewrite'
import type { SnapshotConfig } from './config'
const debug = require('debug')
const logInfo = debug('cypress:snapgen:info')
@@ -16,6 +17,8 @@ function getSnapshotGenerator ({
resolverMap,
minify,
integrityCheckSource,
useExistingSnapshotScript,
updateSnapshotScriptContents,
}: {
nodeModulesOnly: boolean
projectBaseDir: string
@@ -24,6 +27,8 @@ function getSnapshotGenerator ({
resolverMap: Record<string, string>
minify: boolean
integrityCheckSource: string | undefined
useExistingSnapshotScript?: boolean
updateSnapshotScriptContents?: (contents: string) => string
}) {
return new SnapshotGenerator(projectBaseDir, snapshotEntryFile, {
cacheDir: snapshotCacheDir,
@@ -32,6 +37,8 @@ function getSnapshotGenerator ({
forceNoRewrite,
minify,
integrityCheckSource,
useExistingSnapshotScript,
updateSnapshotScriptContents,
})
}
@@ -44,7 +51,10 @@ function getSnapshotGenerator ({
* @param {Partial<import('../snapconfig').SnapshotConfig>} opts
*/
export async function installSnapshot (
{
config: SnapshotConfig,
resolverMap,
) {
const {
cypressAppSnapshotDir,
nodeModulesOnly,
projectBaseDir,
@@ -52,9 +62,10 @@ export async function installSnapshot (
snapshotEntryFile,
minify,
integrityCheckSource,
},
resolverMap,
) {
useExistingSnapshotScript,
updateSnapshotScriptContents,
} = config
try {
logInfo('Generating snapshot %o', {
nodeModulesOnly,
@@ -68,6 +79,8 @@ export async function installSnapshot (
resolverMap,
minify,
integrityCheckSource,
useExistingSnapshotScript,
updateSnapshotScriptContents,
})
await snapshotGenerator.createScript()

View File

@@ -14266,10 +14266,10 @@ electron-to-chromium@^1.4.477:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.480.tgz#40e32849ca50bc23ce29c1516c5adb3fddac919d"
integrity sha512-IXTgg+bITkQv/FLP9FjX6f9KFCs5hQWeh5uNSKxB9mqYj/JXhHDbu+ekS43LVvbkL3eW6/oZy4+r9Om6lan1Uw==
electron@25.8.4:
version "25.8.4"
resolved "https://registry.yarnpkg.com/electron/-/electron-25.8.4.tgz#b50877aac7d96323920437baf309ad86382cb455"
integrity sha512-hUYS3RGdaa6E1UWnzeGnsdsBYOggwMMg4WGxNGvAoWtmRrr6J1BsjFW/yRq4WsJHJce2HdzQXtz4OGXV6yUCLg==
electron@27.1.3:
version "27.1.3"
resolved "https://registry.yarnpkg.com/electron/-/electron-27.1.3.tgz#3fd6decda95c1dd0a7e51a9ac77ee0ba37b7c5c6"
integrity sha512-7eD8VMhhlL5J531OOawn00eMthUkX1e3qN5Nqd7eMK8bg5HxQBrn8bdPlvUEnCano9KhrVwaDnGeuzWoDOGpjQ==
dependencies:
"@electron/get" "^2.0.0"
"@types/node" "^18.11.18"