From d2065ab15ca326f3dce35693a8ba23f3f1401a76 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..9f755397 100644 --- a/ros2/test/diagnostics/tests.py +++ b/ros2/test/diagnostics/tests.py @@ -21,6 +21,10 @@ import launch_testing.asserts import launch_testing.markers import rclpy +from python.runfiles import Runfiles + +AGGREGATOR_NODE_PATH = Runfiles.Create().Rlocation( + 'ros2_diagnostics/aggregator_node') @launch_testing.markers.keep_alive @@ -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'], )