Skip to content

Prevent auth acceptance tests from opening browser tabs#1312

Closed
Fab10-CircleCi wants to merge 1 commit into
nextfrom
fabioramirez/no-browser-open-acceptance
Closed

Prevent auth acceptance tests from opening browser tabs#1312
Fab10-CircleCi wants to merge 1 commit into
nextfrom
fabioramirez/no-browser-open-acceptance

Conversation

@Fab10-CircleCi
Copy link
Copy Markdown

Summary

Acceptance tests were launching real browser tabs because the interactive auth UI models called browser.OpenURL directly.

This adds an injectable browser opener to the login and signup flow models. In normal usage, the opener still defaults to browser.OpenURL, so production behavior is unchanged. In acceptance tests, TestEnv now sets CIRCLECI_NO_BROWSER_OPEN=true, which makes the command layer pass a no-op opener instead.

CIRCLECI_NO_BROWSER_OPEN is intentionally undocumented; it is a test seam, not a supported user-facing configuration flag.

Context

auth login already opened a browser tab during the interactive browser-login path. PR #1310 added signup coverage that exercises browser auth more often, so running acceptance tests became noisy and disruptive locally.

Before this change, the login interactive path, signup start, and signup-to-login fallback could all open browser tabs during acceptance tests.

With this change:

  • Normal circleci auth login and circleci auth signup still open the browser.
  • Acceptance tests still exercise the full interactive login/signup flows.
  • Acceptance tests no longer open real browser tabs.

Testing

Unit tests cover the browserOpener() env-var switch and the signup model's use of the injected opener with and without NoBrowser.

```sh
go test ./internal/ui ./internal/cmd/cmdauth
go test ./acceptance -run 'TestAuthSignup|TestAuthLogin' -count=1
go test ./acceptance -count=1
go test ./...
task ci:check
```

🤖 Generated with Claude Code

@pete-woods
Copy link
Copy Markdown
Contributor

Resolved the issues with signup on the backend

@pete-woods pete-woods closed this May 21, 2026
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