Skip to content

fix(test-smoke): set USERPROFILE alongside HOME for Windows Path.home() compat#439

Merged
0xmariowu merged 1 commit intomainfrom
fix/windows-userprofile-env-var
Apr 26, 2026
Merged

fix(test-smoke): set USERPROFILE alongside HOME for Windows Path.home() compat#439
0xmariowu merged 1 commit intomainfrom
fix/windows-userprofile-env-var

Conversation

@0xmariowu
Copy link
Copy Markdown
Owner

Summary

Fixes the Cross-Platform Tests Windows regression on main: tests/smoke/test_cli_configure_smoke.py::test_cli_configure_inline_value_works_non_interactively was failing because the test sets only env[\"HOME\"] but on Windows Path.home() reads %USERPROFILE%, not %HOME%. The CLI subprocess wrote the secrets file to the real user home, while the test asserted against tmp_path.

Changes

  • tests/smoke/conftest.py smoke_env() (or new helper): when caller passes home=..., set BOTH HOME and USERPROFILE.
  • Three smoke test files updated to use the new pattern: test_cli_configure_smoke.py, test_npm_wrapper.py, test_install_script.py.

Test plan

  • pytest tests/smoke/test_cli_configure_smoke.py tests/smoke/test_npm_wrapper.py tests/smoke/test_install_script.py — 12 passed
  • pytest tests/smoke/ -m \"not network and not real_llm\" — 21 passed
  • ruff check + format clean

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings April 26, 2026 14:22
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 26, 2026

Warning

Rate limit exceeded

@0xmariowu has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 59 minutes and 58 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 59 minutes and 58 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5cdfddbc-d5c0-43db-a207-5311f507ae80

📥 Commits

Reviewing files that changed from the base of the PR and between acf3408 and 7c48308.

📒 Files selected for processing (4)
  • tests/smoke/conftest.py
  • tests/smoke/test_cli_configure_smoke.py
  • tests/smoke/test_install_script.py
  • tests/smoke/test_npm_wrapper.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@0xmariowu 0xmariowu enabled auto-merge (squash) April 26, 2026 14:22
@0xmariowu 0xmariowu merged commit 97557ae into main Apr 26, 2026
16 checks passed
@0xmariowu 0xmariowu deleted the fix/windows-userprofile-env-var branch April 26, 2026 14:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a Windows-only smoke-test regression by ensuring subprocesses in smoke tests use a controlled home directory consistently across platforms (Windows Path.home() uses %USERPROFILE% rather than %HOME%).

Changes:

  • Extend smoke_env() to accept a home=... argument and set both HOME and USERPROFILE.
  • Update smoke tests that previously set only HOME to use smoke_env(home=...) instead.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/smoke/conftest.py Adds home parameter to smoke_env() and syncs USERPROFILE with HOME when appropriate.
tests/smoke/test_cli_configure_smoke.py Uses smoke_env(home=tmp_path) so the CLI writes the secrets file into the test temp home on Windows.
tests/smoke/test_npm_wrapper.py Switches HOME setup to smoke_env(home=home) for subprocess environment consistency.
tests/smoke/test_install_script.py Switches HOME setup to smoke_env(home=home) for subprocess environment consistency.

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