Closed anschweitzer closed 2 years ago
Merging #75 (531e390) into main (f8f16f6) will increase coverage by
4.61%
. The diff coverage is91.81%
.
@@ Coverage Diff @@
## main #75 +/- ##
==========================================
+ Coverage 71.43% 76.05% +4.61%
==========================================
Files 134 135 +1
Lines 4481 4522 +41
==========================================
+ Hits 3201 3439 +238
+ Misses 1280 1083 -197
Impacted Files | Coverage Δ | |
---|---|---|
test/utils.py | 72.22% <72.22%> (ø) |
|
test/test_examples.py | 95.25% <92.08%> (-0.42%) |
:arrow_down: |
gw_spaceheat/actors/cloud_base.py | 89.36% <94.44%> (+10.31%) |
:arrow_up: |
gw_spaceheat/actors/actor_base.py | 91.91% <95.83%> (+10.72%) |
:arrow_up: |
gw_spaceheat/actors/scada_base.py | 89.70% <100.00%> (+12.32%) |
:arrow_up: |
gw_spaceheat/actors/simple_sensor.py | 95.91% <0.00%> (-2.05%) |
:arrow_down: |
gw_spaceheat/schema/property_format.py | 54.79% <0.00%> (+8.21%) |
:arrow_up: |
... and 17 more |
:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more
test_async_power_metering_dag()
remains flaky. It's unclear to me if is worse on in the PR.
The BooleanActuator
reporting is a little different than the SimpleSensor
, because it reports on change as well as synchronously. Also, when the reporting.SamplePeriodS
is equal to the reporting.ReportingPeriodS
I want to offset the timing so that the scada isn't flushing its latest readings exactly at the same time it is getting a synchronous report. This issue will go away if we have a single actor. But I'll clean up the BooleanActuator
and the pending PowerMeter
so that what they are doing is easier to test and also more clear. In a different PR. (And also dig into the test_async_power_metering_dag()
flaikiness)
The key changes are in actor_base.py, scada_base.py and cloud_base.py. The tests pass and a quick manual tests appeared to show that comm was restored after restarting mostquitto broker.
Some defensive coding was added to tests:
try/finally
blocks so that the actors can be stopped even when an assertion fails the test. We (I) should make this more automatic in the future, but this is enough for the moment.wait_for()
.