Repository navigation
test: prevent rechallenge tests from opening browsers - #3098
Merged
Merged
Conversation
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The test-only changes comprehensively prevent unintended browser launches and correctly validate applicable flow behavior.
0 open findings
What changed in this PR
Prevents Go rechallenge tests from launching real browsers while preserving production behavior.
Changes:
- Injects browser-opening stubs across rechallenge test runners.
- Verifies expected URLs and rejects browser calls on invalid flows.
| File | Description |
|---|---|
internal/rechallenge/redact_test.go |
Stubs browser opening in redaction coverage. |
internal/rechallenge/flow_test.go |
Stubs and validates interactive browser behavior. |
internal/rechallenge/flow_noninteractive_test.go |
Rejects browser calls in non-interactive flows. |
internal/gql/rechallenge_test.go |
Stubs browser behavior in GraphQL middleware tests. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
rinatkhaziev
approved these changes
Oct 9, 2026
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.



Changes
Runner.OpenURLstubs into every Go rechallenge test runner, including GraphQL middleware fixtures, so tests cannot open verification URLs in the default browser.Validation
make test(ambient proxies unset for the command).make lint.go test -race ./internal/rechallenge ./internal/gql -count=10.git diff --check.This is the separate test-stubbing follow-up discussed during #3097.