-
Notifications
You must be signed in to change notification settings - Fork 11
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
Ros2 lights integration tests #408
Conversation
WalkthroughThe pull request introduces changes across multiple files, focusing on updating copyright notices, restructuring test file paths, and enhancing the testing framework for the Changes
Possibly related PRs
Tip OpenAI O1 model for chat
Recent review detailsConfiguration used: .coderabbit.yaml Files selected for processing (1)
Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
self.set_led_animation_client.wait_for_service(timeout_sec=1.0) | ||
self.set_led_animation_client.call_async(request) | ||
|
||
def test_msg_publishers(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a simple way to check msg subscribers? Like check if lights_driver_node is subscribed to frame topics?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added new functionality 👍🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- panther_lights/test/integration/panther_lights.test.py (1 hunks)
- panther_utils/panther_utils/integration_test_utils.py (1 hunks)
Files skipped from review due to trivial changes (1)
- panther_lights/test/integration/panther_lights.test.py
Additional comments not posted (2)
panther_utils/panther_utils/integration_test_utils.py (2)
21-33
: LGTM!The
ROSNodeInfo
class is a simple and effective data class to represent the ROS node info. The attributes cover all the necessary information about a node's communication interfaces.
35-79
: Well-structured function implementation.The
get_node_info
function follows a clear logic to execute theros2 node info
command and parse its output to populate aROSNodeInfo
object. The use ofsection_map
is a good approach to map the output sections to the correspondingROSNodeInfo
attributes.
except subprocess.CalledProcessError as e: | ||
print(f"Error executing command: {e}") | ||
print(f"stderr: {e.stderr}") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider raising an exception instead of just printing the error details.
In the except
block, instead of just printing the error details, consider raising an exception to allow the caller to handle the error appropriately. This will make the function more robust and easier to use in different contexts.
Apply this diff to raise an exception:
- except subprocess.CalledProcessError as e:
- print(f"Error executing command: {e}")
- print(f"stderr: {e.stderr}")
+ except subprocess.CalledProcessError as e:
+ raise RuntimeError(f"Error executing command: {e}. stderr: {e.stderr}") from e
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
except subprocess.CalledProcessError as e: | |
print(f"Error executing command: {e}") | |
print(f"stderr: {e.stderr}") | |
except subprocess.CalledProcessError as e: | |
raise RuntimeError(f"Error executing command: {e}. stderr: {e.stderr}") from e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed error handling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
unit
andintegration
panther_lights
packageRequirements
Tests 🧪
Summary by CodeRabbit
New Features
panther_lights
package, ensuring robust testing of LED control functionalities.Bug Fixes
Documentation
Refactor
Chores