From 3abb95a03c3287b666360af41bf3fcc2c9de33ff Mon Sep 17 00:00:00 2001 From: Milan Vukov Date: Sun, 13 Oct 2024 22:36:19 +0200 Subject: [PATCH] Update docs --- ros2/cc_defs.bzl | 3 +++ ros2/py_defs.bzl | 3 +++ ros2/test.bzl | 9 ++++++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ros2/cc_defs.bzl b/ros2/cc_defs.bzl index 19921e86..d05f2a51 100644 --- a/ros2/cc_defs.bzl +++ b/ros2/cc_defs.bzl @@ -119,6 +119,9 @@ def ros2_cpp_test(name, ros2_package_name = None, set_up_ament = True, idl_deps Adds common ROS 2 C++ definitions on top of a cc_test. + Please make sure that --sandbox_default_allow_network=false is set in .bazelrc. + This ensures proper network isolation. + Args: name: A unique target name. ros2_package_name: If given, defines a ROS package name for the target. diff --git a/ros2/py_defs.bzl b/ros2/py_defs.bzl index e0f7901a..6b2c24f1 100644 --- a/ros2/py_defs.bzl +++ b/ros2/py_defs.bzl @@ -60,6 +60,9 @@ def ros2_py_binary(name, srcs, main, set_up_ament = False, **kwargs): def ros2_py_test(name, srcs, main, set_up_ament = True, **kwargs): """ Defines a ROS 2 Python test. + Please make sure that --sandbox_default_allow_network=false is set in .bazelrc. + This ensures proper network isolation. + Args: name: A unique target name. srcs: List of source files. diff --git a/ros2/test.bzl b/ros2/test.bzl index 753af587..538e1cbd 100644 --- a/ros2/test.bzl +++ b/ros2/test.bzl @@ -8,9 +8,12 @@ load("@rules_ros2_pip_deps//:requirements.bzl", "requirement") def ros2_test(name, launch_file, nodes = None, deps = None, data = None, idl_deps = None, use_pytest = False, **kwargs): """ Defines a ROS 2 test. - In case you don't need ROS 2 nodes for tests, but need ament setup such - that e.g. plugins can work: use a lightweight macro ros2_cpp_test - from //ros2:cc_defs.bzl. + For lighter options, e.g. you don't need a launch file, please take a look at: + * ros2_cpp_test in //ros2:cc_defs.bzl and + * ros2_py_test in //ros2:py_defs.bzl + + Please make sure that --sandbox_default_allow_network=false is set in .bazelrc. + This ensures proper network isolation. Args: name: A unique target name.