Skip to content

Commit

Permalink
Merge branch 'develop' into renovate/cypress-design-vue-button-0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-shehane authored Apr 16, 2024
2 parents 581c47a + 768afcc commit cadf590
Show file tree
Hide file tree
Showing 43 changed files with 793 additions and 522 deletions.
2 changes: 1 addition & 1 deletion .circleci/cache-version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Bump this version to force CI to re-create the cache from scratch.

04-2-24
04-15-24-macstadium-3
48 changes: 21 additions & 27 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ macWorkflowFilters: &darwin-workflow-filters
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'cacie/dep/electron-27', << pipeline.git.branch >> ]
- equal: [ 'feat/protocol_shadow_dom_support', << pipeline.git.branch >> ]
- equal: [ 'ryanm/fix/service-worker-capture', << pipeline.git.branch >> ]
- equal: [ 'chore/move_off_circle_to_macstadium_amd64', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -58,7 +58,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
- equal: [ 'cacie/dep/electron-27', << pipeline.git.branch >> ]
- equal: [ 'feat/protocol_shadow_dom_support', << pipeline.git.branch >> ]
- equal: [ 'em/circle2', << pipeline.git.branch >> ]
- equal: [ 'chore/move_off_circle_to_macstadium_amd64', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -84,7 +84,7 @@ windowsWorkflowFilters: &windows-workflow-filters
- equal: [ 'cacie/dep/electron-27', << pipeline.git.branch >> ]
- equal: [ 'feat/protocol_shadow_dom_support', << pipeline.git.branch >> ]
- equal: [ 'lerna-optimize-tasks', << pipeline.git.branch >> ]
- equal: [ 'chore/reduce_windows_flake', << pipeline.git.branch >> ]
- equal: [ 'chore/move_off_circle_to_macstadium_amd64', << pipeline.git.branch >> ]
- matches:
pattern: /^release\/\d+\.\d+\.\d+$/
value: << pipeline.git.branch >>
Expand All @@ -111,11 +111,8 @@ executors:
# executor to run on Mac OS
# https://circleci.com/docs/2.0/executor-types/#using-macos
# https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions
mac:
macos:
# Executor should have Node >= required version
xcode: "14.0.1"
resource_class: macos.x86.medium.gen2
darwin-amd64:
machine: true
environment:
PLATFORM: darwin

Expand Down Expand Up @@ -154,7 +151,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" != "feat/protocol_shadow_dom_support" && "$CIRCLE_BRANCH" != "cacie/dep/electron-27" ]]; then
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "publish-binary" && "$CIRCLE_BRANCH" != "feat/protocol_shadow_dom_support" && "$CIRCLE_BRANCH" != "chore/move_off_circle_to_macstadium_amd64" ]]; 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
Expand Down Expand Up @@ -2262,6 +2259,7 @@ jobs:
resource_class:
type: string
default: medium+
resource_class: << parameters.resource_class >>
steps:
- restore_cached_workspace
- clone-repo-and-checkout-branch:
Expand Down Expand Up @@ -3364,15 +3362,15 @@ darwin-x64-workflow: &darwin-x64-workflow
jobs:
- node_modules_install:
name: darwin-x64-node-modules-install
executor: mac
resource_class: macos.x86.medium.gen2
executor: darwin-amd64
resource_class: cypress-io/intel-macstadium
only-cache-for-root-user: true

- build:
name: darwin-x64-build
context: test-runner:env-canary
executor: mac
resource_class: macos.x86.medium.gen2
executor: darwin-amd64
resource_class: cypress-io/intel-macstadium
requires:
- darwin-x64-node-modules-install

Expand All @@ -3383,33 +3381,29 @@ darwin-x64-workflow: &darwin-x64-workflow
- test-runner:upload
- test-runner:commit-status-checks
- test-runner:build-binary
executor: mac
resource_class: macos.x86.medium.gen2
requires:
- darwin-x64-build

- test-kitchensink:
name: darwin-x64-test-kitchensink
executor: mac
executor: darwin-amd64
resource_class: cypress-io/intel-macstadium
requires:
- darwin-x64-build

- v8-integration-tests:
name: darwin-x64-v8-integration-tests
executor: mac
resource_class: macos.x86.medium.gen2
executor: darwin-amd64
resource_class: cypress-io/intel-macstadium
requires:
- darwin-x64-build

- driver-integration-memory-tests:
name: darwin-x64-driver-integration-memory-tests
executor: mac
resource_class: macos.x86.medium.gen2
executor: darwin-amd64
resource_class: cypress-io/intel-macstadium
requires:
- darwin-x64-build

