Skip to content

Add unit tests for all provider plugins#1773

Merged
openminddev merged 40 commits intomainfrom
add-unit-tests
Jan 20, 2026
Merged

Add unit tests for all provider plugins#1773
openminddev merged 40 commits intomainfrom
add-unit-tests

Conversation

@openminddev
Copy link
Copy Markdown
Contributor

@openminddev openminddev commented Jan 20, 2026

This pull request introduces new stop methods to several provider classes for improved resource management and adds comprehensive unit tests for multiple providers. The most important changes are grouped below by theme.

Resource cleanup and provider lifecycle improvements:

  • Added a stop method to TeleopsStatusProvider to properly shut down its executor and clean up resources.
  • Added stop methods to both UnitreeG1NavigationProvider and UnitreeGo2NavigationProvider to close sessions, undeclare publishers, and update running state for safe shutdown. [1] [2]

Testing improvements and coverage:

  • Added extensive unit tests for RPLidarProvider in test_rplidar_provider.py, including singleton reset logic and mocking of dependencies.
  • Added comprehensive tests for TeleopsStatusProvider and related data classes in test_teleops_status_provider.py, covering creation, serialization, deserialization, and singleton behavior.
  • Added thorough tests for TurtleBot4CameraVLMProvider and TurtleBot4CameraVideoStream in test_turtlebot4_camera_vlm_provider.py, including Zenoh session mocking, initialization, lifecycle, and singleton enforcement.

