From 204ddd23caba90e1b8182269344d763b37db18af Mon Sep 17 00:00:00 2001 From: Xierumeng Date: Mon, 19 Feb 2024 03:08:32 -0500 Subject: [PATCH] Flake covers integration tests --- documentation/tests/{ => unit}/add_or_multiply.py | 0 documentation/tests/{ => unit}/test_add_or_multiply.py | 0 documentation/tests/{ => unit}/test_pytest_example.py | 0 setup.cfg | 2 +- tests/integration/__init__.py | 0 tests/{ => integration}/test_data_merge_worker.py | 4 ++-- tests/{ => integration}/test_detect_target_worker.py | 2 +- tests/{ => integration}/test_flight_interface_hardware.py | 0 tests/{ => integration}/test_flight_interface_worker.py | 0 tests/{ => integration}/test_geolocation_worker.py | 2 +- tests/{ => integration}/test_video_input_hardware.py | 1 + tests/{ => integration}/test_video_input_worker.py | 0 tests/unit/__init__.py | 0 tests/{ => unit}/test_camera_properties.py | 0 tests/{ => unit}/test_cluster_detection.py | 0 tests/{ => unit}/test_decision.py | 0 tests/{ => unit}/test_detect_target.py | 0 tests/{ => unit}/test_geolocation.py | 0 tests/{ => unit}/test_landing_pad_tracking.py | 0 19 files changed, 6 insertions(+), 5 deletions(-) rename documentation/tests/{ => unit}/add_or_multiply.py (100%) rename documentation/tests/{ => unit}/test_add_or_multiply.py (100%) rename documentation/tests/{ => unit}/test_pytest_example.py (100%) create mode 100644 tests/integration/__init__.py rename tests/{ => integration}/test_data_merge_worker.py (99%) rename tests/{ => integration}/test_detect_target_worker.py (99%) rename tests/{ => integration}/test_flight_interface_hardware.py (100%) rename tests/{ => integration}/test_flight_interface_worker.py (100%) rename tests/{ => integration}/test_geolocation_worker.py (99%) rename tests/{ => integration}/test_video_input_hardware.py (92%) rename tests/{ => integration}/test_video_input_worker.py (100%) create mode 100644 tests/unit/__init__.py rename tests/{ => unit}/test_camera_properties.py (100%) rename tests/{ => unit}/test_cluster_detection.py (100%) rename tests/{ => unit}/test_decision.py (100%) rename tests/{ => unit}/test_detect_target.py (100%) rename tests/{ => unit}/test_geolocation.py (100%) rename tests/{ => unit}/test_landing_pad_tracking.py (100%) diff --git a/documentation/tests/add_or_multiply.py b/documentation/tests/unit/add_or_multiply.py similarity index 100% rename from documentation/tests/add_or_multiply.py rename to documentation/tests/unit/add_or_multiply.py diff --git a/documentation/tests/test_add_or_multiply.py b/documentation/tests/unit/test_add_or_multiply.py similarity index 100% rename from documentation/tests/test_add_or_multiply.py rename to documentation/tests/unit/test_add_or_multiply.py diff --git a/documentation/tests/test_pytest_example.py b/documentation/tests/unit/test_pytest_example.py similarity index 100% rename from documentation/tests/test_pytest_example.py rename to documentation/tests/unit/test_pytest_example.py diff --git a/setup.cfg b/setup.cfg index 8ccfb634..079e3f6d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,4 +20,4 @@ extend-exclude= # Submodules modules/common/, # Tests - *tests/ + */unit/ diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/test_data_merge_worker.py b/tests/integration/test_data_merge_worker.py similarity index 99% rename from tests/test_data_merge_worker.py rename to tests/integration/test_data_merge_worker.py index 4913bfa6..48898826 100644 --- a/tests/test_data_merge_worker.py +++ b/tests/integration/test_data_merge_worker.py @@ -21,7 +21,7 @@ def simulate_detect_target_worker( timestamp: float, detections_queue: queue_proxy_wrapper.QueueProxyWrapper -): +) -> None: """ Place the detection into the queue. """ @@ -40,7 +40,7 @@ def simulate_detect_target_worker( def simulate_flight_input_worker( timestamp: float, odometry_queue: queue_proxy_wrapper.QueueProxyWrapper -): +) -> None: """ Place the odometry into the queue. """ diff --git a/tests/test_detect_target_worker.py b/tests/integration/test_detect_target_worker.py similarity index 99% rename from tests/test_detect_target_worker.py rename to tests/integration/test_detect_target_worker.py index 9223cc9f..50bd8961 100644 --- a/tests/test_detect_target_worker.py +++ b/tests/integration/test_detect_target_worker.py @@ -32,7 +32,7 @@ def simulate_previous_worker( image_path: pathlib.Path, in_queue: queue_proxy_wrapper.QueueProxyWrapper -): +) -> None: """ Place the image into the queue. """ diff --git a/tests/test_flight_interface_hardware.py b/tests/integration/test_flight_interface_hardware.py similarity index 100% rename from tests/test_flight_interface_hardware.py rename to tests/integration/test_flight_interface_hardware.py diff --git a/tests/test_flight_interface_worker.py b/tests/integration/test_flight_interface_worker.py similarity index 100% rename from tests/test_flight_interface_worker.py rename to tests/integration/test_flight_interface_worker.py diff --git a/tests/test_geolocation_worker.py b/tests/integration/test_geolocation_worker.py similarity index 99% rename from tests/test_geolocation_worker.py rename to tests/integration/test_geolocation_worker.py index 7ca0bcc5..2a73cee4 100644 --- a/tests/test_geolocation_worker.py +++ b/tests/integration/test_geolocation_worker.py @@ -19,7 +19,7 @@ WORK_COUNT = 3 -def simulate_previous_worker(in_queue: queue_proxy_wrapper.QueueProxyWrapper): +def simulate_previous_worker(in_queue: queue_proxy_wrapper.QueueProxyWrapper) -> None: """ Place the image into the queue. """ diff --git a/tests/test_video_input_hardware.py b/tests/integration/test_video_input_hardware.py similarity index 92% rename from tests/test_video_input_hardware.py rename to tests/integration/test_video_input_hardware.py index db53caf0..2557e53d 100644 --- a/tests/test_video_input_hardware.py +++ b/tests/integration/test_video_input_hardware.py @@ -13,6 +13,7 @@ def main() -> int: Main function. """ # Setup + # TODO: Common change logging option camera = video_input.VideoInput( CAMERA, ) diff --git a/tests/test_video_input_worker.py b/tests/integration/test_video_input_worker.py similarity index 100% rename from tests/test_video_input_worker.py rename to tests/integration/test_video_input_worker.py diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/test_camera_properties.py b/tests/unit/test_camera_properties.py similarity index 100% rename from tests/test_camera_properties.py rename to tests/unit/test_camera_properties.py diff --git a/tests/test_cluster_detection.py b/tests/unit/test_cluster_detection.py similarity index 100% rename from tests/test_cluster_detection.py rename to tests/unit/test_cluster_detection.py diff --git a/tests/test_decision.py b/tests/unit/test_decision.py similarity index 100% rename from tests/test_decision.py rename to tests/unit/test_decision.py diff --git a/tests/test_detect_target.py b/tests/unit/test_detect_target.py similarity index 100% rename from tests/test_detect_target.py rename to tests/unit/test_detect_target.py diff --git a/tests/test_geolocation.py b/tests/unit/test_geolocation.py similarity index 100% rename from tests/test_geolocation.py rename to tests/unit/test_geolocation.py diff --git a/tests/test_landing_pad_tracking.py b/tests/unit/test_landing_pad_tracking.py similarity index 100% rename from tests/test_landing_pad_tracking.py rename to tests/unit/test_landing_pad_tracking.py