Prevent auth acceptance tests from opening browser tabs#1312
Closed
Fab10-CircleCi wants to merge 1 commit into
Closed
Prevent auth acceptance tests from opening browser tabs#1312Fab10-CircleCi wants to merge 1 commit into
Fab10-CircleCi wants to merge 1 commit into
Conversation
Contributor
|
Resolved the issues with signup on the backend |
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.
Summary
Acceptance tests were launching real browser tabs because the interactive auth UI models called
browser.OpenURLdirectly.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,TestEnvnow setsCIRCLECI_NO_BROWSER_OPEN=true, which makes the command layer pass a no-op opener instead.CIRCLECI_NO_BROWSER_OPENis intentionally undocumented; it is a test seam, not a supported user-facing configuration flag.Context
auth loginalready 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:
circleci auth loginandcircleci auth signupstill open the browser.Testing
Unit tests cover the
browserOpener()env-var switch and the signup model's use of the injected opener with and withoutNoBrowser.```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