A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 6, 14:30 UTC
[Refactor] Relocate responses API tests (#37241)
Signed-off-by: sfeng33 <4florafeng@gmail.com>
Flora Feng committed
Mar 17, 2026 at 01:14 UTC
3e3d320c1b367264f654204da42aeaf478cf3972
12 files changed
+45
-48
tests/entrypoints/openai/responses/conftest.py
+38
@@ -8,6 +8,9 @@ from collections.abc import Callable
8
from typing import Any
9
10
import pytest
11
+import pytest_asyncio
12
+
13
+from tests.utils import RemoteOpenAIServer
14
15
logger = logging.getLogger(__name__)
16
@@ -361,3 +364,38 @@ def log_response_diagnostics(
364
)
365
366
return diagnostics
367
+
368
+
369
+@pytest.fixture(scope="module")
370
+def default_server_args():
371
+ return [
372
+ "--max-model-len",
373
+ "8192",
374
+ "--enforce-eager", # For faster startup.
375
+ "--enable-auto-tool-choice",
376
+ "--structured-outputs-config.backend",
377
+ "xgrammar",
378
+ "--tool-call-parser",
379
+ "hermes",
380
+ "--reasoning-parser",
381
+ "qwen3",
382
+ ]
383
+
384
+
385
+@pytest.fixture(scope="module")
386
+def server_with_store(default_server_args):
387
+ with RemoteOpenAIServer(
388
+ "Qwen/Qwen3-1.7B",
389
+ default_server_args,
390
+ env_dict={
391
+ "VLLM_ENABLE_RESPONSES_API_STORE": "1",
392
+ "VLLM_SERVER_DEV_MODE": "1",
393
+ },
394
+ ) as remote_server:
395
+ yield remote_server
396
+
397
+
398
+@pytest_asyncio.fixture
399
+async def client(server_with_store):
400
+ async with server_with_store.get_async_client() as async_client:
401
+ yield async_client
tests/entrypoints/openai/responses/test_basic.py
renamed
tests/entrypoints/openai/responses/test_function_call.py
renamed
tests/entrypoints/openai/responses/test_harmony.py
+2
-1
@@ -16,7 +16,8 @@ import requests
16
from openai import InternalServerError, NotFoundError, OpenAI
17
from openai_harmony import Message
18
19
-from ....utils import RemoteOpenAIServer
19
+from tests.utils import RemoteOpenAIServer
20
+
21
from .conftest import (
22
BASE_TEST_ENV,
23
events_contain_type,
tests/entrypoints/openai/responses/test_image.py
renamed
tests/entrypoints/openai/responses/test_mcp_tools.py
+1
-1
@@ -9,9 +9,9 @@ import pytest_asyncio
9
from openai import OpenAI
10
from openai_harmony import ToolDescription, ToolNamespaceConfig
11
12
+from tests.utils import RemoteOpenAIServer
13
from vllm.entrypoints.mcp.tool_server import MCPToolServer
14
14
-from ....utils import RemoteOpenAIServer
15
from .conftest import (
16
BASE_TEST_ENV,
17
events_contain_type,
tests/entrypoints/openai/responses/test_parsable_context.py
+2
-1
@@ -9,7 +9,8 @@ import pytest
9
import pytest_asyncio
10
from openai import OpenAI
11
12
-from ....utils import RemoteOpenAIServer
12
+from tests.utils import RemoteOpenAIServer
13
+
14
from .conftest import (
15
BASE_TEST_ENV,
16
has_output_type,
tests/entrypoints/openai/responses/test_simple.py
+2
-1
@@ -5,7 +5,8 @@ import pytest
5
import pytest_asyncio
6
from openai import OpenAI
7
8
-from ....utils import RemoteOpenAIServer
8
+from tests.utils import RemoteOpenAIServer
9
+
10
from .conftest import validate_streaming_event_stack
11
12
MODEL_NAME = "Qwen/Qwen3-8B"
tests/entrypoints/openai/responses/test_stateful.py
renamed
tests/entrypoints/openai/responses/test_structured_output.py
renamed
tests/v1/entrypoints/openai/serving_responses/__init__.py
tests/v1/entrypoints/openai/serving_responses/conftest.py
deleted
-44
@@ -1,44 +0,0 @@
1
-# SPDX-License-Identifier: Apache-2.0
2
-# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
-import pytest
4
-import pytest_asyncio
5
-
6
-from tests.utils import RemoteOpenAIServer
7
-
8
-# Use a small reasoning model to test the responses API.
9
-MODEL_NAME = "Qwen/Qwen3-1.7B"
10
-
11
-
12
-@pytest.fixture(scope="module")
13
-def default_server_args():
14
- return [
15
- "--max-model-len",
16
- "8192",
17
- "--enforce-eager", # For faster startup.
18
- "--enable-auto-tool-choice",
19
- "--structured-outputs-config.backend",
20
- "xgrammar",
21
- "--tool-call-parser",
22
- "hermes",
23
- "--reasoning-parser",
24
- "qwen3",
25
- ]
26
-
27
-
28
-@pytest.fixture(scope="module")
29
-def server_with_store(default_server_args):
30
- with RemoteOpenAIServer(
31
- MODEL_NAME,
32
- default_server_args,
33
- env_dict={
34
- "VLLM_ENABLE_RESPONSES_API_STORE": "1",
35
- "VLLM_SERVER_DEV_MODE": "1",
36
- },
37
- ) as remote_server:
38
- yield remote_server
39
-
40
-
41
-@pytest_asyncio.fixture
42
-async def client(server_with_store):
43
- async with server_with_store.get_async_client() as async_client:
44
- yield async_client