Add pytest in automatic parking package#73
Conversation
Signed-off-by: Hyungyu Kim <kimhg@robotis.com>
…ications into feature-buildfarm-error-fix
There was a problem hiding this comment.
Summary of Changes
Hello @GyuH13, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces pytest as the designated testing framework for the turtlebot3_automatic_parking package. By declaring pytest as a test dependency in the setup.py file, it streamlines the process for developers to set up and execute tests, ensuring better code quality and maintainability for the automatic parking functionalities.
Highlights
- Testing Framework Integration: Integrated
pytestas a test dependency for theturtlebot3_automatic_parkingpackage by adding it to thetests_requiresection insetup.py.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
| 'Examples of Different TurtleBot3 Usage.' | ||
| ), | ||
| license='Apache License, Version 2.0', | ||
| tests_require=['pytest'], |
There was a problem hiding this comment.
Consider using extras_require (e.g., extras_require={'test': ['pytest']}) instead of tests_require to align with current best practices for dependency management.
| tests_require=['pytest'], | |
| extras_require={ | |
| 'test': ['pytest'], | |
| }, |
There was a problem hiding this comment.
Code Review
This pull request adds pytest to the tests_require list in setup.py. This is a good first step for integrating pytest into the package.
My main feedback, detailed in the comment on setup.py, is to also declare pytest as a <test_depend> in the package.xml file. This is essential for compatibility with ROS 2 build and test tools like colcon.
Additionally, the pull request description is currently empty. It would be beneficial to add a brief explanation of the motivation for adding pytest (e.g., plans for new tests, migration of existing tests) to provide more context for reviewers.
| 'Examples of Different TurtleBot3 Usage.' | ||
| ), | ||
| license='Apache License, Version 2.0', | ||
| tests_require=['pytest'], |
There was a problem hiding this comment.
Adding pytest to tests_require here is a valid step for setuptools, enabling python setup.py test to find pytest.
However, for ROS 2 packages, it's crucial to also declare test dependencies in package.xml. This ensures that ROS 2 build and test tools, such as colcon, can correctly identify and manage these dependencies.
Please consider adding the following to your package.xml file:
<test_depend>pytest</test_depend>Reasoning:
ROS 2 build systems (e.g., colcon) primarily rely on package.xml for dependency resolution. If pytest is not listed as a <test_depend>, colcon test might fail to set up the testing environment correctly (e.g., pytest might not be installed or visible in the workspace). This can hinder the standard testing workflow for ROS 2 packages and cause issues in CI or for other developers.
No description provided.