-
Notifications
You must be signed in to change notification settings - Fork 940
test: add unit tests for 14 missing action connectors #2206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
0xbyt4
wants to merge
11
commits into
OpenMind:main
Choose a base branch
from
0xbyt4:feature/add-missing-action-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add comprehensive unit tests covering all previously untested action connectors: move/ros2, tweet/twitterAPI, move_serial_arduino, move_tron/tron_sdk, arm_g1/unitree_sdk, emotion/unitree_sdk, move_go2_action/unitree_sdk, move_to_peer/ros2, navigate_location (g1+go2), remember_location (g1+go2), selfie, emergency_alert, move_turtle (zenoh+zenoh_remote), and move_ub/yanshee_motion. 194 new tests total, all passing.
- Fix meaningless assertion in _send_command test (always-true removed) - Add _send_command tests: reset return value, non-reset auto-reset, ValueError handling - Add all missing connect() action tests for move_ub (walk left/right, look left/right, crouch, come on, WakaWaka, RaiseRightHand, PushUp) - Add zenoh_remote init tests: WebSocket URL with api_key, cmd_vel topic without URID, callback registration verification - Verify session.put receives correct cmd_vel topic
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
- arm_g1/test_unitree_sdk.py -> test_arm_g1_unitree_sdk.py - emotion/test_unitree_sdk.py -> test_emotion_unitree_sdk.py - move_go2_action/test_unitree_sdk.py -> test_go2_action_unitree_sdk.py
…ests Module-level sys.modules mocking was leaking into other test modules during pytest collection, causing CI failures (dds_ NameError). Each test file now stores its mocked entries in a _mocked_modules dict and cleans them up in teardown_module() with an identity check to avoid removing mocks owned by other test files. Also removed unnecessary zenoh_msgs mocking from 4 files since it is a real package available in the test environment.
Module-scoped patch.dict("sys.modules") fixtures were cleaning up
after each test module, leaving cached connector imports with stale
mock references. In CI where real packages (zenoh, etc.) are installed,
this caused background threads to open real connections, preventing
the test process from terminating. Changed to session scope to match
the pattern used by existing tests (test_avatar.py, test_fabric.py).
…iles Module-level imports of connectors that cascade to `import zenoh` (a Rust package with non-daemon tokio threads) caused the pytest process to hang indefinitely after all tests passed. Convert to lazy imports inside fixtures/tests so session-scoped sys.modules mocks are active first. Files fixed: test_unitree_nav.py, test_unitree_location.py, test_selfie.py
Contributor
|
Hi @0xbyt4 Could you please move import to the top? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add comprehensive unit tests for all 14 previously untested action connectors with 207 new tests, all passing.