power-policy-service: Add test coverage for provider power#762
Open
RobertZ2011 wants to merge 1 commit intoOpenDevicePartnership:v0.2.0from
Open
power-policy-service: Add test coverage for provider power#762RobertZ2011 wants to merge 1 commit intoOpenDevicePartnership:v0.2.0from
RobertZ2011 wants to merge 1 commit intoOpenDevicePartnership:v0.2.0from
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the power-policy-service test suite to validate total provider power computations, by making the service instance accessible from tests and asserting expected totals during provider lifecycle flows.
Changes:
- Wrap the power policy
Servicein a sharedMutexand pass it into test closures viarun_test. - Add assertions in provider tests for
compute_total_provider_power_mw()across connect/upgrade/detach/disconnect scenarios. - Add a consumer test assertion ensuring consumer events don’t affect provider power totals.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| power-policy-service/tests/common/mod.rs | Refactors test harness to share the service via ServiceMutex and pass it into test functions. |
| power-policy-service/tests/provider.rs | Adds provider-power total assertions throughout provider flow tests. |
| power-policy-service/tests/consumer.rs | Adds a provider-power total assertion in consumer flow and updates test signatures for the new service argument. |
| power-policy-service/tests/unconstrained.rs | Updates test signature/imports to accept the new service argument. |
f21a6f7 to
104dfaf
Compare
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.