fix(tests): clear VIRTUAL_ENV in venv detection tests (#8620 follow-up) - #10122
Closed
kagura-agent wants to merge 1 commit into
Closed
fix(tests): clear VIRTUAL_ENV in venv detection tests (#8620 follow-up)#10122kagura-agent wants to merge 1 commit into
kagura-agent wants to merge 1 commit into
Conversation
follow-up) After NousResearch#10093 added VIRTUAL_ENV env-var detection to _detect_venv_dir(), the 4 TestDetectVenvDir fallback tests break when run inside any virtualenv — VIRTUAL_ENV short-circuits before reaching the PROJECT_ROOT fallback path each test targets. Fix: monkeypatch.delenv('VIRTUAL_ENV', raising=False) in each test so the fallback logic is actually exercised. Signed-off-by: Kagura <kagura.chen28@gmail.com>
Contributor
Author
|
CI note: The |
Contributor
Author
|
Closing to reduce PR volume. Apologies for the noise. |
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.
Problem
The 4
TestDetectVenvDirfallback tests intest_gateway_service.pyfail when run inside any virtualenv (both locally and in CI).Root Cause
After #10093 added
VIRTUAL_ENVenv-var detection to_detect_venv_dir(), the tests that exercise thePROJECT_ROOTfallback path break —VIRTUAL_ENVis set in CI's virtualenv, so_detect_venv_dir()returns the real venv dir before reaching the fallback logic each test targets.Fix
Add
monkeypatch.delenv('VIRTUAL_ENV', raising=False)to the 4 affected tests so thePROJECT_ROOTfallback is actually exercised.Verification
Signed-off-by: Kagura kagura.chen28@gmail.com