Prhub

#44023 [CI] Remove duplicate Harmony test coverage

原始 PR 作者 sfeng33 合并时间 2026-05-30 06:52 文件变更 2 提交数 1 评论 0 代码增减 +8 / -156

执行摘要

删除重复的 Harmony 测试覆盖

依据 PR Body 说明,test_tools_and_reasoning 是 test_multi_turn_tools_and_reasoning 的严格子集,而三个 without_functions_prefix 的流式测试的裸 recipient 名称处理逻辑已在 test_harmony_utils.py 中的 extract_function_from_recipient 单元测试覆盖,因此删除重复测试以精简测试套件。

该 PR 已合并,无直接行动项。建议团队将此作为测试清理的范例,定期审查并移除重复或不必要的测试,保持测试套件精简高效。

讨论亮点

无实质性技术讨论;Reviewer yewentao256 快速批准,评论为 "LGTM, thanks for the work!"。

实现拆解

  1. 在 test_serving_chat.py 中删除 test_tools_and_reasoning 方法(第 1452-1534 行)。
  2. 在 test_serving_chat_stream_harmony.py 中删除三个方法:test_new_tool_call_without_functions_prefix、test_tool_call_argument_streaming_without_functions_prefix、test_tool_call_index_from_previous_messages_without_functions_prefix。
  3. 调整剩余测试中 TokenState 参数换行格式以保持代码风格一致。
  4. 运行测试确认所有被删除的测试场景仍被其他测试覆盖。
文件 模块 状态 重要度
tests/entrypoints/openai/chat_completion/test_serving_chat.py 聊天服务 modified 5.78
tests/entrypoints/openai/chat_completion/test_serving_chat_stream_harmony.py Harmony 测试 modified 6.17

关键符号

test_tools_and_reasoning test_new_tool_call_without_functions_prefix test_tool_call_argument_streaming_without_functions_prefix test_tool_call_index_from_previous_messages_without_functions_prefix

分析完成后,这里会展示 LLM 生成的相对完整源码片段和详细注释。

评论区精华

没有提炼出高价值讨论线程

当前评论区没有形成足够清晰的争议点或结论,后续有更多讨论时会体现在这里。

风险与影响

低风险。删除的测试均为其他测试的严格子集或已被单元测试覆盖。可能的风险包括:如果后续修改了相关逻辑但未更新保留的测试,可能丢失检测。但保留的测试(如 test_multi_turn_tools_and_reasoning 和 test_harmony_utils 中的单元测试)已经覆盖了核心路径,回归风险可控。

对用户无影响,仅影响开发和 CI。开发者在修改 Harmony 相关代码时可能减少重复测试的维护负担;CI 时间略有缩短(减少 156 行测试代码)。团队可更快获得反馈。

低风险 测试覆盖调整

关联 Issue

未识别关联 Issue

当前没有检测到明确关联的 Issue 链接,后续同步到相关引用后会出现在这里。

完整报告

参与讨论