power-policy-service: Add additional consumer tests#771
Merged
RobertZ2011 merged 1 commit intoOpenDevicePartnership:v0.2.0from Apr 1, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds additional integration-style consumer tests for power-policy-service to validate edge-case consumer selection behavior (minimum-power gating and “no swap on equal capability”) using the existing async test harness.
Changes:
- Added
test_min_consumer_powerto verify consumers below the configured minimum threshold are ignored (no PSU calls, no service events). - Added
test_no_swapto verify no consumer swap occurs when a second consumer advertises the same capability as the current consumer. - Extended the shared test harness to configure
Servicewithmin_consumer_threshold_mw = Some(7500)and introduced aMINIMAL_POWERcapability constant.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| power-policy-service/tests/consumer.rs | Adds two new consumer behavior tests: minimum-threshold ignore and no-swap on equal capability. |
| power-policy-service/tests/common/mod.rs | Introduces MINIMAL_POWER and configures the test harness Service::new(...) with a minimum consumer threshold. |
4e75a6a to
cae54cb
Compare
cae54cb to
d70eb54
Compare
d70eb54 to
4c798b9
Compare
jerrysxie
approved these changes
Mar 31, 2026
kurtjd
approved these changes
Mar 31, 2026
4c798b9 to
1d2b7ef
Compare
tullom
approved these changes
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.