Repository navigation
PPLT-6233: Export PERCY_CLI_API and CYPRESS_PERCY_SERVER_ADDRESS from percy exec - #2466
Draft
RaghavsBrowserStack wants to merge 1 commit into
Draft
RaghavsBrowserStack wants to merge 1 commit into
RaghavsBrowserStack wants to merge 1 commit into
Conversation
… percy exec The Python and .NET SDKs read PERCY_CLI_API and the Cypress browser only sees CYPRESS_-prefixed vars, so with a non-default --port they fell back to 5338 and silently disabled snapshots. Export both with the server address, keeping any value the user already set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Jira: https://browserstack.atlassian.net/browse/PPLT-6233 (epic PPLT-6210)
Problem
percy exec --port <N>exports onlyPERCY_SERVER_ADDRESSto the child command. The Python and .NET SDKs (Selenium and Playwright) readPERCY_CLI_APIinstead, and the Cypress browser only seesCYPRESS_*variables. With a non-default port these SDKs fall back tolocalhost:5338, logPercy is not running, disabling snapshots, and the command exits 0 with an empty build.Pre-existing, not caused by the framework upgrades. Cypress 16 makes it more visible because it removed
Cypress.env().Fix
When Percy is running,
percy execnow also exports:PERCY_CLI_API(Python and .NET SDKs)CYPRESS_PERCY_SERVER_ADDRESS(Cypress ≤15 viaCypress.env(); on 16CYPRESS_*vars still populatecy.env())Both get the same address as
PERCY_SERVER_ADDRESS. A value the user already set is kept. Neither is exported when Percy is disabled, so the SDKs keep their own defaults.Cypress 16
expose: not exported. The Cypress migration guide,Cypress.exposeAPI and environment variables guide document only two ways to setexposevalues: the config file and the--expose/-xCLI flag. They sayCYPRESS_*OS variables "populateenvonly" and "never reachCypress.expose()". There is noCYPRESS_EXPOSE_*or similar env-var route, so on Cypress 16@percy/cypressmust read the address viacy.env()or a task, notCypress.expose().Testing
yarn testinpackages/cli-exechas 2 failures on this branch:handles terminating the child process when interruptedandexec:start starts a long-running percy process. These are timing/signal specs. Master also fails locally (3 failures, including the interrupt spec), so they are not caused by this change. Leaving it to CI.percy exec --port 5501,PERCY_CLI_APInot set:Percy is not running, disabling snapshots, empty build: https://percy.io/9560f98d/web/testing-framework-upgrade-c905f5b0/builds/54713182🤖 Generated with Claude Code
Summary by CodeRabbit