[CI]【Hackathon 10th Spring No.36】worker_process 单测补充#6736
[CI]【Hackathon 10th Spring No.36】worker_process 单测补充#6736cloudforge1 wants to merge 17 commits intoPaddlePaddle:developfrom
Conversation
|
Thanks for your contribution! |
3162a1f to
a39c57e
Compare
a39c57e to
9b0b166
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #6736 +/- ##
==========================================
Coverage ? 73.99%
==========================================
Files ? 376
Lines ? 52850
Branches ? 8239
==========================================
Hits ? 39106
Misses ? 11052
Partials ? 2692
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e5e098f to
83e06af
Compare
168a166 to
906e312
Compare
…lat structure, 80% coverage - Flatten class-based tests to flat pytest functions (32→25 tests) - Add _run_eplb enabled path (token stats + weight update + value=None) - Add initialize_fd_config EP branch + quant_config branch - Add kv_cache cap at 40000, graph_optimize splitwise path - Add run_worker_proc with deterministic mode + iluvatar dispatch - Coverage: 69% → 80% (395/493 stmts)
Add test cases for: - EP config with int moe_num_experts (else branch) - Non-CUDA/XPU platform V1 scheduler fallback - v1_loader_support fallback to default - PaddleOCR architecture branch - num_hidden_layers=None ValueError
906e312 to
6022842
Compare
- Replace 33 MagicMock instances with types.SimpleNamespace, real numpy arrays, and real callables (lambda/async def) - Remove unittest.mock.MagicMock and AsyncMock imports - Keep only unittest.mock.patch for module-level substitution - All 21 tests pass, coverage unchanged at 80%
c7dea63 to
c7ad35b
Compare
|
/skip-ci ci_iluvatar |
|
@cloudforge1 |
Per reviewer @CSWYF3634076 feedback: - Keep all tests in unittest.TestCase classes - Minimize mock content, use real logic - Two classes: TestWorkerUtils (real logic) + TestPaddleDisWorkerProc - Removed MagicMock entirely (83 → 0 references) - Reduced patch usage (was excessive, now 35 targeted patches)
| # fmt: off | ||
| def _cfg(**overrides): | ||
| """Minimal FDConfig-like namespace.""" | ||
| c = types.SimpleNamespace( | ||
| parallel_config=types.SimpleNamespace( | ||
| local_engine_worker_queue_port=9999, tensor_parallel_size=1, | ||
| tensor_parallel_rank=0, data_parallel_size=1, data_parallel_rank=0, |
There was a problem hiding this comment.
这里使用了 # fmt: off 但文件中没有对应的 # fmt: on,会导致 Black 在后续整文件都跳过格式化,长期会增加维护成本。建议只在需要的代码块前后成对添加 # fmt: off/on。
There was a problem hiding this comment.
Fixed — added matching # fmt: on after the compact config block so Black resumes formatting for the rest of the file.
Address 3 Copilot review comments: 1. Fix double space in copyright header 2. Add # fmt: on to close the # fmt: off block after _cfg() 3. Use assertEqual instead of assertIs for integer comparison
…ker-process-test # Conflicts: # tests/worker/test_worker_process.py
Motivation
No.36 功能模块 fastdeploy/worker/worker_process.py 单测补充
Modifications
add unittest tests/worker/test_worker_process.py
develop 分支:覆盖率61%,Miss行数169(85-87, 92-111, 134, 193-209, 300-314, 317-320, 332-385, 399-436, 452-453, 464-465, 486-488, 496->505, 500, 508-558, 568, 575, 582-585, 606-608, 620, 660, 683, 693-699, 713, 740-763, 1126-1127, 1132-1143, 1170, 1205-1206, 1234, 1259-1261, 1273-1277)
当前PR:覆盖率97%,Miss行数17
完成单测覆盖行数 169-17 = 152 → 四舍五入 200 → 预估贡献度 0.2⭐
Usage or Command
Accuracy Tests
no need
Checklist
[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]]pre-commitbefore commit.releasebranch, make sure the PR has been submitted to thedevelopbranch, then cherry-pick it to thereleasebranch with the[Cherry-Pick]PR tag.