cypress
cypress copied to clipboard
fix: Fix Issue 27103. Retain original array after defaultsDeep
- Closes issue-27103
Additional details
What is affected by this change?
Previously the defaultsDeep function was merging/combining arrays. This PR will fix that issue and restore any arrays modified by the setupNodeEvents
function.
Steps to test
To test, copy the cypress.config.js from the reproduction
section of the issue and configure for e2e testing. Then run cypress using yarn cypress open --dev --config-file cypress.config.js
. After setting any key within the config object to any array value (within the setupNodeEvents function), it should reflect as is in the final config.
How has the user experience changed?
User will get the exact config they supply in the setupNodeEvents
function.
PR Tasks
- [doubt] Have tests been added/updated?
- [na] Has a PR for user-facing changes been opened in
cypress-documentation
? - [na] Have API changes been updated in the
type definitions
?
- Create a Draft Pull Request if your PR is not ready for review. Mark the PR as Ready for Review when you're ready for a Cypress team member to review the PR.
1 failed and 29 flaky tests on run #48661 ↗︎
![]() |
![]() |
![]() |
![]() |
![]() |
Details:
Merge branch 'cypress-io:develop' into issue-27103-defaultsDeep-array-combinatio... | |||
Project: cypress | Commit: b7e30a42d0 |
||
Status: Failed | Duration: 20:08 💡 | ||
Started: Jul 8, 2023 10:48 AM | Ended: Jul 8, 2023 11:09 AM |
cypress/e2e/e2e/origin/user_agent_override.cy.ts • 1 failed test • 5x-driver-electron
Test | Artifacts | |
---|---|---|
user agent override > persists modified user agent after cy.go |
Output
Video
|
runs.cy.ts • 1 flaky test • app-e2e
Test | Artifacts | |
---|---|---|
... > displays a list of recorded runs if a run has been recorded |
Output
Screenshots
Video
|
specs_list_latest_runs.cy.ts • 1 flaky test • app-e2e
Test | Artifacts | |
---|---|---|
App/Cloud Integration - Latest runs and Average duration > when no runs are recorded > shows placeholders for all visible specs |
Output
Screenshots
Video
|
cypress-origin-communicator.cy.ts • 1 flaky test • app-e2e
Test | Artifacts | |
---|---|---|
Cypress In Cypress Origin Communicator > cy.origin passivity with app interactions > passes upon test reload mid test execution |
Output
Screenshots
Video
|
commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-firefox
Test | Artifacts | |
---|---|---|
network stubbing > intercepting request > can delay and throttle a StaticResponse |
Output
|
commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-electron
Test | Artifacts | |
---|---|---|
network stubbing > intercepting request > can delay and throttle a StaticResponse |
Output
Video
|
The first 5 flaky specs are shown, see all 17 specs in Cypress Cloud.
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.
Let me run CI and see how it goes.
This seems to massively break things. https://app.circleci.com/pipelines/github/cypress-io/cypress?branch=pull%2F27240
What operating system are you on @NiharPhansalkar? Does yarn
complete when you first clone the repo? Note you must use Chrome for the packages/app
tests.
Are you able to run other tests - try yarn cypress:open
in packages/app
and choose Component Testing -- do those run?
@lmiller1990 Hello, I am running this in a VM running Fedora 38. Yes yarn
does complete (however, one catch is I had to disable the NX daemon
in order for it to work properly) and yes I ran it on Google Chrome. However, when I select component testing, it says the following
Cannot convert undefined or null to object
TypeError: Cannot convert undefined or null to object
at Function.entries ()
at updateWithPluginValues (/home/vm_work/cypress/packages/config/src/project/index.ts:113:37)
at ProjectConfigManager.handleSetupTestingTypeReply (/home/vm_work/cypress/packages/data-context/src/data/ProjectConfigManager.ts:333:73)
at ProjectConfigManager.setupNodeEvents (/home/vm_work/cypress/packages/data-context/src/data/ProjectConfigManager.ts:267:7)
At least here on GitHub where it shows the checks, it was previously passing most tests, failing about 7. Now all of a sudden it is failing 25 tests. I hope this is only related to the change I made? And has nothing to do with me updating the branch?
@NiharPhansalkar I think we need a default value: https://github.com/cypress-io/cypress/pull/27240/commits/1deb871738a12051c006f7c52f2731deefb26f3b
It was trying to do Object.entries(undefined)
. Let's see how this goes.
@lmiller1990 Hello Lachlan, the cy.startAppServer()
keeps on giving me a timeout error when I try to run the e2e tests. I even tried commenting out some code, but of course, other things start breaking.
I'll try and get this one merged up.
Yes, but say for future contributions for cypress, I may have to test other parts? Where can I actually understand the reason for such issues occurring and try to fix them?
Right, I understand your question.
VM running Fedora 38.
I haven't run on Fedora or under a VM before, but the first thing I usually do to debug is run the build with DEBUG=cypress:* yarn dev
and see what comes up in the logs. I have run the development scripts on Ubuntu, MacOS and windows before. If you'd like to give that a try and see if there's anything useful in the debug logs.
Sure! Thank you.
@lmiller1990 Hello Lachlan. I did run it with DEBUG=* yarn dev
and there were quite a few errors. Can you tell me if you too have received such errors?
-
cypress:ts registering ts-node on directory undefined
-
nexusTypegen: cypress:ts registering ts-node on directory undefined
' -
cypress:server environment error Cannot read properties of undefined (reading 'commandLine')
-
cypress:packherd:error Error: Cannot find module 'pnpapi'
(Lot of packherd errors) -
NexusSlowGuard: Taking more than 100ms to execute ["currentProject","projectId"] for query HeaderBar_HeaderBarQuery (total time 161ms)
Here is the entirely of what I see. I am not sure I can help with running of Fedora specifically; I don't have the time / bandwidth to try Fedora development right now. If you are able to try another distro (eg Ubuntu) where it's known to run, I can possibly help.
In the meantime, I'll get this PR ready to go.
Close in favor of https://github.com/cypress-io/cypress/pull/27312