diff --git a/.buildkite/test_areas/misc.yaml b/.buildkite/test_areas/misc.yaml index e04016d6dc..7511acca00 100644 --- a/.buildkite/test_areas/misc.yaml +++ b/.buildkite/test_areas/misc.yaml @@ -293,6 +293,7 @@ steps: - vllm/transformers_utils/ - vllm/utils/ - vllm/v1/ + - tests/test_envs.py - tests/test_inputs.py - tests/test_outputs.py - tests/test_pooling_params.py @@ -309,6 +310,7 @@ steps: device: cpu-small commands: - python3 standalone_tests/lazy_imports.py + - pytest -v -s test_envs.py - pytest -v -s test_inputs.py - pytest -v -s test_outputs.py - pytest -v -s test_pooling_params.py diff --git a/tests/test_envs.py b/tests/test_envs.py index e0211b5630..d4d120ecee 100644 --- a/tests/test_envs.py +++ b/tests/test_envs.py @@ -104,15 +104,32 @@ def test_is_envs_cache_enabled() -> None: def test_precompiled_install_flags_are_orthogonal() -> None: + # The Rust frontend flag is independent of the C-extension precompiled + # flag: requesting the precompiled Rust frontend must not implicitly + # enable the precompiled C extensions. + with patch.dict(os.environ, {"VLLM_USE_PRECOMPILED_RUST": "1"}, clear=True): + assert environment_variables["VLLM_USE_PRECOMPILED"]() is False + assert environment_variables["VLLM_USE_PRECOMPILED_RUST"]() is True + + # ...and the reverse: requesting precompiled C extensions (here via a + # wheel location, which enables VLLM_USE_PRECOMPILED) must not flip the + # Rust frontend flag. + with patch.dict( + os.environ, {"VLLM_PRECOMPILED_WHEEL_LOCATION": "/tmp/vllm.whl"}, clear=True + ): + assert environment_variables["VLLM_USE_PRECOMPILED"]() is True + assert environment_variables["VLLM_USE_PRECOMPILED_RUST"]() is False + + # ...and with both set together, each flag is still parsed independently. with patch.dict( os.environ, { "VLLM_PRECOMPILED_WHEEL_LOCATION": "/tmp/vllm.whl", "VLLM_USE_PRECOMPILED_RUST": "1", }, - clear=False, + clear=True, ): - assert environment_variables["VLLM_USE_PRECOMPILED"]() is False + assert environment_variables["VLLM_USE_PRECOMPILED"]() is True assert environment_variables["VLLM_USE_PRECOMPILED_RUST"]() is True