From 14943aa6767955ca9085ca62eced32a6289fba9d Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 28 Jan 2024 23:46:28 +0100 Subject: [PATCH] Make finding aggregator_node runfile bzlmod compatible --- ros2/test/diagnostics/BUILD.bazel | 1 + ros2/test/diagnostics/tests.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ros2/test/diagnostics/BUILD.bazel b/ros2/test/diagnostics/BUILD.bazel index d286453c..b3751d00 100644 --- a/ros2/test/diagnostics/BUILD.bazel +++ b/ros2/test/diagnostics/BUILD.bazel @@ -24,5 +24,6 @@ ros2_test( deps = [ "@ros2_common_interfaces//:py_diagnostic_msgs", "@ros2_rclpy//:rclpy", + "@rules_python//python/runfiles", ], ) diff --git a/ros2/test/diagnostics/tests.py b/ros2/test/diagnostics/tests.py index a99de85b..06de3407 100644 --- a/ros2/test/diagnostics/tests.py +++ b/ros2/test/diagnostics/tests.py @@ -20,8 +20,12 @@ import launch_testing.actions import launch_testing.asserts import launch_testing.markers +import python.runfiles import rclpy +AGGREGATOR_NODE_PATH = python.runfiles.Runfiles.Create().Rlocation( + 'ros2_diagnostics/aggregator_node') + @launch_testing.markers.keep_alive def generate_test_description(): @@ -32,7 +36,7 @@ def generate_test_description(): ) aggregator_node = launch_ros.actions.Node( - executable='../ros2_diagnostics/aggregator_node', + executable=AGGREGATOR_NODE_PATH, name='diagnostic_aggregator', parameters=['ros2/test/diagnostics/aggregator_config.yaml'], )