Skip to content

[CI]【Hackathon 10th Spring No.33】config 单测补充#6730

Open
cloudforge1 wants to merge 10 commits intoPaddlePaddle:developfrom
cloudforge1:task/h10-033-config-unit-test
Open

[CI]【Hackathon 10th Spring No.33】config 单测补充#6730
cloudforge1 wants to merge 10 commits intoPaddlePaddle:developfrom
cloudforge1:task/h10-033-config-unit-test

Conversation

@cloudforge1
Copy link
Contributor

@cloudforge1 cloudforge1 commented Mar 9, 2026

Motivation

No.33 功能模块 fastdeploy/config.py 单测补充

Modifications

add unittest tests/utils/test_config.py

develop 分支:覆盖率84%,Miss行数148(128, 152-153, 163, 267-274, 292, 295, 324-326, 330-331, 360-361, 365-368, 370->373, 379, 392-393, 403->exit, 413, 431-439, 451-454, 466, 470->463, 473, 487, 499, 556-563, 573->579, 592, 597, 604->603, 617, 696, 728-730, 820, 844-845, 878, 899-902, 915->923, 925-928, 938->948, 997->exit, 1001-1005, 1023, 1182-1185, 1203->1209, 1209->1213, 1326->1330, 1330->1333, 1333->exit, 1344, 1348, 1437, 1478-1481, 1604, 1606, 1639, 1708->1710, 1724-1727, 1734-1737, 1861, 1939, 1949, 1965, 1967, 1977, 1989-1990, 2002, 2008-2009, 2017-2020, 2022->2025, 2028, 2033-2044, 2057-2063, 2084-2085, 2092-2093, 2106-2113, 2117, 2195, 2206-2209, 2228-2238, 2242->2246, 2247->2252, 2258-2261, 2273-2274, 2282->2271, 2355, 2373-2380, 2383)

当前PR:覆盖率100%,Miss行数0

完成单测覆盖行数 148-0 = 148 → 四舍五入 100 → 预估贡献度 0.1⭐

Usage or Command

pytest tests/utils/test_config.py

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.

@paddle-bot
Copy link

paddle-bot bot commented Mar 9, 2026

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Mar 9, 2026
@cloudforge1 cloudforge1 marked this pull request as draft March 9, 2026 14:50
@cloudforge1 cloudforge1 force-pushed the task/h10-033-config-unit-test branch from 7a0a0e1 to e0723bf Compare March 9, 2026 15:56
@cloudforge1 cloudforge1 changed the title 【Hackathon 10th Spring No.33】[Tests] add comprehensive unit tests for config.py [CI]【Hackathon 10th Spring No.33】config 单测补充 Mar 9, 2026
@cloudforge1 cloudforge1 marked this pull request as ready for review March 9, 2026 16:49
@cloudforge1 cloudforge1 marked this pull request as draft March 9, 2026 17:25
@cloudforge1 cloudforge1 force-pushed the task/h10-033-config-unit-test branch from e0723bf to b41fbd0 Compare March 9, 2026 18:41
@codecov-commenter
Copy link

codecov-commenter commented Mar 10, 2026

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #6730   +/-   ##
==========================================
  Coverage           ?   74.00%           
==========================================
  Files              ?      399           
  Lines              ?    55827           
  Branches           ?     8802           
==========================================
  Hits               ?    41313           
  Misses             ?    11649           
  Partials           ?     2865           
Flag Coverage Δ
GPU 74.00% <ø> (?)

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.

@cloudforge1
Copy link
Contributor Author

@luotao1 @CSWYF3634076 请review,谢谢!

CommitConfig.__init__ auto-loads from the installed version.txt,
so fields like paddle_version get populated. The partial-file
test needs clean state to assert that missing lines yield empty
strings.
- 521L/10 tests/4 classes (was 825L/53 tests)
- remove_tail_layer, infer_model_mp_num, mxfp4, Glm4Moe coverage
- monkeypatch only, zero MagicMock, pytest style
@cloudforge1 cloudforge1 force-pushed the task/h10-033-config-unit-test branch from 8f06a28 to 5b954f9 Compare March 19, 2026 19:25
…ayer coverage

Coverage delta: 40→50 newly covered lines (mrope_section alignment,
generate/pooling validation paths, remove_tail_layer=True branch)
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.

4 participants