Skip to content

Add unit tests for nav2, person follow, and slam hooks#2032

Merged
openminddev merged 1 commit intomainfrom
add-hook-tests
Feb 1, 2026
Merged

Add unit tests for nav2, person follow, and slam hooks#2032
openminddev merged 1 commit intomainfrom
add-hook-tests

Conversation

@openminddev
Copy link
Copy Markdown
Contributor

This pull request adds comprehensive unit tests for the nav2_hook and person_follow_hook modules. The new tests cover a wide range of scenarios for both starting and stopping navigation and person-following features, including success cases, error handling, custom parameters, and correct use of timeouts and dependencies.

Unit tests for nav2_hook:

  • Added tests for start_nav2_hook covering successful starts (with default and custom parameters), HTTP error responses (with and without JSON), client connection errors, and timeout configuration. Also verifies integration with the ElevenLabsTTSProvider for status messaging.
  • Added tests for stop_nav2_hook covering successful stops (with default and custom parameters), HTTP error responses, client connection errors, and timeout usage.

Unit tests for person_follow_hook:

  • Added tests for start_person_follow_hook including first-attempt and retry successes, handling of not-tracked status, custom base URLs, client and connection errors, default constant usage, and timeout configuration. Also verifies correct messaging via ElevenLabsTTSProvider.
  • Added tests for stop_person_follow_hook covering successful stops (default and custom URLs), HTTP and client errors, and timeout configuration.

Introduces comprehensive pytest-based unit tests for nav2_hook, person_follow_hook, and slam_hook modules. Tests cover success and error scenarios, parameter variations, timeout configurations, and integration with ElevenLabsTTSProvider where applicable.
Copilot AI review requested due to automatic review settings February 1, 2026 03:44
@openminddev openminddev requested a review from a team as a code owner February 1, 2026 03:44
@github-actions github-actions Bot added python Python code tests Test files labels Feb 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds comprehensive unit test coverage for three hook modules: nav2_hook, person_follow_hook, and slam_hook. The tests validate both successful operations and error handling scenarios for starting and stopping navigation, person-following, and SLAM functionalities.

Changes:

  • Added 234 lines of tests for nav2_hook covering start/stop operations with various success and error scenarios
  • Added 374 lines of tests for person_follow_hook covering enrollment, tracking status, retries, and error conditions
  • Added 309 lines of tests for slam_hook covering start/stop operations including map saving functionality

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/hooks/test_nav2_hook.py Tests for nav2 start/stop operations including HTTP errors, client errors, custom parameters, and timeout configurations
tests/hooks/test_person_follow_hook.py Tests for person follow enrollment/tracking with retry logic, status polling, connection errors, and timeout handling
tests/hooks/test_slam_hook.py Tests for SLAM start/stop operations including map saving, HTTP/client errors, and timeout configurations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/hooks/test_nav2_hook.py
Comment thread tests/hooks/test_nav2_hook.py
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@openminddev openminddev merged commit 670b6b1 into main Feb 1, 2026
7 checks passed
@openminddev openminddev deleted the add-hook-tests branch February 1, 2026 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Python code tests Test files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants