Skip to content

Call ament_package() in moveit_ros_tests - #4001

Open
anfemosa wants to merge 1 commit into
moveit:mainfrom
TrebezIA:fix/moveit-ros-tests-ament-package
Open

anfemosa wants to merge 1 commit into
moveit:mainfrom
TrebezIA:fix/moveit-ros-tests-ament-package

Conversation

@anfemosa

@anfemosa anfemosa commented Nov 26, 2026 •

Copy link
Copy Markdown

Description

moveit_ros_tests never calls ament_package(), so no
ament_cmake_environment_hooks are generated and the installed package has
no local_setup.bash. colcon still writes a package.bash that sources it,
so every shell that sources the install space prints:

not found: ".../install/moveit_ros_tests/share/moveit_ros_tests/local_setup.bash"

moveit_package() only calls ament_package_xml(), so nothing else supplies
the hooks. The missing call is at file scope, so this happens whether
BUILD_TESTING is on or off.

One line: ament_package() at the end of moveit_ros/tests/CMakeLists.txt.

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

Summary by CodeRabbit

  • Chores
    • Package setup now runs consistently whether or not testing is enabled. This keeps package configuration available across both testing and non-testing builds, without changing the package’s public features or behavior.

moveit_ros_tests never called ament_package(), so no
ament_cmake_environment_hooks were generated and the installed package
had no local_setup.bash. colcon still writes a package.bash that sources
it, so every shell sourcing the install space printed

  not found: ".../install/moveit_ros_tests/share/moveit_ros_tests/local_setup.bash"

moveit_package() only calls ament_package_xml(), not ament_package(), so
nothing else supplied the hooks. The call is at file scope, so the fault
does not depend on BUILD_TESTING even though the package body is inside
if(BUILD_TESTING).
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The test CMake file now calls ament_package() after the BUILD_TESTING block. This places the call outside that block.

Changes: Package declaration

Layer / File(s) Summary
Add unconditional package declaration
moveit_ros/tests/CMakeLists.txt
The file calls ament_package() after the BUILD_TESTING block.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix

Suggested reviewers: nbbrooks

Merge Risk: Minimal · up to 61c7d

This change adds the missing package declaration so the installed test package generates its environment hooks. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Call ament_package() in moveit_ros_tests" matches the only change in the changeset, which adds an ament_package() call at the end of moveit_ros/tests/CMakeLists.txt. It names the specific f…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Call ament_package() in moveit_ros_tests" matches the only change in the changeset, which adds an ament_package() call at the end of moveit_ros/tests/CMakeLists.txt. It names the specific function and the package, and the PR objectives confirm the purpose: generating ament_cmake_environment_hooks so that local_setup.bash exists in the install space. The title is concise and specific, so a reviewer scanning history can identify the primary change.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5399d29 and 61c7d63.

Files selected for processing: 1

  • moveit_ros/tests/CMakeLists.txt

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@mergify

mergify Bot commented Nov 26, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request once it meets the queue conditions

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.

1 participant