openminddev and others added 20 commits January 19, 2026 22:35
Added unit tests for ASRRTSPProvider, AvatarProvider, and ConfigProvider. Improved resource cleanup in AvatarProvider and ConfigProvider by undeclaring subscribers and publishers on stop. These changes enhance test coverage and ensure proper resource management.
Introduce unit tests for the ContextProvider class, covering initialization, singleton behavior, context updates, field setting, stopping, and error handling. Mocks are used for Zenoh session and publisher dependencies.
Updated the import statement in test_d435_provider.py to use the correct relative path for D435Provider. This resolves import errors when running tests.
Introduces unit tests for the FabricDataSubmitter, RFData, RFDataRaw, and FabricData classes. Tests cover singleton behavior, data serialization, API interaction (with and without API key), RF data handling, and local file writing.
Added logic to undeclare and clean up the avatar_healthcheck_publisher in the AvatarProvider shutdown process to prevent resource leaks.
Introduces unit tests for the GalleryIdentitiesProvider singleton behavior, lifecycle methods, callback registration, and identity fetching logic, as well as for the IdentitiesSnapshot's to_text method. These tests improve coverage and help ensure correct functionality.
Introduces tests for initialization, singleton behavior, exception handling, timestamp conversion, stopping, and data properties of the GpsProvider class. Uses pytest fixtures and mocking to isolate dependencies.
Introduce unit tests for the OdomProvider class and RobotState enum, covering initialization, singleton behavior, process/thread management, and position property. Mocks are used for multiprocessing and threading dependencies to isolate test logic.
Corrects the publisher close method from self._publisher.Close() to self.publisher_.Close() in ROS2PublisherProvider. Adds comprehensive unit tests for initialization, message handling, start/stop behavior, and message publishing.
Introduces tests for RPDriver initialization, device info retrieval, scan start, and stop functionality using unittest.mock to simulate serial communication.
Introduce unit tests for the RPLidarProvider and RPLidarConfig classes, covering configuration, singleton behavior, initialization, start/stop methods, and multiprocessing/threading interactions using mocks.
Changed the import of RtkProvider to use the correct module path. Also removed outdated comments about checksum validation in the test for invalid checksums.
Introduce unit tests for the TeleopsConversationProvider, including tests for enum values, message serialization, singleton behavior, API key handling, and message storing methods.
Refactored tests for storing user and robot messages to patch the executor's submit method, allowing for direct assertions on message content and type. Removed unnecessary sleep and assert statements for more precise and efficient testing.
Enhanced the test to assert that messages are correctly submitted with the expected content and message type when no API key is provided. This improves test coverage and ensures correct behavior of the message storing logic.
Adds a chained mock return value for readline().decode().strip() in the mock_serial fixture to ensure consistent behavior during testing.
Added more robust cleanup in test fixtures for GalleryIdentitiesProvider and GpsProvider by ensuring providers are stopped after tests. Enhanced GPS provider mock to set is_open and simplify readline return value.
Deleted the test_rplidar_provider.py test file and removed a redundant file header comment from gallery_identities_provider.py. This streamlines the codebase by eliminating unused tests and unnecessary comments.
Introduce comprehensive tests for RPLidarProvider and RPLidarConfig, covering initialization, singleton behavior, configuration defaults and overrides, path setup, Zenoh integration, angle blanking, and log file creation. External dependencies are mocked to isolate provider logic.
Copilot AI review requested due to automatic review settings January 20, 2026 19:12
@openminddev openminddev requested review from a team as code owners January 20, 2026 19:12
@github-actions github-actions Bot added python Python code tests Test files labels Jan 20, 2026
Introduced a stop() method in TeleopsStatusProvider to allow for resource cleanup by shutting down the executor. Added comprehensive unit tests for TeleopsStatusProvider and related data classes to ensure correct behavior and coverage.
@github-actions github-actions Bot added the robotics Robotics code changes label Jan 20, 2026
Introduce unit tests for TurtleBot4CameraVideoStream and TurtleBot4CameraVLMProvider, covering initialization, singleton behavior, camera listener, and start/stop methods. Mocks are used for Zenoh and websocket dependencies to isolate test logic.
Introduce unit tests for the UbtechASRProvider, covering initialization, singleton behavior, callback registration, start/stop/pause/resume methods, language setting, and session header configuration. These tests help ensure correct provider behavior and improve code reliability.
Added a new test suite for UbtechCameraVideoStream covering initialization, callbacks, FPS, resolution, JPEG quality, URL formatting, and video stream start. Minor formatting and cleanup changes were made to test_ubtech_asr_provider.py for consistency.
Introduce comprehensive unit tests for the UbtechVLMProvider class, covering initialization, singleton behavior, message callback registration, start/stop logic, and video stream parameter handling. Mocks are used for external dependencies to isolate provider logic.
Introduce comprehensive unit tests for the UnitreeG1LocationsProvider class, covering initialization, singleton behavior, threading, HTTP fetch logic, error handling, and thread safety. These tests use pytest and unittest.mock to validate provider functionality and robustness.
Introduces a stop() method to UnitreeG1NavigationProvider for resource cleanup and proper shutdown. Adds comprehensive unit tests covering initialization, singleton behavior, dependency handling, and the new stop functionality.
Introduce unit tests for the UnitreeGo2AMCLProvider class, covering initialization, default values, singleton behavior, property access, and the start method. Zenoh dependencies are mocked to isolate provider logic.
Introduce unit tests covering initialization, singleton behavior, property accessors, and dependency mocking for UnitreeGo2FrontierExplorationProvider. These tests ensure correct instantiation, singleton enforcement, and integration with mocked dependencies.
Introduce unit tests covering initialization, singleton behavior, properties, and start method for UnitreeGo2LidarLocalizationProvider. Zenoh dependencies are mocked to isolate provider logic.
Introduce unit tests for the UnitreeGo2LocationsProvider class, covering initialization, default values, singleton behavior, and start/stop methods. Mocks are used for dependencies to isolate the provider logic.
Introduces a stop() method to UnitreeGo2NavigationProvider for resource cleanup and proper shutdown. Adds a new test suite covering initialization, default values, singleton behavior, and the start method.
Introduce comprehensive unit tests for the UnitreeGo2StateProvider class, covering initialization, singleton behavior, start/stop logic, state values, and dependency mocking. These tests help ensure correct provider behavior and improve code reliability.
Introduce comprehensive unit tests for UnitreeRealSenseDevVLMProvider and UnitreeRealSenseDevVideoStream, covering initialization, singleton behavior, callback registration, start/stop logic, and parameter passing. These tests use pytest and unittest.mock to ensure correct functionality and integration.
Introduces unit tests for the VLMOpenAIRTSPProvider class, covering initialization, singleton behavior, frame queuing, message callback registration, and dependency injection. These tests improve reliability and ensure correct behavior of provider configuration and interactions.
Introduces unit tests for the VLMVilaRTSPProvider class, covering initialization, singleton behavior, callback registration, start/stop functionality, and custom configuration options. Mocks dependencies to isolate provider logic and ensure correct interactions.
Introduce unit tests for the VLMVilaZenohProvider class, covering initialization, singleton behavior, callback registration, start/stop logic, and configuration options. Mocks are used for dependencies to isolate provider logic.
Introduces unit tests for ZenohListenerProvider covering initialization, callback registration, start/stop behavior, and error handling to ensure correct functionality and robustness.
Introduces unit tests for ZenohPublisherProvider covering initialization, message queuing, publishing, thread management, and message formatting. These tests improve reliability and ensure correct behavior under various scenarios.
@openminddev openminddev changed the title Add unit tests Add unit tests for all provider plugins Jan 20, 2026
@openminddev openminddev merged commit 1567165 into main Jan 20, 2026
6 checks passed
@openminddev openminddev deleted the add-unit-tests branch January 20, 2026 19:55
@openminddev openminddev review requested due to automatic review settings March 23, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Python code robotics Robotics code changes tests Test files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant