From dcda50140a701d042da12a0783d770c901f2672b Mon Sep 17 00:00:00 2001 From: Axel Date: Mon, 28 Nov 2022 15:59:29 +0100 Subject: [PATCH] Exclude new vehicle testing in the old towns --- PythonAPI/test/smoke/__init__.py | 10 +++++++++- PythonAPI/test/smoke/test_collision_sensor.py | 1 + PythonAPI/test/smoke/test_spawnpoints.py | 1 + PythonAPI/test/smoke/test_vehicle_physics.py | 3 +++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/PythonAPI/test/smoke/__init__.py b/PythonAPI/test/smoke/__init__.py index 1568540f4..4e22db248 100644 --- a/PythonAPI/test/smoke/__init__.py +++ b/PythonAPI/test/smoke/__init__.py @@ -21,12 +21,13 @@ import carla import time TESTING_ADDRESS = ('localhost', 3654) - +VEHICLE_VEHICLES_EXCLUDE_FROM_OLD_TOWNS = ['vehicle.mitsubishi.fusorosa'] class SmokeTest(unittest.TestCase): def setUp(self): self.testing_address = TESTING_ADDRESS self.client = carla.Client(*TESTING_ADDRESS) + self.vehicle_vehicles_exclude_from_old_towns = VEHICLE_VEHICLES_EXCLUDE_FROM_OLD_TOWNS self.client.set_timeout(120.0) self.world = self.client.get_world() @@ -36,6 +37,13 @@ class SmokeTest(unittest.TestCase): time.sleep(5) self.world = None self.client = None + + def filter_vehicles_for_old_towns(self, blueprint_list): + new_list = [] + for blueprint in blueprint_list: + if blueprint.id not in self.vehicle_vehicles_exclude_from_old_towns: + new_list.append(blueprint) + return new_list class SyncSmokeTest(SmokeTest): diff --git a/PythonAPI/test/smoke/test_collision_sensor.py b/PythonAPI/test/smoke/test_collision_sensor.py index 579a6dda3..2351626fb 100644 --- a/PythonAPI/test/smoke/test_collision_sensor.py +++ b/PythonAPI/test/smoke/test_collision_sensor.py @@ -40,6 +40,7 @@ class TestCollisionSensor(SyncSmokeTest): print("TestCollisionSensor.test_single_car") bp_vehicles = self.world.get_blueprint_library().filter("vehicle.*") + bp_vehicles = self.filter_vehicles_for_old_towns(bp_vehicles) cars_failing = "" for bp_veh in bp_vehicles: # Run collision agains wall diff --git a/PythonAPI/test/smoke/test_spawnpoints.py b/PythonAPI/test/smoke/test_spawnpoints.py index 7b0e3acc1..75de40773 100644 --- a/PythonAPI/test/smoke/test_spawnpoints.py +++ b/PythonAPI/test/smoke/test_spawnpoints.py @@ -15,6 +15,7 @@ class TestSpawnpoints(SyncSmokeTest): print("TestSpawnpoints.test_spawn_points") self.world = self.client.get_world() blueprints = self.world.get_blueprint_library().filter("vehicle.*") + blueprints = self.filter_vehicles_for_old_towns(blueprints) # get all available maps maps = self.client.get_available_maps() diff --git a/PythonAPI/test/smoke/test_vehicle_physics.py b/PythonAPI/test/smoke/test_vehicle_physics.py index 4f9699c2e..564319c23 100644 --- a/PythonAPI/test/smoke/test_vehicle_physics.py +++ b/PythonAPI/test/smoke/test_vehicle_physics.py @@ -185,6 +185,7 @@ class TestApplyVehiclePhysics(SyncSmokeTest): print("TestApplyVehiclePhysics.test_single_physics_control") bp_vehicles = self.world.get_blueprint_library().filter("vehicle.*") + bp_vehicles = self.filter_vehicles_for_old_towns(bp_vehicles) for bp_veh in bp_vehicles: self.check_single_physics_control(bp_veh) @@ -192,10 +193,12 @@ class TestApplyVehiclePhysics(SyncSmokeTest): print("TestApplyVehiclePhysics.test_multiple_physics_control") bp_vehicles = self.world.get_blueprint_library().filter("vehicle.*") + bp_vehicles = self.filter_vehicles_for_old_towns(bp_vehicles) for idx in range(0, len(bp_vehicles)): self.check_multiple_physics_control(bp_vehicles, idx) bp_vehicles = self.world.get_blueprint_library().filter("vehicle.*") + bp_vehicles = self.filter_vehicles_for_old_towns(bp_vehicles) self.check_multiple_physics_control(bp_vehicles) class TestVehicleFriction(SyncSmokeTest):