Skip to content

Commit 0ce31e7

Browse files
committed
Fixed Tests?
1 parent 94c96f5 commit 0ce31e7

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

FprimeZephyrReference/Components/PowerMonitor/PowerMonitor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void PowerMonitor ::run_handler(FwIndexType portNum, U32 context) {
4444
void PowerMonitor ::RESET_TOTAL_POWER_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) {
4545
this->m_totalPower_mWh = 0.0f;
4646
this->m_lastUpdateTime_s = this->getCurrentTimeSeconds();
47-
this->log_ACTIVITY_LOW_TotalPowerReset();
47+
this->log_ACTIVITY_LO_TotalPowerReset();
4848
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
4949
}
5050

FprimeZephyrReference/test/int/power_monitor_test.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
Integration tests for the Power Monitor component.
55
"""
66

7-
from datetime import datetime
87
import time
8+
from datetime import datetime
99

1010
import pytest
1111
from common import proves_send_and_assert_command
@@ -50,6 +50,7 @@ def test_01_power_manager_telemetry(fprime_test_api: IntegrationTestAPI, start_g
5050
f"{ina219SolManager}.Power", start=start, timeout=65
5151
)
5252

53+
# TODO: Fix the power readings once INA219 power calculation is verified
5354
sys_voltage_reading: dict[float] = sys_voltage.get_val()
5455
sys_current_reading: dict[float] = sys_current.get_val()
5556
# sys_power_reading: dict[float] = sys_power.get_val()
@@ -75,8 +76,8 @@ def test_02_total_power_consumption_telemetry(
7576

7677
total_power_reading: float = total_power.get_val()
7778

78-
# Total power should be non-negative (accumulating over time)
79-
assert total_power_reading >= 0, "Total power consumption should be non-negative"
79+
# Total power should be non-zero (accumulating over time)
80+
assert total_power_reading != 0, "Total power consumption should be non-zero"
8081

8182

8283
def test_03_reset_total_power_command(fprime_test_api: IntegrationTestAPI, start_gds):
@@ -92,17 +93,15 @@ def test_03_reset_total_power_command(fprime_test_api: IntegrationTestAPI, start
9293
)
9394

9495
# Verify event was logged
95-
fprime_test_api.assert_event(
96-
f"{powerMonitor}.TotalPowerReset", start="NOW", timeout=3
97-
)
96+
fprime_test_api.assert_event(f"{powerMonitor}.TotalPowerReset", timeout=3)
9897

9998
# Wait for next telemetry update
10099
time.sleep(2)
101100

102101
# Get total power after reset - should be very small (close to 0)
103102
# Allow small value due to time between reset and next telemetry update
104103
total_power_after: ChData = fprime_test_api.assert_telemetry(
105-
f"{powerMonitor}.TotalPowerConsumption", start="NOW", timeout=3
104+
f"{powerMonitor}.TotalPowerConsumption", timeout=3
106105
)
107106

108107
total_power_after_reading: float = total_power_after.get_val()

0 commit comments

Comments
 (0)