Skip to content

Fix obsolete advice and code samples, clarify use of colcon test argument#6296

Open
matthewslouismarie wants to merge 3 commits intoros2:jazzyfrom
matthewslouismarie:patch-1
Open

Fix obsolete advice and code samples, clarify use of colcon test argument#6296
matthewslouismarie wants to merge 3 commits intoros2:jazzyfrom
matthewslouismarie:patch-1

Conversation

@matthewslouismarie
Copy link

Description

  • Advise the use of the newer syntax to indicate pytest dependency in setup.py
  • Correct invalid statement claiming it is not necessary to source workspace ROS installation
  • Clarify the use of colcon test pytest 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.

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>

: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:
Copy link
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

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

sorry this requires the change on 1 comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants