From 17aae1c4d81af36277bf202110ae24bf2f3da678 Mon Sep 17 00:00:00 2001 From: SoohyeokPark-MORAI <107009741+SoohyeokPark-MORAI@users.noreply.github.com> Date: Tue, 2 Aug 2022 21:46:04 +0900 Subject: [PATCH] feat(simulator_compatibility_test): test codes adjustments (#1439) * [refactoring] simulator compatibility test 1. organizing test structure 2. renaming modules Signed-off-by: SoohyeokPark-MORAI * Revert "[refactoring] simulator compatibility test" This reverts commit e79f9762d593ec66023d4a48778250be5195a108. Signed-off-by: SoohyeokPark-MORAI * test codes adjustments Signed-off-by: SoohyeokPark-MORAI --- .../test_01_control_mode_and_report.py | 2 ++ .../test_03_longitudinal_command_and_report.py | 17 +++++------------ .../test_01_control_mode_and_report.py | 2 ++ .../test_03_longitudinal_command_and_report.py | 17 +++++------------ 4 files changed, 14 insertions(+), 24 deletions(-) diff --git a/tools/simulator_test/simulator_compatibility_test/test_morai_sim/test_01_control_mode_and_report.py b/tools/simulator_test/simulator_compatibility_test/test_morai_sim/test_01_control_mode_and_report.py index 9fbb1f2aa6b50..d664f1f358c36 100644 --- a/tools/simulator_test/simulator_compatibility_test/test_morai_sim/test_01_control_mode_and_report.py +++ b/tools/simulator_test/simulator_compatibility_test/test_morai_sim/test_01_control_mode_and_report.py @@ -1,3 +1,4 @@ +import pytest from simulator_compatibility_test.publishers.control_mode_command import ( ControlModeCommand_Constants, ) @@ -6,6 +7,7 @@ class Test01ControlModeAndReportMorai(Test01ControlModeAndReportBase): + @pytest.mark.skip(reason="manual mode is not required for now") def test_1_manual_mode(self, setup_method): self.set_control_mode(ControlModeCommand_Constants.MANUAL) result = self.get_control_mode_report() diff --git a/tools/simulator_test/simulator_compatibility_test/test_morai_sim/test_03_longitudinal_command_and_report.py b/tools/simulator_test/simulator_compatibility_test/test_morai_sim/test_03_longitudinal_command_and_report.py index 651ed029413f0..c49df58e9b669 100644 --- a/tools/simulator_test/simulator_compatibility_test/test_morai_sim/test_03_longitudinal_command_and_report.py +++ b/tools/simulator_test/simulator_compatibility_test/test_morai_sim/test_03_longitudinal_command_and_report.py @@ -8,16 +8,9 @@ class Test03LongitudinalCommandAndReportMorai(Test03LongitudinalCommandAndReport def setup_class(cls) -> None: super().setup_class() - def test_1_speed_control(self, setup_and_teardown): - target_value = 100.0 - self.set_speed(target_value) - time.sleep(3) + def test_1_longitudinal_control(self, setup_and_teardown): + self.set_speed(5.0) + self.set_acceleration(1.0) + time.sleep(10) current_speed = self.get_velocity_report() - assert current_speed.longitudinal_velocity > 10.0 - - def test_2_acceleration_control(self, setup_and_teardown): - target_value = 100.0 - self.set_acceleration(target_value) - time.sleep(3) - current_speed = self.get_velocity_report() - assert current_speed.longitudinal_velocity > 10.0 + assert current_speed.longitudinal_velocity > 5.0 diff --git a/tools/simulator_test/simulator_compatibility_test/test_sim_common_manual_testing/test_01_control_mode_and_report.py b/tools/simulator_test/simulator_compatibility_test/test_sim_common_manual_testing/test_01_control_mode_and_report.py index 4dc07df8ae889..35e3314959b63 100644 --- a/tools/simulator_test/simulator_compatibility_test/test_sim_common_manual_testing/test_01_control_mode_and_report.py +++ b/tools/simulator_test/simulator_compatibility_test/test_sim_common_manual_testing/test_01_control_mode_and_report.py @@ -1,3 +1,4 @@ +import pytest from simulator_compatibility_test.publishers.control_mode_command import ( ControlModeCommand_Constants, ) @@ -6,6 +7,7 @@ class Test01ControlModeAndReportSim(Test01ControlModeAndReportBase): + @pytest.mark.skip(reason="manual mode is not required for now") def test_1_manual_mode(self, setup_method): self.set_control_mode(ControlModeCommand_Constants.MANUAL) result = self.get_control_mode_report() diff --git a/tools/simulator_test/simulator_compatibility_test/test_sim_common_manual_testing/test_03_longitudinal_command_and_report.py b/tools/simulator_test/simulator_compatibility_test/test_sim_common_manual_testing/test_03_longitudinal_command_and_report.py index ae66fcd1f8016..4379fc5d8ccb0 100644 --- a/tools/simulator_test/simulator_compatibility_test/test_sim_common_manual_testing/test_03_longitudinal_command_and_report.py +++ b/tools/simulator_test/simulator_compatibility_test/test_sim_common_manual_testing/test_03_longitudinal_command_and_report.py @@ -8,16 +8,9 @@ class Test03LongitudinalCommandAndReportSim(Test03LongitudinalCommandAndReportBa def setup_class(cls) -> None: super().setup_class() - def test_1_speed_control(self, setup_and_teardown): - target_value = 100.0 - self.set_speed(target_value) - time.sleep(3) + def test_1_longitudinal_control(self, setup_and_teardown): + self.set_speed(5.0) + self.set_acceleration(1.0) + time.sleep(10) current_speed = self.get_velocity_report() - assert current_speed.longitudinal_velocity > 10.0 - - def test_2_acceleration_control(self, setup_and_teardown): - target_value = 100.0 - self.set_acceleration(target_value) - time.sleep(3) - current_speed = self.get_velocity_report() - assert current_speed.longitudinal_velocity > 10.0 + assert current_speed.longitudinal_velocity > 5.0