Skip to content

Fix launch_testing_ros compatibility with legacy hook specs - #551

Open
Old-Ding wants to merge 2 commits into
ros2:rollingfrom
Old-Ding:codex/legacy-launch-testing-hook
Open

Fix launch_testing_ros compatibility with legacy hook specs#551
Old-Ding wants to merge 2 commits into
ros2:rollingfrom
Old-Ding:codex/legacy-launch-testing-hook

Conversation

@Old-Ding

@Old-Ding Old-Ding commented Jul 10, 2026

Copy link
Copy Markdown

Description

launch_testing now keeps both module_path and path in its current hook specification, while older released versions only expose path. launch_ros 0.29.9 declares only module_path, so Pluggy rejects the plugin when those package versions are mixed.

Use the path argument shared by both released hook specifications and add focused registration tests for the legacy and current shapes.

Addresses #550. This should be backported to Lyrical after merging in Rolling.

Is this user-facing behavior change?

Yes. Launch tests can be collected when a newer launch_testing_ros is used with an older path-only launch_testing release, instead of failing during pytest plugin registration.

Did you use Generative AI?

Yes. OpenAI Codex (GPT-5) assisted with root-cause analysis and preparing the focused code and tests. I reviewed the diff and test results.

Additional Information

Local verification:

  • pytest 7.4.4: 2 tests passed
  • pytest 9.1.1: 2 tests passed
  • legacy and current hookspec invocation probes passed on pytest 7.4.4 and 9.1.1, including path and marker forwarding
  • ament_flake8, ament_pep257, and ament_copyright on both changed Python files
  • Python bytecode compilation
  • git diff --check

Use the path argument retained by the current launch_testing hookspec so
the launch_ros plugin also registers with older path-only versions.

Cover both hookspec shapes with focused plugin registration tests.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
@mergify

mergify Bot commented Jul 10, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Order the new test imports according to the ament flake8 policy so
the repository lint job accepts the compatibility coverage.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
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