- server-unit-tests-cloud-environment:
name: darwin-x64-driver-server-unit-tests-cloud-environment
executor: mac
resource_class: macos.x86.medium.gen2
executor: darwin-amd64
resource_class: cypress-io/intel-macstadium
requires:
- darwin-x64-build

Expand Down
24 changes: 22 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,28 @@ You must have the following installed on your system to contribute locally:
- [`Node.js`](https://nodejs.org/en/) (See the root [.node-version](.node-version) file for the required version. You can find a list of tools on [node-version-usage](https://github.com/shadowspawn/node-version-usage) to switch the version of [`Node.js`](https://nodejs.org/en/) based on [.node-version](.node-version).)
- [`yarn`](https://yarnpkg.com/en/docs/install)
- [`python`](https://www.python.org/downloads/) (since we use `node-gyp`. See their [repo](https://github.com/nodejs/node-gyp) for Python version requirements. Use Python `3.11` or lower.)
- Note for Debian-based systems: `python` is pre-installed.<br>`sudo apt install g++ make` meets the additional requirements to run `node-gyp` in the context of building Cypress from source.
- Note for Windows systems: when installing the Visual Studio C++ environment recommended by [node-gyp](https://github.com/nodejs/node-gyp), install also a Windows 10 SDK. The currently used version of `node-gyp` may otherwise fail to recognise the Visual Studio installation.

#### Debian/Ubuntu

`sudo apt install g++ make` meets the additional requirements to run `node-gyp` in the context of building Cypress from source.
`python` is pre-installed on Debian-based systems including Ubuntu.
The Python versions shipped with Ubuntu versions `20.04`, `23.10` and `22.04` are compatible with Cypress requirements.

Only on Ubuntu `24.04` install Python `3.11` by executing the following command:

```shell
sudo apt install python3.11
```

Add the environment variable `NODE_GYP_FORCE_PYTHON` to `~/.bashrc`:

```shell
export NODE_GYP_FORCE_PYTHON=/usr/bin/python3.11
```

#### Windows

When installing the Visual Studio C++ environment recommended by [node-gyp](https://github.com/nodejs/node-gyp), install also a Windows 10 SDK. The currently used version of `node-gyp` may otherwise fail to recognise the Visual Studio installation.

### Getting Started

Expand Down
16 changes: 15 additions & 1 deletion cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
## 13.7.3
## 13.7.4

_Released 4/16/2024 (PENDING)_

**Misc:**

- We now capture the [Semaphore](https://semaphoreci.com/) CI provider's environment variable [`SEMAPHORE_GIT_PR_NUMBER`](https://docs.semaphoreci.com/ci-cd-environment/environment-variables/#semaphore_git_pr_number) to display the linked PR number in the Cloud. Addressed in [#29314](https://github.com/cypress-io/cypress/pull/29314).

## 13.7.3

_Released 4/11/2024_

**Bugfixes:**

- Fixed an issue where asserts with custom messages weren't displaying properly. Fixes [#29167](https://github.com/cypress-io/cypress/issues/29167).
- Fixed and issue where Cypress launch arguments were not being escaped correctly with multiple values inside quotes. Fixes [#27454](https://github.com/cypress-io/cypress/issues/27454).

**Misc:**

- Updated the Chrome flags to not show the "Enhanced Ad Privacy" dialog. Addresses [#29199](https://github.com/cypress-io/cypress/issues/29199).
- Suppresses benign warnings that reference Vulkan on GPU-less hosts. Addresses [#29085](https://github.com/cypress-io/cypress/issues/29085). Addressed in [#29278](https://github.com/cypress-io/cypress/pull/29278).

## 13.7.2

Expand Down
34 changes: 33 additions & 1 deletion cli/lib/exec/spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const cp = require('child_process')
const path = require('path')
const Promise = require('bluebird')
const debug = require('debug')('cypress:cli')
const debugVerbose = require('debug')('cypress-verbose:cli')

const util = require('../util')
const state = require('../tasks/state')
Expand Down Expand Up @@ -43,7 +44,36 @@ const isCertVerifyProcBuiltin = /(^\[.*ERROR:cert_verify_proc_builtin\.cc|^-----
// objc[60540]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x7ffa5a006318) and /{path/to/app}/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib (0x10f8a89c8). One of the two will be used. Which one is undefined.
const isMacOSElectronWebSwapCGLLayerWarning = /^objc\[\d+\]: Class WebSwapCGLLayer is implemented in both.*Which one is undefined\./

const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe, isRenderWorkerRe, isDbusWarning, isCertVerifyProcBuiltin, isMacOSElectronWebSwapCGLLayerWarning]
/**
* Electron logs benign warnings about Vulkan when run on hosts that do not have a GPU. This is coming from the primary Electron process,
* and not the browser being used for tests.
* Samples:
* Warning: loader_scanned_icd_add: Driver /usr/lib/x86_64-linux-gnu/libvulkan_intel.so supports Vulkan 1.2, but only supports loader interface version 4. Interface version 5 or newer required to support this version of Vulkan (Policy #LDP_DRIVER_7)
* Warning: loader_scanned_icd_add: Driver /usr/lib/x86_64-linux-gnu/libvulkan_lvp.so supports Vulkan 1.1, but only supports loader interface version 4. Interface version 5 or newer required to support this version of Vulkan (Policy #LDP_DRIVER_7)
* Warning: loader_scanned_icd_add: Driver /usr/lib/x86_64-linux-gnu/libvulkan_radeon.so supports Vulkan 1.2, but only supports loader interface version 4. Interface version 5 or newer required to support this verison of Vulkan (Policy #LDP_DRIVER_7)
* Warning: Layer VK_LAYER_MESA_device_select uses API version 1.2 which is older than the application specified API version of 1.3. May cause issues.
*/

const isHostVulkanDriverWarning = /^Warning:.+(#LDP_DRIVER_7|VK_LAYER_MESA_device_select).+/

/**
* Electron logs benign warnings about Vulkan when run in docker containers whose host does not have a GPU. This is coming from the primary
* Electron process, and not the browser being used for tests.
* Sample:
* Warning: vkCreateInstance: Found no drivers!
* Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER
* at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/vulkan/VulkanError.cpp:88)
* at CreateVkInstance (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:458)
* at Initialize (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:344)
* at Create (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:266)
* at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:521)
*/

const isContainerVulkanDriverWarning = /^Warning: vkCreateInstance/

const isContainerVulkanStack = /^\s*at (CheckVkSuccessImpl|CreateVkInstance|Initialize|Create|operator).+(VulkanError|BackendVk).cpp/

const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe, isRenderWorkerRe, isDbusWarning, isCertVerifyProcBuiltin, isMacOSElectronWebSwapCGLLayerWarning, isHostVulkanDriverWarning, isContainerVulkanDriverWarning, isContainerVulkanStack]

const isGarbageLineWarning = (str) => {
return _.some(GARBAGE_WARNINGS, (re) => {
Expand Down Expand Up @@ -230,6 +260,8 @@ module.exports = {

// bail if this is warning line garbage
if (isGarbageLineWarning(str)) {
debugVerbose(str)

return
}

Expand Down
13 changes: 13 additions & 0 deletions cli/test/lib/exec/spawn_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ describe('lib/exec/spawn', function () {
ERROR: No matching issuer found
objc[60540]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x7ffa5a006318) and /{path/to/app}/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib (0x10f8a89c8). One of the two will be used. Which one is undefined.
Warning: loader_scanned_icd_add: Driver /usr/lib/x86_64-linux-gnu/libvulkan_intel.so supports Vulkan 1.2, but only supports loader interface version 4. Interface version 5 or newer required to support this version of Vulkan (Policy #LDP_DRIVER_7)
Warning: loader_scanned_icd_add: Driver /usr/lib/x86_64-linux-gnu/libvulkan_lvp.so supports Vulkan 1.1, but only supports loader interface version 4. Interface version 5 or newer required to support this version of Vulkan (Policy #LDP_DRIVER_7)
Warning: loader_scanned_icd_add: Driver /usr/lib/x86_64-linux-gnu/libvulkan_radeon.so supports Vulkan 1.2, but only supports loader interface version 4. Interface version 5 or newer required to support this verison of Vulkan (Policy #LDP_DRIVER_7)
Warning: Layer VK_LAYER_MESA_device_select uses API version 1.2 which is older than the application specified API version of 1.3. May cause issues.
Warning: vkCreateInstance: Found no drivers!
Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER
at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/vulkan/VulkanError.cpp:88)
at CreateVkInstance (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:458)
at Initialize (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:344)
at Create (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:266)
at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:521)
`

const lines = _
Expand Down
2 changes: 1 addition & 1 deletion cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3057,7 +3057,7 @@ declare namespace Cypress {
*/
video: boolean
/**
* Whether Chrome Web Security for same-origin policy and insecure mixed content is enabled. Read more about this here
* Whether Chrome Web Security for same-origin policy and insecure mixed content is enabled. Read more about this [here](https://on.cypress.io/web-security#Disabling-Web-Security)
* @default true
*/
chromeWebSecurity: boolean
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cypress",
"version": "13.7.2",
"version": "13.7.3",
"description": "Cypress is a next generation front end testing tool built for the modern web",
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/cypress/e2e/runner/cloud-debug-filter.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('cloud debug test filtering', () => {

cy.get('.debug-dismiss').contains('2 / 4 tests').click().waitForSpecToFinish()

// suite.only is respected
// suite only is respected
cy.withCtx((ctx) => {
ctx.coreData.cloudProject.testsForRunResults = {
'cypress/e2e/skip-and-only.cy.js': ['t3', 's1 t4'],
Expand Down
9 changes: 8 additions & 1 deletion packages/driver/cypress/e2e/issues/1244.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ describe('issue 1244', () => {

// not all pages that get unloaded during this spec have getCounters()
if (win.location.href.includes('issue-1244.html')) {
expect(win.getCounters()).to.deep.equal({ getCounter: 0, setCounter: 0 })
// TODO: re-enable when capture completes dom transition.
// getCounters is changed when setAttribute/getAttribute
// is called which is necessary for certain capture code to work.
// once dom transition is complete, that capture code will no
// longer rely on setAttribute/getAttribute.
// see: https://github.com/cypress-io/cypress-services/issues/7725

// expect(win.getCounters()).to.deep.equal({ getCounter: 0, setCounter: 0 })
}
})
})
Expand Down
2 changes: 1 addition & 1 deletion packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"devDependencies": {
"cross-env": "6.0.3",
"cypress-example-kitchensink": "2.0.5",
"cypress-example-kitchensink": "2.0.6",
"gh-pages": "5.0.0",
"gulp": "4.0.2",
"gulp-clean": "0.4.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/test/unit/http/request-middleware.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('http/request-middleware', () => {

expect(ctx.req.headers!['x-cypress-is-from-extra-target']).not.to.exist
expect(ctx.req.isFromExtraTarget).to.be.true
expect(ctx.onlyRunMiddleware).to.be.calledWith(['MaybeSetBasicAuthHeaders', 'SendRequestOutgoing'])
expect(ctx['onlyRunMiddleware']).to.be.calledWith(['MaybeSetBasicAuthHeaders', 'SendRequestOutgoing'])
})

it('when it does not exist, removes header and sets in on the req', async () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/proxy/test/unit/http/response-middleware.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe('http/response-middleware', function () {
.then(() => {
expect(ctx.res.set).to.be.calledWith(headers)

expect(ctx.onlyRunMiddleware).to.be.calledWith([
expect(ctx['onlyRunMiddleware']).to.be.calledWith([
'AttachPlainTextStreamFn',
'PatchExpressSetHeader',
'MaybeSendRedirectToClient',
Expand All @@ -144,7 +144,7 @@ describe('http/response-middleware', function () {

return testMiddleware([FilterNonProxiedResponse], ctx)
.then(() => {
expect(ctx.onlyRunMiddleware).not.to.be.called
expect(ctx['onlyRunMiddleware']).not.to.be.called
})
})
})
Expand Down
7 changes: 7 additions & 0 deletions packages/reporter/cypress/e2e/unit/formatted_message.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ describe('formattedMessage', () => {

expect(result).to.equal('expected <strong>&lt;button#increment&gt;</strong> to be enabled')
})

it('renders the custom message properly with the assertion message', () => {
const specialMessage = 'My Custom Message: expected **abcdef** to equal **abcdef**'
const result = formattedMessage(specialMessage, 'assert')

expect(result).to.equal('My Custom Message: expected <strong>abcdef</strong> to equal <strong>abcdef</strong>')
})
})

describe('when command that accepts url', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/reporter/src/commands/command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ const asterisksRegex = /^\*\*(.+?)\*\*$/gs
// 'expected **<span>** to exist in the DOM'
// `expected **glob*glob** to contain *****`
// `expected **<span>** to have CSS property **background-color** with the value **rgb(0, 0, 0)**, but the value was **rgba(0, 0, 0, 0)**`
const assertionRegex = /expected | to[^\*]+| not[^\*]+| with[^\*]+|, but[^\*]+/g
const assertionRegex = /.*expected | to[^\*]+| not[^\*]+| with[^\*]+|, but[^\*]+/g

// used to format the display of command messages and error messages
// we use markdown syntax within our error messages (code ticks, urls, etc)
// and cy.log and Cypress.log supports markdown formatting
export const formattedMessage = (message: string, name?: string) => {
if (!message) return ''

// the command message is formatted as 'expected <actual> to {assertion} <expected>'
// the command message is formatted as '(Optional Custom Msg:) expected <actual> to {assertion} <expected>'
const assertionArray = message.match(assertionRegex)

const expectedActualArray = () => {
Expand Down
Loading

0 comments on commit cadf590

Please sign in to comment.