fix: avoid ANSI character output when running the binary smoke test f… #28994
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…or eecution environments that set FORCE_COLOR [run ci]
Additional details
Fixes an issue with env pollution inside the
cypress verify
step of the binary. After the electron update, something under the hood changed with how environment variables are hydrated into the process where not all options before were being respected inside the process. In particular, this causes issues with theFORCE_COLOR
option that can live inside the node process. Previously,FORCE_COLOR
on the previous version of electron was not respected inside theexeca
process, but now it is. This causes theping
number to be colored yellow via our error templating, causing an unexpected mismatch on the lines contained in the verify check. This is only an issue ifFORCE_COLOR
is set inside the process, which happens to be the case fornx
users. Here is a sample diff of theprocess.env
differences between invoking cypress via thenx
plugin vs invoking cypress directly.Since the verify job does not need knowledge of ANSI coloring and we mainly want to make sure the verify passes, we are opting to set
FORCE_COLOR
to0
in order for the verify messaging to pass and make the logic less dependent on user environmentsSteps to test
Likely the best way to test is setting up
cypress-test-tiny
and installing the prebuild binary mentioned in this commit. once installed, runyarn nx init
and install@nx/cypress
. Then install viayarn
and executeyarn cypress:run
. The binary verification should pass.I have also added a unit test to verify
FORCE_COLOR
is off. We could add a system test that leverages a binary test against an nx project, but the time to set that up locally is a bit tedious at the moment and think we get the coverage we need from this plus some of our internal repos.How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?