From b21d3843048001101713e70597fc9484332a5f7e Mon Sep 17 00:00:00 2001 From: Flora Feng <4florafeng@gmail.com> Date: Thu, 19 Mar 2026 03:19:36 -0400 Subject: [PATCH] [Refactor] Relocate endpoint tests to mirror serving code directory structure (#37504) Signed-off-by: sfeng33 <4florafeng@gmail.com> --- .buildkite/scripts/hardware_ci/run-amd-test.sh | 3 +-- pyproject.toml | 2 +- tests/entrypoints/{openai => anthropic}/test_messages.py | 2 +- tests/entrypoints/openai/models/__init__.py | 0 tests/entrypoints/openai/{ => models}/test_models.py | 2 +- tests/entrypoints/openai/realtime/__init__.py | 0 .../openai/{ => realtime}/test_realtime_validation.py | 5 ++--- tests/entrypoints/openai/responses/test_mcp_tools.py | 2 +- .../openai/{ => responses}/test_serving_responses.py | 0 tests/entrypoints/openai/speech_to_text/__init__.py | 0 .../{ => speech_to_text}/test_transcription_validation.py | 4 ++-- .../test_transcription_validation_whisper.py | 2 +- .../{ => speech_to_text}/test_translation_validation.py | 4 ++-- tests/entrypoints/serve/__init__.py | 0 tests/entrypoints/serve/tokenize/__init__.py | 0 .../{openai => serve/tokenize}/test_tokenization.py | 3 +-- .../{openai => serve/tokenize}/test_tokenization_vlm.py | 2 +- 17 files changed, 14 insertions(+), 17 deletions(-) rename tests/entrypoints/{openai => anthropic}/test_messages.py (99%) create mode 100644 tests/entrypoints/openai/models/__init__.py rename tests/entrypoints/openai/{ => models}/test_models.py (97%) create mode 100644 tests/entrypoints/openai/realtime/__init__.py rename tests/entrypoints/openai/{ => realtime}/test_realtime_validation.py (98%) rename tests/entrypoints/openai/{ => responses}/test_serving_responses.py (100%) create mode 100644 tests/entrypoints/openai/speech_to_text/__init__.py rename tests/entrypoints/openai/{ => speech_to_text}/test_transcription_validation.py (97%) rename tests/entrypoints/openai/{ => speech_to_text}/test_transcription_validation_whisper.py (99%) rename tests/entrypoints/openai/{ => speech_to_text}/test_translation_validation.py (98%) create mode 100644 tests/entrypoints/serve/__init__.py create mode 100644 tests/entrypoints/serve/tokenize/__init__.py rename tests/entrypoints/{openai => serve/tokenize}/test_tokenization.py (99%) rename tests/entrypoints/{openai => serve/tokenize}/test_tokenization_vlm.py (97%) diff --git a/.buildkite/scripts/hardware_ci/run-amd-test.sh b/.buildkite/scripts/hardware_ci/run-amd-test.sh index 407e3c5a63..f6b9f514ce 100755 --- a/.buildkite/scripts/hardware_ci/run-amd-test.sh +++ b/.buildkite/scripts/hardware_ci/run-amd-test.sh @@ -336,11 +336,10 @@ apply_rocm_test_overrides() { --ignore=entrypoints/openai/chat_completion/test_audio.py \ --ignore=entrypoints/openai/completion/test_shutdown.py \ --ignore=entrypoints/openai/test_completion.py \ - --ignore=entrypoints/openai/test_models.py \ + --ignore=entrypoints/openai/models/test_models.py \ --ignore=entrypoints/openai/test_lora_adapters.py \ --ignore=entrypoints/openai/test_return_tokens_as_ids.py \ --ignore=entrypoints/openai/chat_completion/test_root_path.py \ - --ignore=entrypoints/openai/test_tokenization.py \ --ignore=entrypoints/openai/completion/test_prompt_validation.py "} fi diff --git a/pyproject.toml b/pyproject.toml index 64a6de30e2..fad8c8c687 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -121,7 +121,7 @@ python = "./.venv" # these files may be written in non english words extend-exclude = ["tests/models/fixtures/*", "tests/prompts/*", "tests/tokenizers_/*", "benchmarks/sonnet.txt", "tests/lora/data/*", "examples/pooling/token_embed/*", "build/*", - "vllm/third_party/*", "vllm/entrypoints/serve/instrumentator/static/*", "tests/entrypoints/openai/test_transcription_validation.py", + "vllm/third_party/*", "vllm/entrypoints/serve/instrumentator/static/*", "tests/entrypoints/openai/speech_to_text/test_transcription_validation.py", "docs/governance/process.md", "tests/v1/engine/test_fast_incdec_prefix_err.py", ".git/*"] ignore-hidden = false diff --git a/tests/entrypoints/openai/test_messages.py b/tests/entrypoints/anthropic/test_messages.py similarity index 99% rename from tests/entrypoints/openai/test_messages.py rename to tests/entrypoints/anthropic/test_messages.py index ce8c3ff4a7..8f47351d67 100644 --- a/tests/entrypoints/openai/test_messages.py +++ b/tests/entrypoints/anthropic/test_messages.py @@ -5,7 +5,7 @@ import anthropic import pytest import pytest_asyncio -from ...utils import RemoteOpenAIServer +from tests.utils import RemoteOpenAIServer MODEL_NAME = "Qwen/Qwen3-0.6B" diff --git a/tests/entrypoints/openai/models/__init__.py b/tests/entrypoints/openai/models/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/entrypoints/openai/test_models.py b/tests/entrypoints/openai/models/test_models.py similarity index 97% rename from tests/entrypoints/openai/test_models.py rename to tests/entrypoints/openai/models/test_models.py index e5af11edf7..69b9dfb953 100644 --- a/tests/entrypoints/openai/test_models.py +++ b/tests/entrypoints/openai/models/test_models.py @@ -5,7 +5,7 @@ import openai # use the official client for correctness check import pytest import pytest_asyncio -from ...utils import RemoteOpenAIServer +from tests.utils import RemoteOpenAIServer # any model with a chat template should work here MODEL_NAME = "Qwen/Qwen3-0.6B" diff --git a/tests/entrypoints/openai/realtime/__init__.py b/tests/entrypoints/openai/realtime/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/entrypoints/openai/test_realtime_validation.py b/tests/entrypoints/openai/realtime/test_realtime_validation.py similarity index 98% rename from tests/entrypoints/openai/test_realtime_validation.py rename to tests/entrypoints/openai/realtime/test_realtime_validation.py index 83ecc4ac13..672894d0c6 100644 --- a/tests/entrypoints/openai/test_realtime_validation.py +++ b/tests/entrypoints/openai/realtime/test_realtime_validation.py @@ -11,11 +11,10 @@ import pybase64 as base64 import pytest import websockets +from tests.entrypoints.openai.conftest import add_attention_backend +from tests.utils import ROCM_ENV_OVERRIDES, ROCM_EXTRA_ARGS, RemoteOpenAIServer from vllm.assets.audio import AudioAsset -from ...utils import ROCM_ENV_OVERRIDES, ROCM_EXTRA_ARGS, RemoteOpenAIServer -from .conftest import add_attention_backend - MISTRAL_FORMAT_ARGS = [ "--tokenizer_mode", "mistral", diff --git a/tests/entrypoints/openai/responses/test_mcp_tools.py b/tests/entrypoints/openai/responses/test_mcp_tools.py index eb3c5becc1..763e2b2085 100644 --- a/tests/entrypoints/openai/responses/test_mcp_tools.py +++ b/tests/entrypoints/openai/responses/test_mcp_tools.py @@ -42,7 +42,7 @@ class TestMCPToolServerUnit: Note: The wildcard "*" is normalized to None by _extract_allowed_tools_from_mcp_requests before reaching this layer, so we only test None and specific tool filtering here. - See test_serving_responses.py for "*" normalization tests. + See responses/test_serving_responses.py for "*" normalization tests. """ def test_get_tool_description(self): diff --git a/tests/entrypoints/openai/test_serving_responses.py b/tests/entrypoints/openai/responses/test_serving_responses.py similarity index 100% rename from tests/entrypoints/openai/test_serving_responses.py rename to tests/entrypoints/openai/responses/test_serving_responses.py diff --git a/tests/entrypoints/openai/speech_to_text/__init__.py b/tests/entrypoints/openai/speech_to_text/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/entrypoints/openai/test_transcription_validation.py b/tests/entrypoints/openai/speech_to_text/test_transcription_validation.py similarity index 97% rename from tests/entrypoints/openai/test_transcription_validation.py rename to tests/entrypoints/openai/speech_to_text/test_transcription_validation.py index 58742f1868..e9bde638d4 100644 --- a/tests/entrypoints/openai/test_transcription_validation.py +++ b/tests/entrypoints/openai/speech_to_text/test_transcription_validation.py @@ -6,8 +6,8 @@ import json import pytest -from ...utils import ROCM_ENV_OVERRIDES, ROCM_EXTRA_ARGS, RemoteOpenAIServer -from .conftest import add_attention_backend +from tests.entrypoints.openai.conftest import add_attention_backend +from tests.utils import ROCM_ENV_OVERRIDES, ROCM_EXTRA_ARGS, RemoteOpenAIServer MISTRAL_FORMAT_ARGS = [ "--tokenizer_mode", diff --git a/tests/entrypoints/openai/test_transcription_validation_whisper.py b/tests/entrypoints/openai/speech_to_text/test_transcription_validation_whisper.py similarity index 99% rename from tests/entrypoints/openai/test_transcription_validation_whisper.py rename to tests/entrypoints/openai/speech_to_text/test_transcription_validation_whisper.py index c2479efe4f..357d5a1612 100644 --- a/tests/entrypoints/openai/test_transcription_validation_whisper.py +++ b/tests/entrypoints/openai/speech_to_text/test_transcription_validation_whisper.py @@ -13,7 +13,7 @@ import pytest import pytest_asyncio import soundfile as sf -from ...utils import RemoteOpenAIServer +from tests.utils import RemoteOpenAIServer MODEL_NAME = "openai/whisper-large-v3-turbo" diff --git a/tests/entrypoints/openai/test_translation_validation.py b/tests/entrypoints/openai/speech_to_text/test_translation_validation.py similarity index 98% rename from tests/entrypoints/openai/test_translation_validation.py rename to tests/entrypoints/openai/speech_to_text/test_translation_validation.py index 9c33ca421a..578da9a703 100644 --- a/tests/entrypoints/openai/test_translation_validation.py +++ b/tests/entrypoints/openai/speech_to_text/test_translation_validation.py @@ -14,8 +14,8 @@ import pytest import pytest_asyncio import soundfile as sf -from ...utils import RemoteOpenAIServer -from .conftest import add_attention_backend +from tests.entrypoints.openai.conftest import add_attention_backend +from tests.utils import RemoteOpenAIServer SERVER_ARGS = ["--enforce-eager"] diff --git a/tests/entrypoints/serve/__init__.py b/tests/entrypoints/serve/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/entrypoints/serve/tokenize/__init__.py b/tests/entrypoints/serve/tokenize/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/entrypoints/openai/test_tokenization.py b/tests/entrypoints/serve/tokenize/test_tokenization.py similarity index 99% rename from tests/entrypoints/openai/test_tokenization.py rename to tests/entrypoints/serve/tokenize/test_tokenization.py index 3d3f99da67..5fe83db81c 100644 --- a/tests/entrypoints/openai/test_tokenization.py +++ b/tests/entrypoints/serve/tokenize/test_tokenization.py @@ -5,10 +5,9 @@ import pytest import pytest_asyncio import requests +from tests.utils import RemoteOpenAIServer from vllm.tokenizers import get_tokenizer -from ...utils import RemoteOpenAIServer - # any model with a chat template should work here MODEL_NAME = "HuggingFaceH4/zephyr-7b-beta" diff --git a/tests/entrypoints/openai/test_tokenization_vlm.py b/tests/entrypoints/serve/tokenize/test_tokenization_vlm.py similarity index 97% rename from tests/entrypoints/openai/test_tokenization_vlm.py rename to tests/entrypoints/serve/tokenize/test_tokenization_vlm.py index c84ac3cf7d..6b226c6999 100644 --- a/tests/entrypoints/openai/test_tokenization_vlm.py +++ b/tests/entrypoints/serve/tokenize/test_tokenization_vlm.py @@ -13,7 +13,7 @@ import json import pytest import requests -from ...utils import RemoteOpenAIServer +from tests.utils import RemoteOpenAIServer MODEL_NAME = "Qwen/Qwen2.5-VL-3B-Instruct"