Skip to content

Commit

Permalink
Adding UNO to automated tests (commaai#538)
Browse files Browse the repository at this point in the history
* Added UNO to automated tests

* Longer wait for uno while resetting?

* Increased wrong timeout

* this fixes it locally
  • Loading branch information
robbederks authored May 26, 2020
1 parent a5802cd commit b48c74c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions tests/automated/2_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def test_orientation_detection(p):
reset_pandas()
p.reconnect()
detected_harness_orientation = p.health()['car_harness_status']
print(f"Detected orientation: {detected_harness_orientation}")
if (i == 0 and detected_harness_orientation != 0) or detected_harness_orientation in seen_orientations:
assert False
seen_orientations.append(detected_harness_orientation)
Expand Down
2 changes: 1 addition & 1 deletion tests/automated/8_gps.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_gps_version(p):
for i in range(2):
# Reset GPS
p.set_esp_power(0)
time.sleep(0.5)
time.sleep(2)
p.set_esp_power(1)
time.sleep(1)

Expand Down
10 changes: 7 additions & 3 deletions tests/automated/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
SPEED_NORMAL = 500
SPEED_GMLAN = 33.3
BUS_SPEEDS = [(0, SPEED_NORMAL), (1, SPEED_NORMAL), (2, SPEED_NORMAL), (3, SPEED_GMLAN)]
TIMEOUT = 30
TIMEOUT = 45
GEN2_HW_TYPES = [Panda.HW_TYPE_BLACK_PANDA, Panda.HW_TYPE_UNO]
GPS_HW_TYPES = [Panda.HW_TYPE_GREY_PANDA, Panda.HW_TYPE_BLACK_PANDA, Panda.HW_TYPE_UNO]

Expand Down Expand Up @@ -41,7 +41,8 @@ def init_panda_serials():
test_all_types = parameterized([
param(panda_type=Panda.HW_TYPE_WHITE_PANDA),
param(panda_type=Panda.HW_TYPE_GREY_PANDA),
param(panda_type=Panda.HW_TYPE_BLACK_PANDA)
param(panda_type=Panda.HW_TYPE_BLACK_PANDA),
param(panda_type=Panda.HW_TYPE_UNO)
])
test_all_pandas = parameterized(
list(map(lambda x: x[0], _panda_serials))
Expand All @@ -65,6 +66,9 @@ def init_panda_serials():
test_black = parameterized([
param(panda_type=Panda.HW_TYPE_BLACK_PANDA)
])
test_uno = parameterized([
param(panda_type=Panda.HW_TYPE_UNO)
])

def connect_wifi(serial=None):
p = Panda(serial=serial)
Expand Down Expand Up @@ -112,7 +116,7 @@ def time_many_sends(p, bus, p_recv=None, msg_count=100, msg_id=None, two_pandas=

def reset_pandas():
panda_jungle.set_panda_power(False)
time.sleep(2)
time.sleep(3)
panda_jungle.set_panda_power(True)
time.sleep(5)

Expand Down

0 comments on commit b48c74c

Please sign in to comment.