Skip to content

Commit

Permalink
selfdrive/debug: fix broken check_can_parser_performance.py (#33908)
Browse files Browse the repository at this point in the history
* fix check_can_parser_performance.py

* no difference

* this too

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
  • Loading branch information
deanlee and sshane authored Nov 1, 2024
1 parent 4c0e292 commit 6fc14b5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion selfdrive/car/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def get_testing_data_from_logreader(cls, lr):
car_fw = msg.carParams.carFw
if msg.carParams.openpilotLongitudinalControl:
experimental_long = True
if cls.platform is None and not cls.test_route_on_bucket:
if cls.platform is None:
live_fingerprint = msg.carParams.carFingerprint
cls.platform = MIGRATION.get(live_fingerprint, live_fingerprint)

Expand Down
1 change: 0 additions & 1 deletion selfdrive/debug/check_can_parser_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

class CarModelTestCase(TestCarModelBase):
test_route = CarTestRoute(DEMO_ROUTE, None)
ci = False


if __name__ == '__main__':
Expand Down
7 changes: 3 additions & 4 deletions tools/car_porting/test_car_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
from openpilot.tools.lib.route import SegmentRange


def create_test_models_suite(routes: list[CarTestRoute], ci=False) -> unittest.TestSuite:
def create_test_models_suite(routes: list[CarTestRoute]) -> unittest.TestSuite:
test_suite = unittest.TestSuite()
for test_route in routes:
# create new test case and discover tests
test_case_args = {"platform": test_route.car_model, "test_route": test_route, "test_route_on_bucket": ci}
test_case_args = {"platform": test_route.car_model, "test_route": test_route}
CarModelTestCase = type("CarModelTestCase", (TestCarModel,), test_case_args)
test_suite.addTest(unittest.TestLoader().loadTestsFromTestCase(CarModelTestCase))
return test_suite
Expand All @@ -23,7 +23,6 @@ def create_test_models_suite(routes: list[CarTestRoute], ci=False) -> unittest.T
"Uses selfdrive/car/tests/test_models.py")
parser.add_argument("route_or_segment_name", help="Specify route to run tests on")
parser.add_argument("--car", help="Specify car model for test route")
parser.add_argument("--ci", action="store_true", help="Attempt to get logs using openpilotci, need to specify car")
args = parser.parse_args()
if len(sys.argv) == 1:
parser.print_help()
Expand All @@ -32,6 +31,6 @@ def create_test_models_suite(routes: list[CarTestRoute], ci=False) -> unittest.T
sr = SegmentRange(args.route_or_segment_name)

test_routes = [CarTestRoute(sr.route_name, args.car, segment=seg_idx) for seg_idx in sr.seg_idxs]
test_suite = create_test_models_suite(test_routes, ci=args.ci)
test_suite = create_test_models_suite(test_routes)

unittest.TextTestRunner().run(test_suite)

0 comments on commit 6fc14b5

Please sign in to comment.