Skip to content

bug: test:rust opens browser during auth rollback test #1806

@elezar

Description

@elezar

Agent Diagnostic

Used the create-github-issue and create-github-pr skills. Investigated mise run test:rust browser launch behavior in crates/openshell-cli/src/run.rs and crates/openshell-cli/src/auth.rs. The unit test gateway_add_cloud_rolls_back_on_auth_failure invokes gateway_add("https://127.0.0.1:1", ...) with browser suppression disabled so that the auth flow is treated as a real failure and the rollback path is exercised. browser_auth_flow then constructs /auth/connect?callback_port=...&code=... and calls open_browser_url, which runs the platform browser opener (open on macOS) before the test eventually fails authentication.

Description

Actual behavior: Running mise run test:rust locally can open a browser window to a URL like https://127.0.0.1:1/auth/connect?callback_port=53520&code=VFB-YQGF.

Expected behavior: Local test runs should not launch GUI browser windows. The auth rollback test should still exercise the failure rollback behavior without invoking the system browser.

Reproduction Steps

  1. Run mise run test:rust locally.
  2. Observe a browser window or tab opening to https://127.0.0.1:1/auth/connect?... during the Rust test suite.

Environment

  • OS: macOS
  • Docker: Not required
  • OpenShell: main at 25abc9e3

Logs

https://127.0.0.1:1/auth/connect?callback_port=53520&code=VFB-YQGF

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions