Skip to content

acceptance: drop darwin-only gate from bundle open + force_pull_commands#5217

Merged
simonfaltum merged 1 commit into
mainfrom
simonfaltum/force-pull-portable-browser
May 8, 2026
Merged

acceptance: drop darwin-only gate from bundle open + force_pull_commands#5217
simonfaltum merged 1 commit into
mainfrom
simonfaltum/force-pull-portable-browser

Conversation

@simonfaltum

Copy link
Copy Markdown
Member

Why

Follow-up to #5212. Both acceptance/bundle/open and acceptance/bundle/state/force_pull_commands are gated to darwin only (GOOS.windows = false, GOOS.linux = false) because they relied on export PATH=.:$PATH plus a local open stub to keep the real browser from launching. That trick is macOS-specific, and Go's exec.LookPath rejects results from . anyway, which is why the captured output included Error: exec: "open": cannot run executable found relative to current directory.

Pieter pointed out that libs/browser already honors $BROWSER and routes through libs/exec, so a fake browser command is portable across darwin/linux/windows.

Changes

Before: export PATH=.:$PATH + local open script; tests gated to darwin; output captured a Go exec error as the assertion.

Now: export BROWSER=echo_browser.py; the stub prints the URL and exits 0; tests run on all three platforms; output shows a clean "Opening browser at " line (and the echoed URL where stdout isn't redirected to /dev/null).

  • New acceptance/bin/echo_browser.py: prints argv[1] and exits. Distinct from the existing browser.py, which performs an HTTP GET to close the OAuth callback loop in auth tests; that fetch would have polluted out.requests.txt in force_pull_commands.
  • acceptance/bundle/open/: replace PATH trick with BROWSER=echo_browser.py, drop musterr, delete the local open stub, delete the test-local test.toml (was only setting GOOS overrides).
  • acceptance/bundle/state/force_pull_commands/: same script swap, drop GOOS overrides from test.toml, delete local open stub.

Test plan

  • go test ./acceptance -run "TestAccept/bundle/open$" -v passes on darwin (both direct and terraform engines)
  • go test ./acceptance -run "TestAccept/bundle/state/force_pull_commands$" -v passes on darwin (both engines)
  • go test ./acceptance -run "TestAccept/bundle/state/" passes (no neighbors broken)
  • ./task checks, ./task fmt, ./task lint-q clean
  • Linux + Windows CI on this PR

This pull request and its description were written by Isaac.

Both tests previously relied on `export PATH=.:$PATH` plus a local `open`
stub to suppress the real browser, which only worked on macOS (Go's
exec.LookPath rejects results from "."). They were gated to darwin via
GOOS.windows=false, GOOS.linux=false.

Use BROWSER=echo_browser.py instead. libs/browser already honors $BROWSER
and routes through libs/exec, so the stub runs portably on
darwin/linux/windows. The new helper just prints the URL and exits 0,
unlike the existing browser.py which performs an HTTP fetch (we don't
want that in force_pull_commands because it would pollute
out.requests.txt).

Co-authored-by: Isaac
@simonfaltum simonfaltum temporarily deployed to test-trigger-is May 8, 2026 09:37 — with GitHub Actions Inactive
@simonfaltum simonfaltum temporarily deployed to test-trigger-is May 8, 2026 09:37 — with GitHub Actions Inactive
@simonfaltum simonfaltum requested a review from pietern May 8, 2026 10:56
@simonfaltum simonfaltum merged commit 3fe2d04 into main May 8, 2026
39 of 42 checks passed
@simonfaltum simonfaltum deleted the simonfaltum/force-pull-portable-browser branch May 8, 2026 12:06
denik pushed a commit that referenced this pull request May 20, 2026
…nds (#5217)

## Why

Follow-up to #5212. Both `acceptance/bundle/open` and
`acceptance/bundle/state/force_pull_commands` are gated to darwin only
(`GOOS.windows = false`, `GOOS.linux = false`) because they relied on
`export PATH=.:$PATH` plus a local `open` stub to keep the real browser
from launching. That trick is macOS-specific, and Go's `exec.LookPath`
rejects results from `.` anyway, which is why the captured output
included `Error: exec: "open": cannot run executable found relative to
current directory`.

Pieter pointed out that `libs/browser` already honors `$BROWSER` and
routes through `libs/exec`, so a fake browser command is portable across
darwin/linux/windows.

## Changes

**Before:** `export PATH=.:$PATH` + local `open` script; tests gated to
darwin; output captured a Go exec error as the assertion.

**Now:** `export BROWSER=echo_browser.py`; the stub prints the URL and
exits 0; tests run on all three platforms; output shows a clean "Opening
browser at <url>" line (and the echoed URL where stdout isn't redirected
to /dev/null).

- New `acceptance/bin/echo_browser.py`: prints argv[1] and exits.
Distinct from the existing `browser.py`, which performs an HTTP GET to
close the OAuth callback loop in auth tests; that fetch would have
polluted `out.requests.txt` in `force_pull_commands`.
- `acceptance/bundle/open/`: replace PATH trick with
`BROWSER=echo_browser.py`, drop `musterr`, delete the local `open` stub,
delete the test-local `test.toml` (was only setting GOOS overrides).
- `acceptance/bundle/state/force_pull_commands/`: same script swap, drop
GOOS overrides from `test.toml`, delete local `open` stub.

## Test plan

- [x] `go test ./acceptance -run "TestAccept/bundle/open$" -v` passes on
darwin (both `direct` and `terraform` engines)
- [x] `go test ./acceptance -run
"TestAccept/bundle/state/force_pull_commands$" -v` passes on darwin
(both engines)
- [x] `go test ./acceptance -run "TestAccept/bundle/state/" ` passes (no
neighbors broken)
- [x] `./task checks`, `./task fmt`, `./task lint-q` clean
- [ ] Linux + Windows CI on this PR

This pull request and its description were written by Isaac.
TanishqDatabricks pushed a commit to TanishqDatabricks/cli that referenced this pull request May 22, 2026
…nds (databricks#5217)

## Why

Follow-up to databricks#5212. Both `acceptance/bundle/open` and
`acceptance/bundle/state/force_pull_commands` are gated to darwin only
(`GOOS.windows = false`, `GOOS.linux = false`) because they relied on
`export PATH=.:$PATH` plus a local `open` stub to keep the real browser
from launching. That trick is macOS-specific, and Go's `exec.LookPath`
rejects results from `.` anyway, which is why the captured output
included `Error: exec: "open": cannot run executable found relative to
current directory`.

Pieter pointed out that `libs/browser` already honors `$BROWSER` and
routes through `libs/exec`, so a fake browser command is portable across
darwin/linux/windows.

## Changes

**Before:** `export PATH=.:$PATH` + local `open` script; tests gated to
darwin; output captured a Go exec error as the assertion.

**Now:** `export BROWSER=echo_browser.py`; the stub prints the URL and
exits 0; tests run on all three platforms; output shows a clean "Opening
browser at <url>" line (and the echoed URL where stdout isn't redirected
to /dev/null).

- New `acceptance/bin/echo_browser.py`: prints argv[1] and exits.
Distinct from the existing `browser.py`, which performs an HTTP GET to
close the OAuth callback loop in auth tests; that fetch would have
polluted `out.requests.txt` in `force_pull_commands`.
- `acceptance/bundle/open/`: replace PATH trick with
`BROWSER=echo_browser.py`, drop `musterr`, delete the local `open` stub,
delete the test-local `test.toml` (was only setting GOOS overrides).
- `acceptance/bundle/state/force_pull_commands/`: same script swap, drop
GOOS overrides from `test.toml`, delete local `open` stub.

## Test plan

- [x] `go test ./acceptance -run "TestAccept/bundle/open$" -v` passes on
darwin (both `direct` and `terraform` engines)
- [x] `go test ./acceptance -run
"TestAccept/bundle/state/force_pull_commands$" -v` passes on darwin
(both engines)
- [x] `go test ./acceptance -run "TestAccept/bundle/state/" ` passes (no
neighbors broken)
- [x] `./task checks`, `./task fmt`, `./task lint-q` clean
- [ ] Linux + Windows CI on this PR

This pull request and its description were written by Isaac.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants