Skip to content

Conversation

@kesmeey
Copy link
Collaborator

@kesmeey kesmeey commented Dec 27, 2025

Motivation

💡 If this PR is a Cherry Pick, the PR title needs to follow the format by adding the [Cherry-Pick] label at the very beginning and appending the original PR ID at the end. For example, [Cherry-Pick][CI] Add check trigger and logic(#5191)

💡 如若此PR是Cherry Pick,PR标题需遵循格式,在最开始加上[Cherry-Pick]标签,以及最后面加上原PR ID,例如[Cherry-Pick][CI] Add check trigger and logic(#5191)

No need

Modifications

No need

Usage or Command

N/A

Accuracy Tests

N/A

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 27, 2025 17:40
@paddle-bot
Copy link

paddle-bot bot commented Dec 27, 2025

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Dec 27, 2025
@kesmeey kesmeey changed the title Add 15 simple attribute validation tests to existing TestCommonEngine… [CI] Add 15 simple attribute validation tests to existing TestCommonEngine… Dec 27, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds 15 new test methods to the TestCommonEngine class to validate the existence and callability of various engine methods and attributes. However, the PR has critical issues including a misplaced if __name__ == "__main__" block that breaks the test file structure, and several tests with redundant assertion logic that provides no meaningful validation.

Key Changes:

  • Added 8 tests checking method existence and callability (lines 191-229)
  • Added 7 tests checking configuration and component attributes (lines 231-326)
  • Introduced a duplicate if __name__ == "__main__" block that causes structural issues (lines 852-853)

Comment on lines +299 to +301
for attr in dp_attrs:
if hasattr(dp, attr):
self.assertTrue(hasattr(dp, attr))
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

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

The assertion logic here is redundant and provides no value. Inside the if hasattr(dp, attr) condition, you already know the attribute exists, so calling self.assertTrue(hasattr(dp, attr)) will always pass. This test should either directly assert on the attribute without the conditional check, or verify meaningful properties about the attribute values.

Copilot uses AI. Check for mistakes.
Comment on lines +311 to +313
for attr in sc_attrs:
if hasattr(sc, attr):
self.assertTrue(hasattr(sc, attr))
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

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

The assertion logic here is redundant and provides no value. Inside the if hasattr(sc, attr) condition, you already know the attribute exists, so calling self.assertTrue(hasattr(sc, attr)) will always pass. This test should either directly assert on the attribute without the conditional check, or verify meaningful properties about the attribute values.

Copilot uses AI. Check for mistakes.
Comment on lines 852 to 854
if __name__ == "__main__":
unittest.main()

Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

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

This if __name__ == "__main__" block is incorrectly placed in the middle of the TestCommonEngineAdditionalCoverage class. It should be removed from this location. The first occurrence at line 328 is correctly placed at the end of the TestCommonEngine class, and this duplicate causes all subsequent test methods (starting from line 855) to become unreachable dead code since they appear after the main block but are still indented as class methods.

Suggested change
if __name__ == "__main__":
unittest.main()

Copilot uses AI. Check for mistakes.
Comment on lines +242 to +244
for attr in model_attrs:
if hasattr(model_cfg, attr):
self.assertTrue(hasattr(model_cfg, attr))
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

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

The assertion logic here is redundant and provides no value. Inside the if hasattr(model_cfg, attr) condition, you already know the attribute exists, so calling self.assertTrue(hasattr(model_cfg, attr)) will always pass. This test should either directly assert on the attribute without the conditional check, or verify meaningful properties about the attribute values.

Copilot uses AI. Check for mistakes.
Comment on lines +257 to +259
for attr in cache_attrs:
if hasattr(cache_cfg, attr):
self.assertTrue(hasattr(cache_cfg, attr))
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

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

The assertion logic here is redundant and provides no value. Inside the if hasattr(cache_cfg, attr) condition, you already know the attribute exists, so calling self.assertTrue(hasattr(cache_cfg, attr)) will always pass. This test should either directly assert on the attribute without the conditional check, or verify meaningful properties about the attribute values.

Copilot uses AI. Check for mistakes.
Comment on lines +272 to +274
for attr in parallel_attrs:
if hasattr(parallel_cfg, attr):
self.assertTrue(hasattr(parallel_cfg, attr))
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

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

The assertion logic here is redundant and provides no value. Inside the if hasattr(parallel_cfg, attr) condition, you already know the attribute exists, so calling self.assertTrue(hasattr(parallel_cfg, attr)) will always pass. This test should either directly assert on the attribute without the conditional check, or verify meaningful properties about the attribute values.

Copilot uses AI. Check for mistakes.
Comment on lines +287 to +289
for attr in struct_attrs:
if hasattr(struct_cfg, attr):
self.assertTrue(hasattr(struct_cfg, attr))
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

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

The assertion logic here is redundant and provides no value. Inside the if hasattr(struct_cfg, attr) condition, you already know the attribute exists, so calling self.assertTrue(hasattr(struct_cfg, attr)) will always pass. This test should either directly assert on the attribute without the conditional check, or verify meaningful properties about the attribute values.

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

codecov-commenter commented Dec 27, 2025

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #5804   +/-   ##
==========================================
  Coverage           ?   65.55%           
==========================================
  Files              ?      337           
  Lines              ?    43082           
  Branches           ?     6639           
==========================================
  Hits               ?    28243           
  Misses             ?    12733           
  Partials           ?     2106           
Flag Coverage Δ
GPU 65.55% <ø> (?)

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.

@kesmeey kesmeey changed the title [CI] Add 15 simple attribute validation tests to existing TestCommonEngine… [CI] Add tests to common_engine Dec 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants