GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(local): forward connection_settings.binaryPath to browserstack-local [SDK-7284] by anish353 · Pull Request #1176 · browserstack/browserstack-cypress-cli

Conversation

@anish353

@anish353 anish353 commented Aug 18, 2026 •
edited by atlassian Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Summary

A customer's network blocks the BrowserStackLocal binary download, so they asked for a way to point the CLI at a binary they had already placed on disk. browserstack-local has supported exactly that for a long time — a binarypath option that short-circuits LocalBinary entirely — but the CLI never forwarded one.

setLocalArgs forwards five connection_settings keys today (local_identifier, local_config_file, proxyHost, proxyPort, useCaCertificate). binaryPath appears nowhere in bin/, so setting it in browserstack.json is silently dropped and the download path is always taken. That silent drop is what made this hard to diagnose from the outside: there is no log line saying the key was ignored.

Reported and root-caused on SDK-7284.

What lands here

File Change
bin/helpers/utils.js setLocalArgs forwards a configured binary path as binarypath. Both binaryPath and binarypath are accepted in browserstack.json.
test/unit/bin/helpers/utils.js Three specs: binaryPath is forwarded as the lowercase key, the lowercase config key is accepted too, and no key is emitted when none is configured. Plus a require-order fix, below.

The forwarded key is deliberately all-lowercase. browserstack-local only special-cases binarypath in addArgs; any other casing falls through to its default: branch and is handed to the binary as an unknown CLI flag — while the download still happens:

binaryPath  -> this.binaryPath = undefined | leaks to the binary as ["--binaryPath","<path>"]
binarypath  -> this.binaryPath = <path>    | leaks: []
BinaryPath  -> this.binaryPath = undefined | leaks to the binary as ["--BinaryPath","<path>"]

Accepting both spellings in browserstack.json is for the same reason — a user copying binarypath from the browserstack-local README should not land back in the silent-drop case this PR exists to remove.

Verification

Against the published [email protected] with its real [email protected], using a stub binary that reports {"state":"connected"} so the assertion is which binary got spawned:

local_args from setLocalArgs Binary spawned
1.36.18 as published {key, localIdentifier, daemon, enable-logging-for-api, source} — no binarypath downloaded one; the supplied path is ignored
this branch {... , binarypath: "<path>"} the supplied binary, zero download attempts

On the fixed run browserstack-local prints BINARY PATH IS DEFINED and start returns no error. The argv it hands the binary matches the shape in the customer's error line, including the duplicate --daemon / --source the two layers each add.

Test plan

  • Three new specs on setLocalArgs (forwarded key, lowercase alias, absent key).
  • test/unit/bin/helpers/utils.js: 398 passing / 3 failing on this branch vs 393 passing / 5 failing on a clean master. Net +5 passing, zero regressions. The 3 remaining failures are pre-existing getVideoConfig specs, red on master too.
  • End-to-end check against the published tarball plus a stub binary (table above).

Why two pre-existing failures go green

bin/helpers/usageReporting.js requires ./utils (line 9) and then reassigns module.exports (line 21). Requiring usageReporting before utils therefore leaves utils holding the empty exports object captured mid-cycle, while the test holds the real one — so usageReporting.cli_version_and_path was undefined inside setLocalArgs, nothing stubbed in the test was visible to the code under test, and the existing spec threw. Requiring utils first makes it capture the finished exports.

This is a test-harness fix only; no production code depends on the ordering, since the CLI's entry points already load utils first. The stale-reference hazard in usageReporting.js itself is left alone as out of scope for this ticket.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@anish353 @claude
feat(local): forward connection_settings.binaryPath to browserstack-l…
afd55c4
…ocal [SDK-7284]

`browserstack-local` accepts a `binarypath` option that skips the binary
download entirely, but the CLI never forwarded one, so a customer whose network
blocks the download had no way to point the run at a binary they had already
placed on disk. `setLocalArgs` now passes it through.

The key it forwards is deliberately all-lowercase: `browserstack-local` only
special-cases `binarypath`, and any other casing falls through its `addArgs`
default branch and is handed to the binary as an unknown CLI flag while the
download happens anyway. Both `binaryPath` and `binarypath` are accepted in
`browserstack.json` for the same reason — a silently ignored config key is the
failure mode this change exists to remove.

Also reorders two requires in the test file. `usageReporting` reassigns
`module.exports` after its own circular `require('./utils')`, so requiring it
before `utils` left `utils` holding a stale, empty exports object: nothing
stubbed in the test was visible to the code under test, and `setLocalArgs`
threw. That is why the existing `setLocalArgs` spec was already failing on
master.

Co-Authored-By: Claude Opus 5 <[email protected]>
@anish353
anish353 requested a review from a team as a code owner August 18, 2026 13:09
@anish353
anish353 requested review from pri-gadhiya and vivianludrick August 18, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pri-gadhiya pri-gadhiya Awaiting requested review from pri-gadhiya pri-gadhiya is a code owner automatically assigned from browserstack/sdk-dev
@vivianludrick vivianludrick Awaiting requested review from vivianludrick vivianludrick is a code owner automatically assigned from browserstack/sdk-dev

At least 1 approving review is required to merge this pull request.

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@anish353
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.