From 6de08e8b46e082172bc146cf8031b29d9fdcab92 Mon Sep 17 00:00:00 2001 From: Flora Feng <4florafeng@gmail.com> Date: Fri, 29 May 2026 15:23:56 -0400 Subject: [PATCH] [CI] Remove redundant test_chat_with_tool_reasoning.py (#44011) Signed-off-by: sfeng33 <4florafeng@gmail.com> --- .buildkite/test-amd.yaml | 4 +- .buildkite/test_areas/entrypoints.yaml | 2 +- .buildkite/test_areas/rust_frontend.yaml | 4 +- .../test_chat_with_tool_reasoning.py | 141 ------------------ 4 files changed, 5 insertions(+), 146 deletions(-) delete mode 100644 tests/entrypoints/openai/chat_completion/test_chat_with_tool_reasoning.py diff --git a/.buildkite/test-amd.yaml b/.buildkite/test-amd.yaml index 80033fefb4..50c13e4a89 100644 --- a/.buildkite/test-amd.yaml +++ b/.buildkite/test-amd.yaml @@ -1261,7 +1261,7 @@ steps: - tests/entrypoints/test_chat_utils commands: - export VLLM_WORKER_MULTIPROC_METHOD=spawn - - pytest -v -s entrypoints/openai/chat_completion --ignore=entrypoints/openai/chat_completion/test_chat_with_tool_reasoning.py --ignore=entrypoints/openai/chat_completion/test_oot_registration.py + - pytest -v -s entrypoints/openai/chat_completion --ignore=entrypoints/openai/chat_completion/test_oot_registration.py - label: Entrypoints Integration (API Server openai - Part 2) # TBD timeout_in_minutes: 180 @@ -2768,7 +2768,7 @@ steps: - tests/entrypoints/test_chat_utils commands: - export VLLM_WORKER_MULTIPROC_METHOD=spawn - - pytest -v -s entrypoints/openai/chat_completion --ignore=entrypoints/openai/chat_completion/test_chat_with_tool_reasoning.py --ignore=entrypoints/openai/chat_completion/test_oot_registration.py + - pytest -v -s entrypoints/openai/chat_completion --ignore=entrypoints/openai/chat_completion/test_oot_registration.py - label: Entrypoints Integration (API Server openai - Part 2) # TBD timeout_in_minutes: 180 diff --git a/.buildkite/test_areas/entrypoints.yaml b/.buildkite/test_areas/entrypoints.yaml index 57bde22194..1ae8c79fab 100644 --- a/.buildkite/test_areas/entrypoints.yaml +++ b/.buildkite/test_areas/entrypoints.yaml @@ -43,7 +43,7 @@ steps: - tests/entrypoints/test_chat_utils commands: - export VLLM_WORKER_MULTIPROC_METHOD=spawn - - pytest -v -s entrypoints/openai/chat_completion --ignore=entrypoints/openai/chat_completion/test_chat_with_tool_reasoning.py --ignore=entrypoints/openai/chat_completion/test_oot_registration.py + - pytest -v -s entrypoints/openai/chat_completion --ignore=entrypoints/openai/chat_completion/test_oot_registration.py mirror: amd: device: mi325_1 diff --git a/.buildkite/test_areas/rust_frontend.yaml b/.buildkite/test_areas/rust_frontend.yaml index f750d58be5..df37022725 100644 --- a/.buildkite/test_areas/rust_frontend.yaml +++ b/.buildkite/test_areas/rust_frontend.yaml @@ -16,7 +16,7 @@ steps: - tests/benchmarks/test_serve_cli.py - tests/entrypoints/openai/chat_completion/test_chat_completion.py # - tests/entrypoints/openai/chat_completion/test_chat_logit_bias_validation.py - # - tests/entrypoints/openai/chat_completion/test_chat_with_tool_reasoning.py + # - tests/entrypoints/openai/completion/test_prompt_validation.py - tests/entrypoints/openai/completion/test_shutdown.py # - tests/entrypoints/openai/test_return_token_ids.py @@ -28,7 +28,7 @@ steps: - pytest -v -s benchmarks/test_serve_cli.py -k "not insecure and not (test_bench_serve and not test_bench_serve_chat)" - pytest -v -s entrypoints/openai/chat_completion/test_chat_completion.py # - pytest -v -s entrypoints/openai/chat_completion/test_chat_logit_bias_validation.py -k "not invalid" - # - pytest -v -s entrypoints/openai/chat_completion/test_chat_with_tool_reasoning.py + # - pytest -v -s entrypoints/openai/completion/test_prompt_validation.py -k "not prompt_embeds" - pytest -v -s entrypoints/openai/completion/test_shutdown.py -k "not engine_failure and not test_abort_timeout_exits_quickly" # - pytest -v -s entrypoints/openai/test_return_token_ids.py diff --git a/tests/entrypoints/openai/chat_completion/test_chat_with_tool_reasoning.py b/tests/entrypoints/openai/chat_completion/test_chat_with_tool_reasoning.py deleted file mode 100644 index 295b558894..0000000000 --- a/tests/entrypoints/openai/chat_completion/test_chat_with_tool_reasoning.py +++ /dev/null @@ -1,141 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# SPDX-FileCopyrightText: Copyright contributors to the vLLM project - -import openai # use the official client for correctness check -import pytest -import pytest_asyncio - -from tests.utils import RemoteOpenAIServer - -# a reasoning and tool calling model -MODEL_NAME = "Qwen/QwQ-32B" - - -@pytest.fixture(scope="module") -def server(): - args = [ - "--max-model-len", - "8192", - "--enforce-eager", - "--reasoning-parser", - "deepseek_r1", - "--enable-auto-tool-choice", - "--tool-call-parser", - "hermes", - ] - - with RemoteOpenAIServer(MODEL_NAME, args) as remote_server: - yield remote_server - - -@pytest_asyncio.fixture -async def client(server): - async with server.get_async_client() as async_client: - yield async_client - - -TOOLS = [ - { - "type": "function", - "function": { - "name": "get_current_weather", - "description": "Get the current weather in a given location", - "parameters": { - "type": "object", - "properties": { - "city": { - "type": "string", - "description": "The city to find the weather for, e.g. " - "'San Francisco'", - }, - "state": { - "type": "string", - "description": "the two-letter abbreviation for the state that " - "the city is in, e.g. 'CA' which would mean 'California'", - }, - "unit": { - "type": "string", - "description": "The unit to fetch the temperature in", - "enum": ["celsius", "fahrenheit"], - }, - }, - "required": ["city", "state", "unit"], - }, - }, - } -] - -MESSAGES = [ - {"role": "user", "content": "Hi! How are you doing today?"}, - {"role": "assistant", "content": "I'm doing well! How can I help you?"}, - { - "role": "user", - "content": "Can you tell me what the temperate will be in Dallas, " - "in fahrenheit?", - }, -] - -FUNC_NAME = "get_current_weather" -FUNC_ARGS = """{"city": "Dallas", "state": "TX", "unit": "fahrenheit"}""" - - -def extract_reasoning_and_calls(chunks: list): - reasoning = "" - tool_call_idx = -1 - arguments = [] - function_names = [] - for chunk in chunks: - if chunk.choices[0].delta.tool_calls: - tool_call = chunk.choices[0].delta.tool_calls[0] - if tool_call.index != tool_call_idx: - tool_call_idx = chunk.choices[0].delta.tool_calls[0].index - arguments.append("") - function_names.append("") - - if tool_call.function: - if tool_call.function.name: - function_names[tool_call_idx] = tool_call.function.name - - if tool_call.function.arguments: - arguments[tool_call_idx] += tool_call.function.arguments - else: - if hasattr(chunk.choices[0].delta, "reasoning"): - reasoning += chunk.choices[0].delta.reasoning - return reasoning, arguments, function_names - - -# test streaming -@pytest.mark.asyncio -async def test_chat_streaming_of_tool_and_reasoning(client: openai.AsyncOpenAI): - stream = await client.chat.completions.create( - model=MODEL_NAME, - messages=MESSAGES, - tools=TOOLS, - temperature=0.0, - stream=True, - ) - - chunks = [] - async for chunk in stream: - chunks.append(chunk) - - reasoning, arguments, function_names = extract_reasoning_and_calls(chunks) - assert len(reasoning) > 0 - assert len(function_names) > 0 and function_names[0] == FUNC_NAME - assert len(arguments) > 0 and arguments[0] == FUNC_ARGS - - -# test full generate -@pytest.mark.asyncio -async def test_chat_full_of_tool_and_reasoning(client: openai.AsyncOpenAI): - tool_calls = await client.chat.completions.create( - model=MODEL_NAME, - messages=MESSAGES, - tools=TOOLS, - temperature=0.0, - stream=False, - ) - - assert len(tool_calls.choices[0].message.reasoning) > 0 - assert tool_calls.choices[0].message.tool_calls[0].function.name == FUNC_NAME - assert tool_calls.choices[0].message.tool_calls[0].function.arguments == FUNC_ARGS