Skip to content

[CI]【Hackathon 9th Sprint No.35】功能模块 fastdeploy/engine/ common_engine.py 单测补充 - #5665

Closed
kesmeey wants to merge 2 commits into
PaddlePaddle:developfrom
kesmeey:35
Closed

kesmeey wants to merge 2 commits into
PaddlePaddle:developfrom
kesmeey:35

Conversation

@kesmeey

@kesmeey kesmeey commented Dec 19, 2025

Copy link
Copy Markdown
Collaborator

Motivation

No need

Modifications

No need

Usage or Command

No need

Accuracy Tests

No need

Checklist

  • Add at least a tag in the PR title.
    • Tag list: [[FDConfig],[APIServer],[Engine], [Scheduler], [PD Disaggregation], [Executor], [Graph Optimization], [Speculative Decoding], [RL], [Models], [Quantization], [Loader], [OP], [KVCache], [DataProcessor], [BugFix], [Docs], [CI], [Optimization], [Feature], [Benchmark], [Others], [XPU], [HPU], [GCU], [DCU], [Iluvatar], [Metax]]
    • You can add new tags based on the PR content, but the semantics must be clear.
  • Format your code, run pre-commit before commit.
  • Add unit tests. Please write the reason in this PR if no unit tests.
  • Provide accuracy results.
  • If the current PR is submitting to the release branch, make sure the PR has been submitted to the develop branch, then cherry-pick it to the release branch with the [Cherry-Pick] PR tag.

Copilot AI review requested due to automatic review settings December 19, 2025 09:50
@paddle-bot

paddle-bot Bot commented Dec 19, 2025

Copy link
Copy Markdown

Thanks for your contribution!

@paddle-bot paddle-bot Bot added the contributor External developers label Dec 19, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

本 PR 为 Hackathon 9th Sprint No.35 任务,旨在补充 fastdeploy/engine/common_engine.py 模块的单元测试覆盖率。主要添加了针对 EngineService 核心功能的测试用例,包括任务插入、预填充请求处理、分块更新、token 解码和 ZMQ 通信等关键路径的测试。

  • 新增 10 个测试方法覆盖 common_engine.py 中的各种边界条件和错误处理路径
  • 添加辅助方法 _make_request 和 _make_minimal_engine 简化测试对象创建
  • 引入必要的导入(types, Request, RequestOutput, envs)支持新测试

Comment thread tests/engine/test_common_engine.py Outdated

def test_insert_prefilled_requests_error_and_success(self):
"""Cover _insert_prefilled_requests branches for error_code != 200 and eos-handling."""
from fastdeploy.engine.request import RequestOutput

Copilot AI Dec 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RequestOutput is already imported at the top of the file (line 27). This local import is redundant and should be removed.

Suggested change
from fastdeploy.engine.request import RequestOutput

Copilot uses AI. Check for mistakes.
Comment thread tests/engine/test_common_engine.py Outdated
Comment on lines +1015 to +1016
from fastdeploy.utils import envs

Copilot AI Dec 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The envs module is already imported at the top of the file (line 28). This local import is redundant and should be removed.

Suggested change
from fastdeploy.utils import envs

Copilot uses AI. Check for mistakes.
@codecov-commenter

codecov-commenter commented Dec 19, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@672620c). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #5665   +/-   ##
==========================================
  Coverage           ?   18.80%           
==========================================
  Files              ?      345           
  Lines              ?    45095           
  Branches           ?     6915           
==========================================
  Hits               ?     8481           
  Misses             ?    36109           
  Partials           ?      505           
Flag Coverage Δ
GPU 18.80% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch had an error being deployed

1 failed deployment
Metax_ci — 53a20095 Deployed Dec 27, 2025 by kesmeey via Trigger Jenkins for PR #1095
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants