Skip to content

test: use cmd.exe for ProviderAuthScript on Windows#16629

Merged
bolinfest merged 3 commits intomainfrom
pr16629
Apr 3, 2026
Merged

test: use cmd.exe for ProviderAuthScript on Windows#16629
bolinfest merged 3 commits intomainfrom
pr16629

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Apr 2, 2026

Why

The Windows ProviderAuthScript test helpers do not need PowerShell. Running them through cmd.exe is enough to emit the next fixture token and rotate tokens.txt, and it avoids a PowerShell-specific dependency in these tests.

What changed

  • Replaced the Windows print-token.ps1 fixtures with print-token.cmd in codex-rs/core/src/models_manager/manager_tests.rs and codex-rs/login/src/auth/auth_tests.rs.
  • Switched the failing external-auth helper in codex-rs/login/src/auth/auth_tests.rs from powershell.exe -Command 'exit 1' to cmd.exe /d /s /c 'exit /b 1'.
  • Updated Windows timeout comments so they no longer call out PowerShell specifically.

Verification

  • cargo test -p codex-login
  • cargo test -p codex-core (fails in unrelated core/src/config/config_tests.rs assertions in this checkout)

@bolinfest bolinfest changed the title test: use cmd.exe for provider auth scripts on Windows test: use cmd.exe for ProviderAuthScript on Windows Apr 2, 2026
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: deba695a71

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

setlocal EnableDelayedExpansion
echo(!first_line!
endlocal
more +1 tokens.txt > tokens.next
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Skip first token line when rotating Windows auth script

In ProviderAuthScript::new, more +1 tokens.txt > tokens.next does not remove the consumed token; per Windows more semantics, +<n> starts output at line n, so +1 starts at the first line. This leaves tokens.txt unchanged on each invocation, so Windows runs won’t ever surface the second token (e.g., refresh-path tests in auth_tests.rs/manager_tests.rs will keep reading the initial token and can fail or stop validating refresh behavior).

Useful? React with 👍 / 👎.

@bolinfest
Copy link
Copy Markdown
Collaborator Author

@codex review the latest version of this PR

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@bolinfest bolinfest merged commit beb3978 into main Apr 3, 2026
21 checks passed
@bolinfest bolinfest deleted the pr16629 branch April 3, 2026 00:33
@github-actions github-actions bot locked and limited conversation to collaborators Apr 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant