Fix obsolete advice and code samples, clarify use of colcon test argument#6296
Open
matthewslouismarie wants to merge 3 commits intoros2:jazzyfrom
Open
Fix obsolete advice and code samples, clarify use of colcon test argument#6296matthewslouismarie wants to merge 3 commits intoros2:jazzyfrom
matthewslouismarie wants to merge 3 commits intoros2:jazzyfrom
Conversation
Signed-off-by: matthewslouismarie <17742458+matthewslouismarie@users.noreply.github.com>
Clarified the necessity of sourcing the workspace before testing with colcon, highlighting potential issues if not done. Signed-off-by: matthewslouismarie <17742458+matthewslouismarie@users.noreply.github.com>
Clarify usage of package_selection_args with an example. Signed-off-by: matthewslouismarie <17742458+matthewslouismarie@users.noreply.github.com>
fujitatomoya
approved these changes
Mar 15, 2026
|
|
||
| :ref:`Sourcing the workspace <colcon-tutorial-source-the-environment>` before testing should not be necessary. | ||
| ``colcon test`` makes sure that the tests run with the right environment, have access to their dependencies, etc. | ||
| :ref:`Sourcing the workspace <colcon-tutorial-source-the-environment>` before testing **IS** necessary. If you don’t, you risk running into the following issue: |
Collaborator
There was a problem hiding this comment.
i do not think this is true. colcon test sets up the environment for each package automatically by sourcing the relevant local_setup.* files. that's the whole point of colcon's test runner: it handles the environment so you don't have to source the workspace yourself. the original documentation is correct.
Member
There was a problem hiding this comment.
to add to that, in a lot of cases, seemingly needing to source the workspace manually before running tests indicates that there is a configuration issue in a package. If you're having issues with your package, you can ask on https://robotics.stackexchange.com/?tags=ros2
fujitatomoya
requested changes
Mar 15, 2026
Collaborator
fujitatomoya
left a comment
There was a problem hiding this comment.
sorry this requires the change on 1 comment.
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
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.
Description
setup.pycolcon testpytest arguments.Did you use Generative AI?
Nope.
Additional Information
Very minor corrections. I read the Contributing to ROS 2 Documentation page, hopefully I did not miss anything. Also apparently I have to make a pull request before being able to test the generated documentation.