Skip to content

Commit 37e2932

Browse files
hrfarmerasiemsen
andcommitted
wip changes
Co-authored-by: Aaron Siemsen <[email protected]>
1 parent 3a788b2 commit 37e2932

File tree

3 files changed

+53
-7
lines changed

3 files changed

+53
-7
lines changed

FprimeZephyrReference/test/int/imu_manager_test.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77
import os
88
import subprocess
99
import time
10-
from typing import List
1110

1211
import pytest
1312
from fprime_gds.common.data_types.ch_data import ChData
14-
from fprime_gds.common.data_types.event_data import EventData
1513
from fprime_gds.common.testing_fw.api import IntegrationTestAPI
1614

1715

@@ -20,14 +18,16 @@ def start_gds(fprime_test_api_session: IntegrationTestAPI):
2018
process = subprocess.Popen(["make", "gds-integration"], cwd=os.getcwd())
2119

2220
gds_working = False
23-
timeout_time = time.time() + 15
21+
timeout_time = time.time() + 30
2422
while time.time() < timeout_time:
25-
data: List[EventData] = fprime_test_api_session.send_and_assert_command(
26-
command="CdhCore.cmdDisp.CMD_NO_OP"
27-
)
28-
if data != []:
23+
try:
24+
fprime_test_api_session.send_and_assert_command(
25+
command="CdhCore.cmdDisp.CMD_NO_OP"
26+
)
2927
gds_working = True
3028
break
29+
except Exception:
30+
time.sleep(1)
3131
assert gds_working
3232

3333
yield

FprimeZephyrReference/test/int/rtc_test.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
"""
66

77
import json
8+
import os
9+
import subprocess
810
import time
911
from datetime import datetime, timezone
1012

@@ -16,6 +18,27 @@
1618
from fprime_gds.common.testing_fw.api import IntegrationTestAPI
1719

1820

21+
@pytest.fixture(scope="session", autouse=True)
22+
def start_gds(fprime_test_api_session: IntegrationTestAPI):
23+
process = subprocess.Popen(["make", "gds-integration"], cwd=os.getcwd())
24+
25+
gds_working = False
26+
timeout_time = time.time() + 30
27+
while time.time() < timeout_time:
28+
try:
29+
fprime_test_api_session.send_and_assert_command(
30+
command="CdhCore.cmdDisp.CMD_NO_OP"
31+
)
32+
gds_working = True
33+
break
34+
except Exception:
35+
time.sleep(1)
36+
assert gds_working
37+
38+
yield
39+
process.kill()
40+
41+
1942
@pytest.fixture(autouse=True)
2043
def set_now_time(fprime_test_api: IntegrationTestAPI):
2144
"""Fixture to set the time to test runner's time after each test"""

FprimeZephyrReference/test/int/watchdog_test.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,36 @@
44
Integration tests for the Watchdog component.
55
"""
66

7+
import os
8+
import subprocess
79
import time
810

911
import pytest
1012
from fprime_gds.common.data_types.ch_data import ChData
1113
from fprime_gds.common.testing_fw.api import IntegrationTestAPI
1214

1315

16+
@pytest.fixture(scope="session", autouse=True)
17+
def start_gds(fprime_test_api_session: IntegrationTestAPI):
18+
process = subprocess.Popen(["make", "gds-integration"], cwd=os.getcwd())
19+
20+
gds_working = False
21+
timeout_time = time.time() + 30
22+
while time.time() < timeout_time:
23+
try:
24+
fprime_test_api_session.send_and_assert_command(
25+
command="CdhCore.cmdDisp.CMD_NO_OP"
26+
)
27+
gds_working = True
28+
break
29+
except Exception:
30+
time.sleep(1)
31+
assert gds_working
32+
33+
yield
34+
process.kill()
35+
36+
1437
@pytest.fixture(autouse=True)
1538
def ensure_watchdog_running(fprime_test_api: IntegrationTestAPI):
1639
"""Fixture to ensure watchdog is started before and after each test"""

0 commit comments

Comments
 (0)