Skip to content

power-policy-service: Add additional consumer tests#771

Merged
RobertZ2011 merged 1 commit intoOpenDevicePartnership:v0.2.0from
RobertZ2011:power-policy-additional-tests
Apr 1, 2026
Merged

power-policy-service: Add additional consumer tests#771
RobertZ2011 merged 1 commit intoOpenDevicePartnership:v0.2.0from
RobertZ2011:power-policy-additional-tests

Conversation

@RobertZ2011
Copy link
Copy Markdown
Contributor

No description provided.

@RobertZ2011 RobertZ2011 self-assigned this Mar 31, 2026
Copilot AI review requested due to automatic review settings March 31, 2026 17:32
Copy link
Copy Markdown
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

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_power to verify consumers below the configured minimum threshold are ignored (no PSU calls, no service events).
  • Added test_no_swap to verify no consumer swap occurs when a second consumer advertises the same capability as the current consumer.
  • Extended the shared test harness to configure Service with min_consumer_threshold_mw = Some(7500) and introduced a MINIMAL_POWER capability 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.

@RobertZ2011 RobertZ2011 force-pushed the power-policy-additional-tests branch from 4e75a6a to cae54cb Compare March 31, 2026 17:46
Copilot AI review requested due to automatic review settings March 31, 2026 17:52
@RobertZ2011 RobertZ2011 force-pushed the power-policy-additional-tests branch from cae54cb to d70eb54 Compare March 31, 2026 17:52
Copy link
Copy Markdown
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@github-project-automation github-project-automation bot moved this to In progress in ODP Backlog Mar 31, 2026
@RobertZ2011 RobertZ2011 force-pushed the power-policy-additional-tests branch from 4c798b9 to 1d2b7ef Compare March 31, 2026 23:30
@RobertZ2011 RobertZ2011 merged commit b010625 into OpenDevicePartnership:v0.2.0 Apr 1, 2026
15 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in ODP Backlog Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants