Skip to content

test: isolate CUSTOM_BASE_URL in hermetic cleanup#7

Closed
DIZ-admin wants to merge 1 commit into
mainfrom
test/isolate-custom-base-url
Closed

test: isolate CUSTOM_BASE_URL in hermetic cleanup#7
DIZ-admin wants to merge 1 commit into
mainfrom
test/isolate-custom-base-url

Conversation

@DIZ-admin

@DIZ-admin DIZ-admin commented May 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • add CUSTOM_BASE_URL to the shared hermetic env cleanup in tests/conftest.py
  • prevent live host provider endpoint overrides from leaking into runtime/provider tests

Validation

  • python -m pytest -q tests/providers/test_plugin_discovery.py tests/hermes_cli/test_runtime_provider_resolution.py tests/hermes_cli/test_ollama_cloud_auth.py
  • ruff check tests/conftest.py

Classification

  • test isolation / environment contamination fix
  • not a product inference regression

Summary by CodeRabbit

  • Tests
    • Enhanced test environment isolation by preventing unintended environment variable leakage into test assertions, improving test reliability.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 17, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@DIZ-admin has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 55 minutes and 51 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 112e6b5c-f04d-4144-b8d8-4b1f2d74f3bd

📥 Commits

Reviewing files that changed from the base of the PR and between 7b6b7e8e2b984583bf4d54050533c1f35e288d0f and dfd41b3.

📒 Files selected for processing (1)
  • tests/conftest.py
📝 Walkthrough

Walkthrough

Updates the hermetic environment test fixture to explicitly unset CUSTOM_BASE_URL before each test, preventing developer-provided base URL values from leaking into test assertions.

Changes

Test Environment Isolation

Layer / File(s) Summary
Hermetic environment credential filtering
tests/conftest.py
CUSTOM_BASE_URL is added to the credential-name allowlist in the autouse hermetic environment fixture, ensuring the env var is unset before each test run.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • DIZ-admin/hermes-agent#3: Both changes update tests/conftest.py to hermetically unset CUSTOM_BASE_URL (as part of the credential-like/base-URL env-var cleanup) before tests run.
  • DIZ-admin/hermes-agent#4: Both PRs update tests/conftest.py's _hermetic_environment fixture to unset CUSTOM_BASE_URL (and in the retrieved PR, additional provider base-URL vars) so developer-provided environment values don't affect test assertions.

Poem

🐰 A single line, so small and neat,
Unsets the URL—no leaks to cheat!
Hermetic tests run clean and true,
No stray env vars to break through. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately summarizes the main change: adding CUSTOM_BASE_URL to hermetic environment cleanup in tests/conftest.py to prevent test isolation issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/isolate-custom-base-url

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.

@github-actions

github-actions Bot commented May 17, 2026

Copy link
Copy Markdown

🔎 Lint report: test/isolate-custom-base-url vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 8331 on HEAD, 8331 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4357 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@DIZ-admin

Copy link
Copy Markdown
Owner Author

Superseded by #13. I reproduced the remaining hermetic/env-sensitive failures on current main and moved the minimal clean fix there to avoid overlapping PR history.

@DIZ-admin

Copy link
Copy Markdown
Owner Author

Closing as superseded by #13.

@DIZ-admin DIZ-admin closed this May 18, 2026
@DIZ-admin DIZ-admin deleted the test/isolate-custom-base-url branch May 18, 2026 10:41
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