Summary
The JSONRPC integration test client (crates/pet/tests/jsonrpc_client.rs, line ~99) sets PATH to empty to isolate the server from the host. However, tool-specific environment variables are not cleared.
Details
Variables like CONDA_EXE, PYENV_ROOT, UV_PYTHON_INSTALL_DIR, WORKON_HOME, PIPENV_VENV_IN_PROJECT, POETRY_VIRTUALENVS_PATH, and others could leak host state into the test environment, causing non-deterministic test results depending on the developer's machine.
Proposed Fix
Clear all known tool-specific environment variables in PetJsonRpcClient::spawn() alongside the existing PATH clearing. Consider a blocklist approach:
.env("CONDA_EXE", "")
.env("PYENV_ROOT", "")
.env("UV_PYTHON_INSTALL_DIR", "")
.env("WORKON_HOME", "")
.env("PIPENV_VENV_IN_PROJECT", "")
.env("POETRY_VIRTUALENVS_PATH", "")
.env("VIRTUAL_ENV", "")
Impact
Low — current tests pass, but results may vary across developer machines with different tool installations.
Summary
The JSONRPC integration test client (
crates/pet/tests/jsonrpc_client.rs, line ~99) setsPATHto empty to isolate the server from the host. However, tool-specific environment variables are not cleared.Details
Variables like
CONDA_EXE,PYENV_ROOT,UV_PYTHON_INSTALL_DIR,WORKON_HOME,PIPENV_VENV_IN_PROJECT,POETRY_VIRTUALENVS_PATH, and others could leak host state into the test environment, causing non-deterministic test results depending on the developer's machine.Proposed Fix
Clear all known tool-specific environment variables in
PetJsonRpcClient::spawn()alongside the existingPATHclearing. Consider a blocklist approach:Impact
Low — current tests pass, but results may vary across developer machines with different tool installations.