Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BatteryStatus tests to ensure it recovers automatically after issues #522

Merged
merged 11 commits into from
Jul 26, 2023

Conversation

shsms
Copy link
Contributor

@shsms shsms commented Jul 19, 2023

This PR also does:

  1. Improve usability of MockMicrogrid
  2. Update PowerDistributor tests to use MockMicrogrid
  3. And some small bug fixes and code quality improvements

@shsms shsms requested a review from a team as a code owner July 19, 2023 09:57
@shsms shsms requested a review from 0o111 July 19, 2023 09:57
@github-actions github-actions bot added part:tests Affects the unit, integration and performance (benchmarks) tests part:actor Affects an actor ot the actors utilities (decorator, etc.) labels Jul 19, 2023
@shsms shsms added this to the v0.23.0 milestone Jul 21, 2023
Copy link
Contributor

@daniel-zullo-frequenz daniel-zullo-frequenz left a comment

Choose a reason for hiding this comment

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

I have few minor comments to check for, other than that LGTM

shsms added 11 commits July 26, 2023 14:13
These classes were redefining all parameters, and that had the risk of
going out of sync with the fields in the base class.

This PR ties the wrappers with their base classes, such that it is
easy to identify changes to the base classes, without updates to the
wrappers.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
In most component graph configs, batteries would be attached to
inverters and the inverters would be meters.  But there might be some
cases where there are no meters,  and we'll have to read data from the
inverters.

This commit enables such test configs, that can be used in tests that
use the MockMicrogrid.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
This is the grid power test for component configs without a grid side
meter,  so it will have to read values from the inverter, to calculate
the grid power.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
MockMicrogrid makes it easy to dynamically create component graph
configurations to test with, rather than having to use manually
written component graphs with the lower level MockMicrogridClient.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
These are now unused because tests have migrated to use dynamic
component graphs provided by MockMicrogrid.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Because of the nature of async, it might happen that data is slightly
delayed, so a timer event gets triggered, but component data arrives
before the timer event arrives,  and in such cases, we end up going
into a bad state.

This issue is resolved in this PR, by checking that the component data
is actually late, every time a timer triggers.

Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>
@daniel-zullo-frequenz daniel-zullo-frequenz added this pull request to the merge queue Jul 26, 2023
@shsms shsms removed this pull request from the merge queue due to a manual request Jul 26, 2023
@shsms shsms added this pull request to the merge queue Jul 26, 2023
Merged via the queue into frequenz-floss:v0.x.x with commit 72178a2 Jul 26, 2023
8 checks passed
@shsms shsms deleted the power-dist-tests branch July 26, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part:actor Affects an actor ot the actors utilities (decorator, etc.) part:tests Affects the unit, integration and performance (benchmarks) tests
Projects
Development

Successfully merging this pull request may close these issues.

2 participants