From 2d4634aedda166257a26feef5ea97e39cd23893a Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Thu, 1 May 2025 17:49:19 +0000 Subject: [PATCH 01/11] merge form iche033/ros2_zenoh_cpp_vendor and update find package logic Signed-off-by: Ian Chen --- .github/ci/before_cmake.sh | 2 ++ .github/ci/packages-noble.apt | 1 + CMakeLists.txt | 23 +++++++++++++++++++---- 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 .github/ci/before_cmake.sh diff --git a/.github/ci/before_cmake.sh b/.github/ci/before_cmake.sh new file mode 100644 index 00000000..93cb2ae6 --- /dev/null +++ b/.github/ci/before_cmake.sh @@ -0,0 +1,2 @@ +# Set ROS_DISTRO. This is needed for finding zenoh packages vendored by ROS 2 +export ROS_DISTRO="jazzy" diff --git a/.github/ci/packages-noble.apt b/.github/ci/packages-noble.apt index 72293d5e..3c7bda9d 100644 --- a/.github/ci/packages-noble.apt +++ b/.github/ci/packages-noble.apt @@ -1 +1,2 @@ cppzmq-dev +ros-jazzy-zenoh-cpp-vendor diff --git a/CMakeLists.txt b/CMakeLists.txt index c933cf71..a1542311 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,12 +108,27 @@ gz_find_package(CPPZMQ REQUIRED PRIVATE ######################################## # Find Zenoh -gz_find_package(zenohc PRIVATE) -gz_find_package(zenohcxx PRIVATE) -if (NOT zenohcxx_DIR) + +gz_find_package(zenohc PRIVATE QUIET) +gz_find_package(zenohcxx PRIVATE QUIET) + +# If both zenohc and zenohcpp packages are not found then +# look for these pacakages installed by ROS 2 zenoh_cpp_vendor package +if (NOT zenohc_FOUND AND NOT zenohcxx_FOUND) + # Set CMAKE_PREFIX_PATH in order to find ROS 2 packages from plain cmake + # package, see https://github.com/ament/ament_cmake/issues/304 + set(ros2_zenoh_cmake_path "/opt/ros/$ENV{ROS_DISTRO}/opt/zenoh_cpp_vendor/lib/cmake") + if (EXISTS ${ros2_zenoh_cmake_path}) + list(PREPEND CMAKE_PREFIX_PATH ${ros2_zenoh_cmake_path}) + gz_find_package(zenohc PRIVATE QUIET) + gz_find_package(zenohcxx PRIVATE QUIET) + endif() +endif () + +if (NOT zenohcxx_FOUND) message (STATUS "Looking for zenohcxx - not found") set (HAVE_ZENOH OFF CACHE BOOL "HAVE ZENOH" FORCE) -elseif (NOT zenohc_DIR) +elseif (NOT zenohc_FOUND) message (STATUS "Looking for zenohc - not found") set (HAVE_ZENOH OFF CACHE BOOL "HAVE ZENOH" FORCE) else () From 25d414731468fa5d53cb70edff80e9095bc5d094 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Thu, 1 May 2025 17:51:40 +0000 Subject: [PATCH 02/11] set GZ_TRANSPORT_IMPLEMENTATION=zenoh Signed-off-by: Ian Chen --- .github/ci/after_make.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/ci/after_make.sh b/.github/ci/after_make.sh index d094d879..c72dd72e 100644 --- a/.github/ci/after_make.sh +++ b/.github/ci/after_make.sh @@ -1,2 +1,4 @@ # It's necessary to install the python modules for the test. -make install \ No newline at end of file +make install + +export GZ_TRANSPORT_IMPLEMENTATION=zenoh From 17d775e66b4e743ab63d124873e17c072a91874f Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Thu, 1 May 2025 17:52:48 +0000 Subject: [PATCH 03/11] test gh actions ci Signed-off-by: Ian Chen --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 556ecff5..e032c22a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,7 @@ on: - 'ign-transport[0-9]?' - 'gz-transport[0-9]?' - 'main' + - 'iche033/zenoh_main_pub_sub' jobs: jammy-ci: From 5e5a62baf23939d7f206f3a3325539ba5be9bc8b Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Thu, 1 May 2025 23:43:54 +0000 Subject: [PATCH 04/11] test running zenoh Signed-off-by: Ian Chen --- .github/ci/after_make.sh | 2 +- .github/ci/after_make_test.sh | 10 ++++++++++ .github/ci/before_cmake.sh | 4 +++- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .github/ci/after_make_test.sh diff --git a/.github/ci/after_make.sh b/.github/ci/after_make.sh index c72dd72e..1ffd7e34 100644 --- a/.github/ci/after_make.sh +++ b/.github/ci/after_make.sh @@ -1,4 +1,4 @@ # It's necessary to install the python modules for the test. make install -export GZ_TRANSPORT_IMPLEMENTATION=zenoh +# export GZ_TRANSPORT_IMPLEMENTATION=zenoh diff --git a/.github/ci/after_make_test.sh b/.github/ci/after_make_test.sh new file mode 100644 index 00000000..ea774633 --- /dev/null +++ b/.github/ci/after_make_test.sh @@ -0,0 +1,10 @@ +export GZ_TRANSPORT_IMPLEMENTATION=zenoh +export CTEST_OUTPUT_ON_FAILURE=1 +# Capture exit code to avoid exiting early +make test || test_exit_code=$? +echo "Summarize zenoh test results" +python3 /junit_to_md.py test_results/*.xml >> $GITHUB_STEP_SUMMARY || true +if [ $test_exit_code -ne 0 ]; then + exit $test_exit_code ; +fi + diff --git a/.github/ci/before_cmake.sh b/.github/ci/before_cmake.sh index 93cb2ae6..3b895871 100644 --- a/.github/ci/before_cmake.sh +++ b/.github/ci/before_cmake.sh @@ -1,2 +1,4 @@ -# Set ROS_DISTRO. This is needed for finding zenoh packages vendored by ROS 2 +# Instead of sourcing ros setup script, set only required env variables. +# This is needed for finding zenoh packages vendored by ROS 2. export ROS_DISTRO="jazzy" +LD_LIBRARY_PATH="/opt/ros/${ROS_DISTRO}/opt/zenoh_cpp_vendor/lib:$LD_LIBRARY_PATH" From a0f1cbb9bc9e9661a4ce6ac8072904ca05f91efd Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Fri, 2 May 2025 03:20:16 +0000 Subject: [PATCH 05/11] add zenoh ubuntu ci job Signed-off-by: Ian Chen --- .github/ci/before_cmake.sh | 2 +- .github/workflows/ci.yml | 11 +++++++++++ CMakeLists.txt | 10 +++++++++- include/gz/transport/config.hh.in | 1 + src/NodeSharedPrivate.hh | 5 ++++- 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/ci/before_cmake.sh b/.github/ci/before_cmake.sh index 3b895871..e36310c6 100644 --- a/.github/ci/before_cmake.sh +++ b/.github/ci/before_cmake.sh @@ -1,4 +1,4 @@ # Instead of sourcing ros setup script, set only required env variables. # This is needed for finding zenoh packages vendored by ROS 2. export ROS_DISTRO="jazzy" -LD_LIBRARY_PATH="/opt/ros/${ROS_DISTRO}/opt/zenoh_cpp_vendor/lib:$LD_LIBRARY_PATH" +export LD_LIBRARY_PATH="/opt/ros/${ROS_DISTRO}/opt/zenoh_cpp_vendor/lib:$LD_LIBRARY_PATH" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2bb12d1..f0b0e135 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,3 +24,14 @@ jobs: cppcheck-enabled: true cpplint-enabled: true doxygen-enabled: true + noble-ci-zenoh: + runs-on: ubuntu-latest + name: Ubuntu Noble CI - Zenoh + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Compile and test + id: ci + uses: gazebo-tooling/action-gz-ci@noble + with: + cmake-args: '-DGZ_TRANSPORT_DEFAULT_IMPLEMENTATION=zenoh' diff --git a/CMakeLists.txt b/CMakeLists.txt index 21d4875f..7cf344bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,6 +72,7 @@ gz_find_package(GzProtobuf #-------------------------------------- # Find ZeroMQ gz_find_package(ZeroMQ VERSION 4 REQUIRED PRIVATE) +list(APPEND GZ_TRANSPORT_IMPLEMENTATION_LIST "zeromq") if (UNIX AND NOT APPLE) execute_process(COMMAND lsb_release -cs @@ -97,7 +98,6 @@ gz_find_package(CPPZMQ REQUIRED PRIVATE ######################################## # Find Zenoh - gz_find_package(zenohc PRIVATE QUIET) gz_find_package(zenohcxx PRIVATE QUIET) @@ -124,6 +124,7 @@ else () message (STATUS "Looking for zenohcxx and zenohc - found") set (HAVE_ZENOH ON CACHE BOOL "HAVE ZENOH" FORCE) list(APPEND EXTRA_TEST_LIB_DEPS "zenohcxx::zenohc") + list(APPEND GZ_TRANSPORT_IMPLEMENTATION_LIST "zenoh") endif () #-------------------------------------- @@ -169,6 +170,13 @@ gz_find_package(SQLite3 PRIVATE_FOR log PRETTY sqlite3) +#-------------------------------------- +# Check GZ_TRANSPORT_DEFAULT_IMPLEMENTATION value +set(GZ_TRANSPORT_DEFAULT_IMPLEMENTATION "zeromq" CACHE + STRING "Set default gz-transport implementation") +if (NOT ${GZ_TRANSPORT_DEFAULT_IMPLEMENTATION} IN_LIST GZ_TRANSPORT_IMPLEMENTATION_LIST) + message(FATAL_ERROR "Invalid GZ_TRANSPORT_DEFAULT_IMPLMENTATION value: ${GZ_TRANSPORT_DEFAULT_IMPLEMENTATION}") +endif() #============================================================================ # Configure the build diff --git a/include/gz/transport/config.hh.in b/include/gz/transport/config.hh.in index 97de3d9f..1bf9580a 100644 --- a/include/gz/transport/config.hh.in +++ b/include/gz/transport/config.hh.in @@ -35,5 +35,6 @@ #cmakedefine HAVE_IFADDRS 1 #cmakedefine UBUNTU_FOCAL 1 #cmakedefine HAVE_ZENOH 1 +#cmakedefine GZ_TRANSPORT_DEFAULT_IMPLEMENTATION "${GZ_TRANSPORT_DEFAULT_IMPLEMENTATION}" #endif diff --git a/src/NodeSharedPrivate.hh b/src/NodeSharedPrivate.hh index e2734e84..e9c1623d 100644 --- a/src/NodeSharedPrivate.hh +++ b/src/NodeSharedPrivate.hh @@ -30,6 +30,8 @@ #include #endif +#include "gz/transport/config.hh" + #include "gz/transport/Discovery.hh" #include "gz/transport/Node.hh" @@ -217,7 +219,8 @@ namespace gz /// \brief Underlying middleware implementation. /// Supported values are: [zenoh, zeromq]. - public: std::string gzImplementation = "zeromq"; + public: std::string gzImplementation = + std::string(GZ_TRANSPORT_DEFAULT_IMPLEMENTATION); }; } } From f9e606556f5b6ce49406cd6d321d7eecdfc39cc2 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Fri, 2 May 2025 04:01:26 +0000 Subject: [PATCH 06/11] remove after_make_test Signed-off-by: Ian Chen --- .github/ci/after_make_test.sh | 10 ---------- CMakeLists.txt | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 .github/ci/after_make_test.sh diff --git a/.github/ci/after_make_test.sh b/.github/ci/after_make_test.sh deleted file mode 100644 index ea774633..00000000 --- a/.github/ci/after_make_test.sh +++ /dev/null @@ -1,10 +0,0 @@ -export GZ_TRANSPORT_IMPLEMENTATION=zenoh -export CTEST_OUTPUT_ON_FAILURE=1 -# Capture exit code to avoid exiting early -make test || test_exit_code=$? -echo "Summarize zenoh test results" -python3 /junit_to_md.py test_results/*.xml >> $GITHUB_STEP_SUMMARY || true -if [ $test_exit_code -ne 0 ]; then - exit $test_exit_code ; -fi - diff --git a/CMakeLists.txt b/CMakeLists.txt index 7cf344bb..ab42c398 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,7 +175,7 @@ gz_find_package(SQLite3 set(GZ_TRANSPORT_DEFAULT_IMPLEMENTATION "zeromq" CACHE STRING "Set default gz-transport implementation") if (NOT ${GZ_TRANSPORT_DEFAULT_IMPLEMENTATION} IN_LIST GZ_TRANSPORT_IMPLEMENTATION_LIST) - message(FATAL_ERROR "Invalid GZ_TRANSPORT_DEFAULT_IMPLMENTATION value: ${GZ_TRANSPORT_DEFAULT_IMPLEMENTATION}") + message(FATAL_ERROR "Invalid GZ_TRANSPORT_DEFAULT_IMPLEMENTATION value: ${GZ_TRANSPORT_DEFAULT_IMPLEMENTATION}") endif() #============================================================================ From 5c980967d54ee02d712666ed4fba47c1dbcedd5d Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Fri, 2 May 2025 04:43:12 +0000 Subject: [PATCH 07/11] rm unused code Signed-off-by: Ian Chen --- .github/ci/after_make.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/ci/after_make.sh b/.github/ci/after_make.sh index 1ffd7e34..802b0d63 100644 --- a/.github/ci/after_make.sh +++ b/.github/ci/after_make.sh @@ -1,4 +1,2 @@ # It's necessary to install the python modules for the test. make install - -# export GZ_TRANSPORT_IMPLEMENTATION=zenoh From 8993336598c15e13ec51fa62a2c3a8a77759536e Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Fri, 2 May 2025 04:43:51 +0000 Subject: [PATCH 08/11] updates Signed-off-by: Ian Chen --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0b0e135..c1a5dd8e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,7 @@ on: - 'ign-transport[0-9]?' - 'gz-transport[0-9]?' - 'main' + # update branch before merging" - 'iche033/zenoh_main_pub_sub' jobs: From 204f245864b2e8e40511a3c0b171532d1b798ff0 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Fri, 2 May 2025 04:54:47 +0000 Subject: [PATCH 09/11] rm branch for testing Signed-off-by: Ian Chen --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1a5dd8e..100f14ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,8 +7,6 @@ on: - 'ign-transport[0-9]?' - 'gz-transport[0-9]?' - 'main' - # update branch before merging" - - 'iche033/zenoh_main_pub_sub' jobs: noble-ci: From 77837f06fc732b90fbd6e271d3c29e006d444ba7 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Wed, 7 May 2025 22:28:14 +0000 Subject: [PATCH 10/11] disable a few tests Signed-off-by: Ian Chen --- include/gz/transport/Helpers.hh | 4 + log/src/LogCommandAPI_TEST.cc | 3 + log/src/Recorder_TEST.cc | 4 + log/src/cmd/LogCommandAPI.cc | 13 +++- log/test/integration/playback.cc | 14 ++++ log/test/integration/recorder.cc | 18 +++++ parameters/src/CMakeLists.txt | 2 +- parameters/src/cmd/ParamCommandAPI_TEST.cc | 4 + .../src/transport/_gz_transport_pybind11.cc | 15 ++-- python/test/pubSub_TEST.py | 5 +- python/test/requester_TEST.py | 3 + src/Helpers.cc | 9 +++ src/Helpers_TEST.cc | 18 +++++ src/NodeShared.cc | 17 ++--- src/Node_TEST.cc | 76 +++++++++++++++++++ src/cmd/gz_TEST.cc | 36 +++++++++ src/cmd/gz_src_TEST.cc | 12 +++ test/integration/twoProcsPubSub.cc | 22 ++++++ test/integration/twoProcsSrvCall.cc | 12 +++ test/integration/twoProcsSrvCallStress.cc | 2 + test/integration/twoProcsSrvCallSync1.cc | 2 + .../twoProcsSrvCallWithoutInput.cc | 10 +++ .../twoProcsSrvCallWithoutInputStress.cc | 2 + .../twoProcsSrvCallWithoutInputSync1.cc | 2 + .../twoProcsSrvCallWithoutOutput.cc | 6 ++ .../twoProcsSrvCallWithoutOutputStress.cc | 2 + test/test_utils.hh | 10 +++ 27 files changed, 304 insertions(+), 19 deletions(-) diff --git a/include/gz/transport/Helpers.hh b/include/gz/transport/Helpers.hh index feff06b1..99af5b04 100644 --- a/include/gz/transport/Helpers.hh +++ b/include/gz/transport/Helpers.hh @@ -72,6 +72,10 @@ namespace gz /// \returns id of current process unsigned int GZ_TRANSPORT_VISIBLE getProcessId(); + /// \brief Get the name of the underlying transport implementation + /// \returns Name of the transport implementation, e.g. "zeromq", "zenoh" + std::string GZ_TRANSPORT_VISIBLE getTransportImplementation(); + // Use safer functions on Windows #ifdef _MSC_VER #define gz_strcat strcat_s diff --git a/log/src/LogCommandAPI_TEST.cc b/log/src/LogCommandAPI_TEST.cc index b07f1c34..24481b58 100644 --- a/log/src/LogCommandAPI_TEST.cc +++ b/log/src/LogCommandAPI_TEST.cc @@ -18,6 +18,8 @@ #include "cmd/LogCommandAPI.hh" #include "gtest/gtest.h" +#include "test_utils.hh" + ////////////////////////////////////////////////// TEST(LogCommandAPI, Version) { @@ -55,6 +57,7 @@ TEST(LogCommandAPI, PlaybackBadRemap) ////////////////////////////////////////////////// TEST(LogCommandAPI, RecordFailedToOpen) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") EXPECT_EQ(FAILED_TO_OPEN, recordTopics("!@#$%^&*(:;[{]})?/.'|", ".*")); } diff --git a/log/src/Recorder_TEST.cc b/log/src/Recorder_TEST.cc index c2bc2677..b7a65e79 100644 --- a/log/src/Recorder_TEST.cc +++ b/log/src/Recorder_TEST.cc @@ -21,6 +21,8 @@ #include "gz/transport/log/Recorder.hh" #include "gtest/gtest.h" +#include "test_utils.hh" + using namespace gz; ////////////////////////////////////////////////// @@ -85,6 +87,8 @@ TEST(Record, AddInvalidTopic) ////////////////////////////////////////////////// TEST(Record, AddTopicRegex) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::log::Recorder recorder; EXPECT_EQ(0, recorder.AddTopic(std::regex("////"))); } diff --git a/log/src/cmd/LogCommandAPI.cc b/log/src/cmd/LogCommandAPI.cc index 84ee4b5e..6ec517c7 100644 --- a/log/src/cmd/LogCommandAPI.cc +++ b/log/src/cmd/LogCommandAPI.cc @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include "../Console.hh" @@ -60,8 +61,16 @@ int recordTopics(const char *_file, const char *_pattern) transport::log::Recorder recorder; - if (recorder.AddTopic(regexPattern) < 0) - return FAILED_TO_SUBSCRIBE; + // Recorder functionality is not working in zenoh implementation yet + // Continue executing the rest of this function for the gz_log_record_* ruby + // test. + // \todo(iche033) Remove this check once supported. + if (gz::transport::getTransportImplementation() != "zenoh") + { + LWRN("Recording is not supported in zenoh\n"); + if (recorder.AddTopic(regexPattern) < 0) + return FAILED_TO_SUBSCRIBE; + } if (recorder.Start(_file) != transport::log::RecorderError::SUCCESS) return FAILED_TO_OPEN; diff --git a/log/test/integration/playback.cc b/log/test/integration/playback.cc index 1d149585..cbbea8ff 100644 --- a/log/test/integration/playback.cc +++ b/log/test/integration/playback.cc @@ -102,6 +102,8 @@ bool ExpectSameMessages( /// the original. TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayLog)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics = {"/foo", "/bar", "/baz"}; std::vector incomingData; @@ -202,6 +204,8 @@ TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayNoSuchTopic)) /// the original. TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayLogRegex)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics = {"/foo", "/bar", "/baz"}; std::vector incomingData; @@ -269,6 +273,8 @@ TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayLogRegex)) /// that the playback matches the original. TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(RemoveTopic)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics = {"/foo", "/bar", "/baz"}; std::vector incomingData; @@ -378,6 +384,8 @@ TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(RemoveTopic)) /// the original. TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayLogMoveInstances)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics = {"/foo", "/bar", "/baz"}; std::vector incomingData; @@ -448,6 +456,8 @@ TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayLogMoveInstances)) /// methods to control the playback flow. TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayPauseResume)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics = {"/foo", "/bar", "/baz"}; std::vector incomingData; @@ -570,6 +580,8 @@ TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplayPauseResume)) /// the playback workflow. TEST(playback, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ReplayStep)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics = {"/foo", "/bar", "/baz"}; std::vector incomingData; @@ -686,6 +698,8 @@ TEST(playback, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ReplayStep)) /// the playback workflow. TEST(playback, GZ_UTILS_TEST_DISABLED_ON_MAC(ReplaySeek)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics = {"/foo", "/bar", "/baz"}; std::vector incomingData; diff --git a/log/test/integration/recorder.cc b/log/test/integration/recorder.cc index 2773d151..d3bf7571 100644 --- a/log/test/integration/recorder.cc +++ b/log/test/integration/recorder.cc @@ -76,6 +76,8 @@ void VerifyMessage(const gz::transport::log::Message &_msg, TEST(recorder, GZ_UTILS_TEST_DISABLED_ON_MAC(BeginRecordingTopicsBeforeAdvertisement)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Remember to include a leading slash so that the VerifyTopic lambda below // will work correctly. gz-transport automatically adds a leading slash to // topics that don't specify one. @@ -146,6 +148,8 @@ TEST(recorder, /// so we only test to see that we received the very last message. TEST(recorder, BeginRecordingTopicsAfterAdvertisement) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics = {"/foo", "/bar"}; const std::string logName = @@ -272,12 +276,16 @@ void RecordPatternBeforeAdvertisement(const std::regex &_pattern) ////////////////////////////////////////////////// TEST(recorder, BeginRecordingPatternBeforeAdvertisement) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + RecordPatternBeforeAdvertisement(std::regex(".*foo.*")); } ////////////////////////////////////////////////// TEST(recorder, BeginRecordingAllBeforeAdvertisement) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + RecordPatternBeforeAdvertisement(std::regex(".*")); } @@ -287,6 +295,8 @@ TEST(recorder, BeginRecordingAllBeforeAdvertisement) /// data queue. TEST(recorder, DataWriterQueue) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Remember to include a leading slash so that the VerifyTopic lambda below // will work correctly. gz-transport automatically adds a leading slash to // topics that don't specify one. @@ -376,6 +386,8 @@ TEST(recorder, DataWriterQueue) /// Test that clock is properly recorded TEST(recorder, DataWriterQueueClockUpdates) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Remember to include a leading slash so that the VerifyTopic lambda below // will work correctly. gz-transport automatically adds a leading slash to // topics that don't specify one. @@ -517,6 +529,8 @@ void TestBufferSizeSettings(const std::optional &_bufferSize, /// Test default buffer size setting TEST(recorder, DataWriterQueueDefaultBufferSize) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + TestBufferSizeSettings(std::nullopt, 50); } @@ -524,6 +538,8 @@ TEST(recorder, DataWriterQueueDefaultBufferSize) /// Test infinite buffer size setting TEST(recorder, DataWriterQueueInfiniteBufferSize) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + TestBufferSizeSettings(0, 50); } @@ -532,6 +548,8 @@ TEST(recorder, DataWriterQueueInfiniteBufferSize) /// still get recorded TEST(recorder, DataWriterQueueLargeMessages) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + TestBufferSizeSettings(1, 1); } diff --git a/parameters/src/CMakeLists.txt b/parameters/src/CMakeLists.txt index 7ac13760..cce4d545 100644 --- a/parameters/src/CMakeLists.txt +++ b/parameters/src/CMakeLists.txt @@ -19,7 +19,7 @@ endif() gz_build_tests( TYPE "UNIT" SOURCES ${gtest_sources} - LIB_DEPS ${param_lib_target} ${EXTRA_TEST_LIB_DEPS} + LIB_DEPS ${param_lib_target} ${EXTRA_TEST_LIB_DEPS} test_config ) if(NOT WIN32) diff --git a/parameters/src/cmd/ParamCommandAPI_TEST.cc b/parameters/src/cmd/ParamCommandAPI_TEST.cc index 1881f800..6b694d24 100644 --- a/parameters/src/cmd/ParamCommandAPI_TEST.cc +++ b/parameters/src/cmd/ParamCommandAPI_TEST.cc @@ -26,6 +26,8 @@ #include "gtest/gtest.h" +#include "test_utils.hh" + using namespace gz; using namespace transport; using namespace transport::parameters; @@ -137,6 +139,7 @@ TEST_F(ParametersClientTest, cmdParameterGet) ////////////////////////////////////////////////// TEST_F(ParametersClientTest, SetParameter) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") { CaptureCoutScoped coutCapture; CaptureCerrScoped cerrCapture; @@ -187,6 +190,7 @@ TEST_F(ParametersClientTest, SetParameter) ////////////////////////////////////////////////// TEST_F(ParametersClientTest, ListParameters) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") { CaptureCoutScoped coutCapture; CaptureCerrScoped cerrCapture; diff --git a/python/src/transport/_gz_transport_pybind11.cc b/python/src/transport/_gz_transport_pybind11.cc index 0289f0fc..ed8f1179 100644 --- a/python/src/transport/_gz_transport_pybind11.cc +++ b/python/src/transport/_gz_transport_pybind11.cc @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -68,7 +69,7 @@ PYBIND11_MODULE(BINDINGS_MODULE_NAME, m) { &AdvertiseMessageOptions::MsgsPerSec, &AdvertiseMessageOptions::SetMsgsPerSec, "The maximum number of messages per second to be published") - .def("__copy__", + .def("__copy__", [](const AdvertiseMessageOptions &self) { return AdvertiseMessageOptions(self); @@ -110,9 +111,9 @@ PYBIND11_MODULE(BINDINGS_MODULE_NAME, m) { }, py::arg("from_topic"), "Get a topic remapping. Returns a pair with the result of the method" - "and the remapped name of the topic. The topic name remains empty if" + "and the remapped name of the topic. The topic name remains empty if" "there isn't any remap for the topic") - .def("__copy__", + .def("__copy__", [](const NodeOptions &self) { return NodeOptions(self); @@ -135,7 +136,7 @@ PYBIND11_MODULE(BINDINGS_MODULE_NAME, m) { &SubscribeOptions::MsgsPerSec, &SubscribeOptions::SetMsgsPerSec, "Set the maximum number of messages per second received per topic") - .def("__copy__", + .def("__copy__", [](const SubscribeOptions &self) { return SubscribeOptions(self); @@ -304,7 +305,7 @@ PYBIND11_MODULE(BINDINGS_MODULE_NAME, m) { "Get the current statistics for a topic. Statistics must" "have been enabled using the EnableStats function, otherwise" "the return value will be null."); - + // Register Node::Publisher as a subclass of Node py::class_(node, "Publisher", "A class that is used to store information about an" @@ -323,6 +324,10 @@ PYBIND11_MODULE(BINDINGS_MODULE_NAME, m) { .def("has_connections", &gz::transport::Node::Publisher::HasConnections, "Return true if this publisher has subscribers"); + + m.def("transport_implementation", &getTransportImplementation, + "Get the name of the underlying transport implementation."); + } // gz-transport module } // python diff --git a/python/test/pubSub_TEST.py b/python/test/pubSub_TEST.py index 1857d540..000bf0e4 100644 --- a/python/test/pubSub_TEST.py +++ b/python/test/pubSub_TEST.py @@ -16,7 +16,7 @@ from gz.msgs11.stringmsg_pb2 import StringMsg from gz.msgs11.vector3d_pb2 import Vector3d from gz.transport import Node, AdvertiseMessageOptions, SubscribeOptions, TopicStatistics - +from gz.transport import transport_implementation from threading import Lock import time @@ -35,6 +35,8 @@ def stringmsg_cb(self, msg: StringMsg): self.msg_counter += 1 self.received_msg = msg.data + @unittest.skipIf(transport_implementation() == "zenoh", + "transport implementation 'zenoh' is not supported") def setUp(self): # Publisher set up self.pub_node = Node() @@ -52,6 +54,7 @@ def tearDown(self): # Check that the publisher publishes a message of the appropriate type # but doesn't publish when the message is not the appropriate type. def test_publish_msg(self): + # if transport_implementation() == "zenoh": string_msg = StringMsg() string_msg.data = "Hello" self.assertTrue(self.pub.publish(self.vector3d_msg)) diff --git a/python/test/requester_TEST.py b/python/test/requester_TEST.py index f8bd6e55..df2864af 100644 --- a/python/test/requester_TEST.py +++ b/python/test/requester_TEST.py @@ -16,6 +16,7 @@ from gz.msgs11.int32_pb2 import Int32 from gz.msgs11.stringmsg_pb2 import StringMsg from gz.transport import Node +from gz.transport import transport_implementation import os import subprocess @@ -23,6 +24,8 @@ class RequesterTEST(unittest.TestCase): + @unittest.skipIf(transport_implementation() == "zenoh", + "transport implementation 'zenoh' is not supported") def setUp(self): # Environment Setup gz_partition = "python_requester_test" diff --git a/src/Helpers.cc b/src/Helpers.cc index 5e4ebf49..04367166 100644 --- a/src/Helpers.cc +++ b/src/Helpers.cc @@ -24,6 +24,7 @@ #include #endif +#include "gz/transport/config.hh" #include "gz/transport/Helpers.hh" namespace gz @@ -75,6 +76,14 @@ namespace gz return ::getpid(); #endif } + + ////////////////////////////////////////////////// + std::string getTransportImplementation() + { + if (const char* implEnv = std::getenv("GZ_TRANSPORT_IMPLEMENTATION")) + return std::string(implEnv); + return std::string(GZ_TRANSPORT_DEFAULT_IMPLEMENTATION); + } } } } diff --git a/src/Helpers_TEST.cc b/src/Helpers_TEST.cc index c5674f32..a9b54b0a 100644 --- a/src/Helpers_TEST.cc +++ b/src/Helpers_TEST.cc @@ -88,3 +88,21 @@ TEST(HelpersTest, SplitOneDelimiterAtEnd) EXPECT_EQ("Hello World", pieces[0]); EXPECT_EQ("", pieces[1]); } + +////////////////////////////////////////////////// +/// \brief Check the getTransportImplementation() function. +TEST(HelpersTest, TransportImplementation) +{ + std::string impl = transport::getTransportImplementation(); + EXPECT_FALSE(impl.empty()); + + ASSERT_TRUE(gz::utils::setenv("GZ_TRANSPORT_IMPLEMENTATION", "abc")); + + impl = transport::getTransportImplementation(); + EXPECT_EQ("abc", impl); + + ASSERT_TRUE(gz::utils::setenv("GZ_TRANSPORT_IMPLEMENTATION", "")); + + impl = transport::getTransportImplementation(); + EXPECT_TRUE(impl.empty()); +} diff --git a/src/NodeShared.cc b/src/NodeShared.cc index d7de6fed..d4809fa4 100644 --- a/src/NodeShared.cc +++ b/src/NodeShared.cc @@ -307,17 +307,14 @@ NodeShared::NodeShared() this, std::placeholders::_1)); // Set the Gz Transport implementation (ZeroMQ, Zenoh, ...). - std::string gzImpl; - if (env("GZ_TRANSPORT_IMPLEMENTATION", gzImpl) && !gzImpl.empty()) + std::string gzImpl = getTransportImplementation(); + std::transform(gzImpl.begin(), gzImpl.end(), gzImpl.begin(), ::tolower); + if (gzImpl == "zeromq" || gzImpl == "zenoh") + this->dataPtr->gzImplementation = gzImpl; + else { - std::transform(gzImpl.begin(), gzImpl.end(), gzImpl.begin(), ::tolower); - if (gzImpl == "zeromq" || gzImpl == "zenoh") - this->dataPtr->gzImplementation = gzImpl; - else - { - std::cerr << "Unrecognized value in GZ_TRANSPORT_IMPLEMENTATION. [" - << gzImpl << "]. Ignoring this value" << std::endl; - } + std::cerr << "Unrecognized value in GZ_TRANSPORT_IMPLEMENTATION. [" + << gzImpl << "]. Ignoring this value" << std::endl; } // Start the discovery services. diff --git a/src/Node_TEST.cc b/src/Node_TEST.cc index 7850455f..38bbe5a1 100644 --- a/src/Node_TEST.cc +++ b/src/Node_TEST.cc @@ -539,6 +539,8 @@ TEST(NodePubTest, BoolOperatorTest) /// \brief A message should not be published if it is not advertised before. TEST(NodeTest, PubWithoutAdvertise) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -649,6 +651,8 @@ TEST(NodeTest, PubSubSameThread) /// \brief A thread can create a node, and send and receive messages. TEST(NodeTest, PubSubSameThreadGenericCb) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -693,6 +697,8 @@ TEST(NodeTest, PubSubSameThreadGenericCb) /// information. TEST(NodeTest, PubSubSameThreadMessageInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -775,6 +781,8 @@ TEST(NodeTest, RawPubSubSameThreadMessageInfo) ////////////////////////////////////////////////// TEST(NodeTest, RawPubRawSubSameThreadMessageInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -817,6 +825,8 @@ TEST(NodeTest, RawPubRawSubSameThreadMessageInfo) ////////////////////////////////////////////////// TEST(NodeTest, PubRawSubSameThreadMessageInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -905,6 +915,8 @@ TEST(NodeTest, PubSubSameThreadLambda) /// information. TEST(NodeTest, PubSubSameThreadLambdaMessageInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -1027,6 +1039,8 @@ TEST(NodeTest, PubSubWithCreateSubscriber) /// \brief Subscribe to a topic using dfferent Subscribe APIs TEST(NodeTest, PubSubWithMixedSubscribeAPIs) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -1168,6 +1182,8 @@ TEST(NodeTest, PubSubWithMixedSubscribeAPIs) /// within the same node but it's valid on separate nodes. TEST(NodeTest, AdvertiseTwoEqualTopics) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node1; transport::Node node2; @@ -1359,6 +1375,8 @@ TEST(NodeTest, ClassMemberCallbackMessage) /// publish. This test uses a callback that accepts message information. TEST(NodeTest, ClassMemberCallbackMessageInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + MyTestClass client; client.SubscribeWithMessageInfo(); @@ -1377,6 +1395,8 @@ TEST(NodeTest, ClassMemberCallbackMessageInfo) /// function. TEST(NodeTest, ClassMemberCallbackService) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + MyTestClass client; client.TestServiceCall(); } @@ -1386,6 +1406,8 @@ TEST(NodeTest, ClassMemberCallbackService) /// using member function. TEST(NodeTest, ClassMemberCallbackServiceWithoutInput) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + MyTestClass client; client.TestServiceCallWithoutInput(); } @@ -1394,6 +1416,8 @@ TEST(NodeTest, ClassMemberCallbackServiceWithoutInput) /// \brief Make an asynchronous service call, and then, advertise the service. TEST(NodeTest, ClassMemberRequestServiceBeforeAdvertise) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + MyTestClass client; client.TestServiceCallRequestingBeforeAdvertising(); } @@ -1426,6 +1450,8 @@ TEST(NodeTest, TypeMismatch) /// \brief Make an asynchronous service call using free function. TEST(NodeTest, ServiceCallAsync) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 req; @@ -1490,6 +1516,8 @@ TEST(NodeTest, ServiceCallAsync) /// \brief Make an asynchronous service call without input using free function. TEST(NodeTest, ServiceCallWithoutInputAsync) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; @@ -1552,6 +1580,8 @@ TEST(NodeTest, ServiceCallWithoutInputAsync) /// \using free function. TEST(NodeTest, ServiceWithoutOutputCallAsync) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; @@ -1595,6 +1625,8 @@ TEST(NodeTest, ServiceWithoutOutputCallAsync) /// \brief Make an asynchronous service call using lambdas. TEST(NodeTest, ServiceCallAsyncLambda) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); std::function @@ -1633,6 +1665,8 @@ TEST(NodeTest, ServiceCallAsyncLambda) /// \brief Make an asynchronous service call without input using lambdas. TEST(NodeTest, ServiceCallWithoutInputAsyncLambda) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); std::function advCb = @@ -1666,6 +1700,8 @@ TEST(NodeTest, ServiceCallWithoutInputAsyncLambda) /// \lambdas. TEST(NodeTest, ServiceCallWithoutOutputAsyncLambda) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + bool executed = false; std::function advCb = @@ -1689,6 +1725,8 @@ TEST(NodeTest, ServiceCallWithoutOutputAsyncLambda) /// \brief Request multiple service calls at the same time. TEST(NodeTest, MultipleServiceCallAsync) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 req; @@ -1749,6 +1787,8 @@ TEST(NodeTest, MultipleServiceCallAsync) /// \brief Request multiple service calls without input at the same time. TEST(NodeTest, MultipleServiceCallWithoutInputAsync) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; @@ -1806,6 +1846,8 @@ TEST(NodeTest, MultipleServiceCallWithoutInputAsync) /// \ at the same time. TEST(NodeTest, MultipleServiceWithoutOutputCallAsync) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; @@ -1860,6 +1902,8 @@ TEST(NodeTest, MultipleServiceWithoutOutputCallAsync) /// \brief Make a synchronous service call. TEST(NodeTest, ServiceCallSync) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 req; @@ -1888,6 +1932,8 @@ TEST(NodeTest, ServiceCallSync) /// \brief Make a synchronous service call without input. TEST(NodeTest, ServiceCallWithoutInputSync) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 rep; @@ -1913,6 +1959,8 @@ TEST(NodeTest, ServiceCallWithoutInputSync) /// \brief Check a timeout in a synchronous service call. TEST(NodeTest, ServiceCallSyncTimeout) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 req; @@ -1946,6 +1994,8 @@ TEST(NodeTest, ServiceCallSyncTimeout) /// \brief Check a timeout in a synchronous service call without input. TEST(NodeTest, ServiceCallWithoutInputSyncTimeout) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 rep; @@ -2104,6 +2154,8 @@ TEST(NodeTest, PubSubWrongTypesOnPublish) /// the advertised types. TEST(NodeTest, PubSubWrongTypesOnSubscription) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Vector3d msgV; @@ -2136,6 +2188,8 @@ TEST(NodeTest, PubSubWrongTypesOnSubscription) /// advertised type). Check that only the good callback is executed. TEST(NodeTest, PubSubWrongTypesTwoSubscribers) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -2210,6 +2264,8 @@ TEST(NodeTest, SubThrottled) /// publishes at a throttled frequency . TEST(NodeTest, PubThrottled) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -2248,6 +2304,8 @@ TEST(NodeTest, PubThrottled) /// is set to true. TEST(NodeTest, IgnoreLocalMessages) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 msg; @@ -2283,6 +2341,8 @@ TEST(NodeTest, IgnoreLocalMessages) /// that the service call does not succeed. TEST(NodeTest, SrvRequestWrongReq) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Vector3d wrongReq; @@ -2314,6 +2374,8 @@ TEST(NodeTest, SrvRequestWrongReq) /// verify that the service call does not succeed. TEST(NodeTest, SrvRequestWrongRep) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 req; @@ -2343,6 +2405,8 @@ TEST(NodeTest, SrvRequestWrongRep) /// should verify that the service call does not succeed. TEST(NodeTest, SrvWithoutInputRequestWrongRep) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Vector3d wrongRep; @@ -2370,6 +2434,8 @@ TEST(NodeTest, SrvWithoutInputRequestWrongRep) /// are used. TEST(NodeTest, SrvTwoRequestsOneWrong) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 req; @@ -2405,6 +2471,8 @@ TEST(NodeTest, SrvTwoRequestsOneWrong) /// are used. TEST(NodeTest, SrvWithoutInputTwoRequestsOneWrong) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 goodRep; @@ -2435,6 +2503,8 @@ TEST(NodeTest, SrvWithoutInputTwoRequestsOneWrong) /// verifies that TopicList() returns the list of all the topics advertised. TEST(NodeTest, TopicList) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics; transport::Node node1; transport::Node node2; @@ -2465,6 +2535,8 @@ TEST(NodeTest, TopicList) /// Topic remapping is enabled. TEST(NodeTest, TopicListRemap) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector topics; transport::NodeOptions nodeOptions; nodeOptions.AddTopicRemap(g_topic, g_topic_remap); @@ -2484,6 +2556,8 @@ TEST(NodeTest, TopicListRemap) /// verifies that ServiceList() returns the list of all the services advertised. TEST(NodeTest, ServiceList) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector services; transport::Node node; @@ -2512,6 +2586,8 @@ TEST(NodeTest, ServiceList) /// Topic remapping is enabled. TEST(NodeTest, ServiceListRemap) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::vector services; transport::NodeOptions nodeOptions; nodeOptions.AddTopicRemap(g_topic, g_topic_remap); diff --git a/src/cmd/gz_TEST.cc b/src/cmd/gz_TEST.cc index 143d1819..172330b3 100644 --- a/src/cmd/gz_TEST.cc +++ b/src/cmd/gz_TEST.cc @@ -124,6 +124,8 @@ exec_with_retry(const std::vector &_args, /// \brief Check 'gz topic -l' running the advertiser on a different process. TEST(gzTest, GZ_UTILS_TEST_DISABLED_ON_MAC(TopicList)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto proc = gz::utils::Subprocess({ test_executables::kTwoProcsPublisher, g_partition}); @@ -139,6 +141,8 @@ TEST(gzTest, GZ_UTILS_TEST_DISABLED_ON_MAC(TopicList)) /// \brief Check 'gz topic -l' running a subscriber on a different process. TEST(gzTest, TopicListSub) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; node.Subscribe("/foo", topicCB); node.Subscribe("/bar", genericCb); @@ -162,6 +166,8 @@ TEST(gzTest, TopicListSub) /// \brief Check 'gz topic -i' running the advertiser on a different process. TEST(gzTest, TopicInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Launch a new publisher process that advertises a topic. auto proc = gz::utils::Subprocess({ test_executables::kTwoProcsPublisher, g_partition}); @@ -183,6 +189,8 @@ TEST(gzTest, TopicInfo) /// process. TEST(gzTest, ServiceList) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Launch a new responser process that advertises a service. auto proc = gz::utils::Subprocess({ test_executables::kTwoProcsSrvCallReplier, g_partition}); @@ -199,6 +207,8 @@ TEST(gzTest, ServiceList) /// \brief Check 'gz service -i' running the advertiser on a different process. TEST(gzTest, ServiceInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Launch a new responser process that advertises a service. auto proc = gz::utils::Subprocess( {test_executables::kTwoProcsSrvCallReplier, g_partition}); @@ -216,6 +226,8 @@ TEST(gzTest, ServiceInfo) /// \brief Check 'gz topic -l' running the advertiser on the same process. TEST(gzTest, TopicListSameProc) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; msgs::Vector3d msg; @@ -239,6 +251,8 @@ TEST(gzTest, TopicListSameProc) /// \brief Check 'gz topic -i' running the advertiser on the same process. TEST(gzTest, TopicInfoSameProc) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; msgs::Vector3d msg; @@ -263,6 +277,8 @@ TEST(gzTest, TopicInfoSameProc) /// \brief Check 'gz service -l' running the advertiser on the same process. TEST(gzTest, ServiceListSameProc) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; EXPECT_TRUE(node.Advertise("/foo", srvEcho)); @@ -278,6 +294,8 @@ TEST(gzTest, ServiceListSameProc) /// \brief Check 'gz service -i' running the advertiser on the same process. TEST(gzTest, ServiceInfoSameProc) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; EXPECT_TRUE(node.Advertise("/foo", srvEcho)); @@ -294,6 +312,8 @@ TEST(gzTest, ServiceInfoSameProc) /// \brief Check 'gz topic -p' to send a message. TEST(gzTest, TopicPublish) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; g_topicCBStr = "bad_value"; EXPECT_TRUE(node.Subscribe("/bar", topicCB)); @@ -346,6 +366,8 @@ TEST(gzTest, TopicPublish) /// \brief Check 'gz service -r' to request a two-way service. TEST(gzTest, ServiceRequest) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; // Advertise a service. @@ -370,6 +392,8 @@ TEST(gzTest, ServiceRequest) /// \brief Check 'gz service -r' to request a two-way service without timeout. TEST(gzTest, ServiceRequestNoTimeout) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; // Advertise a service. @@ -393,6 +417,8 @@ TEST(gzTest, ServiceRequestNoTimeout) /// \brief Check 'gz service -r' to request a one-way service. TEST(gzTest, ServiceOnewayRequest) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + g_topicCBStr = "bad_value"; transport::Node node; @@ -416,6 +442,8 @@ TEST(gzTest, ServiceOnewayRequest) /// \brief Check 'gz service -r' to request a service without input args. TEST(gzTest, ServiceRequestNoInput) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Advertise a service. transport::Node node; std::string service = "/no_input"; @@ -433,6 +461,8 @@ TEST(gzTest, ServiceRequestNoInput) /// \brief Check 'gz topic -e' running the publisher on a separate process. TEST(gzTest, TopicEcho) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Launch a new publisher process that advertises a topic. auto proc = gz::utils::Subprocess( {test_executables::kTwoProcsPublisher, g_partition}); @@ -450,6 +480,8 @@ TEST(gzTest, TopicEcho) /// process. TEST(gzTest, TopicEchoNum) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Launch a new publisher process that advertises a topic. auto proc = gz::utils::Subprocess( {test_executables::kTwoProcsPublisher, g_partition}); @@ -484,6 +516,8 @@ TEST(gzTest, TopicEchoNum) /// consistent flags TEST(gzTest, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ServiceHelpVsCompletionFlags)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Flags in help message auto helpOutput = custom_exec_str({"service", "--help"}); @@ -517,6 +551,8 @@ TEST(gzTest, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ServiceHelpVsCompletionFlags)) /// consistent flags TEST(gzTest, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(TopicHelpVsCompletionFlags)) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + // Flags in help message auto helpOutput = custom_exec_str({"topic", "--help"}); diff --git a/src/cmd/gz_src_TEST.cc b/src/cmd/gz_src_TEST.cc index f4141aa3..27b12239 100644 --- a/src/cmd/gz_src_TEST.cc +++ b/src/cmd/gz_src_TEST.cc @@ -79,6 +79,8 @@ bool srvEcho(const msgs::Int32 &_req, msgs::Int32 &_rep) /// \brief Check cmdTopicInfo running the advertiser on a the same process. TEST(gzTest, cmdTopicInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::stringstream stdOutBuffer; std::stringstream stdErrBuffer; redirectIO(stdOutBuffer, stdErrBuffer); @@ -105,6 +107,8 @@ TEST(gzTest, cmdTopicInfo) /// \brief Check cmdServiceInfo running the advertiser on a the same process. TEST(gzTest, cmdServiceInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::stringstream stdOutBuffer; std::stringstream stdErrBuffer; redirectIO(stdOutBuffer, stdErrBuffer); @@ -129,6 +133,8 @@ TEST(gzTest, cmdServiceInfo) /// \brief Check cmdTopicPub running the advertiser on a the same process. TEST(gzTest, cmdTopicPub) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::stringstream stdOutBuffer; std::stringstream stdErrBuffer; redirectIO(stdOutBuffer, stdErrBuffer); @@ -157,6 +163,8 @@ TEST(gzTest, cmdTopicPub) /// \brief Check cmdServiceReq running the advertiser on a the same process. TEST(gzTest, cmdServiceReq) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::stringstream stdOutBuffer; std::stringstream stdErrBuffer; redirectIO(stdOutBuffer, stdErrBuffer); @@ -230,6 +238,8 @@ TEST(gzTest, cmdServiceReq) /// \brief Check cmdTopicEcho running the advertiser on a the same process. TEST(gzTest, cmdTopicEcho) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::stringstream stdOutBuffer; std::stringstream stdErrBuffer; redirectIO(stdOutBuffer, stdErrBuffer); @@ -252,6 +262,8 @@ TEST(gzTest, cmdTopicEcho) ///////////////////////////////////////////////// TEST(gzTest, cmdTopicEchoOutputFormats) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + std::stringstream stdOutBuffer; std::stringstream stdErrBuffer; redirectIO(stdOutBuffer, stdErrBuffer); diff --git a/test/integration/twoProcsPubSub.cc b/test/integration/twoProcsPubSub.cc index 5ac13b71..0740fc4a 100644 --- a/test/integration/twoProcsPubSub.cc +++ b/test/integration/twoProcsPubSub.cc @@ -107,6 +107,8 @@ void cbRaw(const char * /*_msgData*/, const size_t /*_size*/, /// node receives the message. TEST(twoProcPubSub, PubSubTwoProcsThreeNodes) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; auto pub = node.Advertise(g_topic); EXPECT_TRUE(pub); @@ -140,6 +142,8 @@ TEST(twoProcPubSub, PubSubTwoProcsThreeNodes) /// of Publish(~). TEST(twoProcPubSub, RawPubSubTwoProcsThreeNodes) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; auto pub = node.Advertise(g_topic); EXPECT_TRUE(pub); @@ -177,6 +181,8 @@ TEST(twoProcPubSub, RawPubSubTwoProcsThreeNodes) /// the advertised types. TEST(twoProcPubSub, PubSubWrongTypesOnSubscription) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsPublisher, partition}); @@ -198,6 +204,8 @@ TEST(twoProcPubSub, PubSubWrongTypesOnSubscription) /// \brief Same as above, but using a raw subscription. TEST(twoProcPubSub, PubRawSubWrongTypesOnSubscription) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsPublisher, partition}); @@ -224,6 +232,8 @@ TEST(twoProcPubSub, PubRawSubWrongTypesOnSubscription) /// (correct and generic). TEST(twoProcPubSub, PubSubWrongTypesTwoSubscribers) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsPublisher, partition}); @@ -257,6 +267,8 @@ TEST(twoProcPubSub, PubSubWrongTypesTwoSubscribers) /// callbacks are executed (correct and generic). TEST(twoProcPubSub, PubSubWrongTypesTwoRawSubscribers) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsPublisher, partition}); @@ -380,6 +392,8 @@ TEST(twoProcPubSub, PubThrottled) /// using a callback that accepts message information. TEST(twoProcPubSub, PubSubMessageInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsPublisher, partition}); reset(); @@ -402,6 +416,8 @@ TEST(twoProcPubSub, PubSubMessageInfo) /// available topics. TEST(twoProcPubSub, TopicList) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsPublisher, partition}); @@ -448,6 +464,8 @@ TEST(twoProcPubSub, TopicList) /// about the topic. TEST(twoProcPubSub, TopicInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsPublisher, partition}); @@ -484,6 +502,8 @@ TEST(twoProcPubSub, TopicInfo) /// check returns the correct result. TEST(twoProcPubSub, PubSubTwoProcsScopedPub) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; for (auto j = 0; j < 2; ++j) @@ -529,6 +549,8 @@ TEST(twoProcPubSub, PubSubTwoProcsScopedPub) /// After that check that only one remaining subscriber receives the message. TEST(twoProcPubSub, PubSubTwoProcsMixedSubscribers) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + transport::Node node; auto pub = node.Advertise(g_topic); EXPECT_TRUE(pub); diff --git a/test/integration/twoProcsSrvCall.cc b/test/integration/twoProcsSrvCall.cc index 422689b2..ff7bede5 100644 --- a/test/integration/twoProcsSrvCall.cc +++ b/test/integration/twoProcsSrvCall.cc @@ -104,6 +104,8 @@ void wrongResponse(const msgs::Vector3d &/*_rep*/, bool /*_result*/) /// advertises a service and the other requests a few service calls. TEST_F(twoProcSrvCall, SrvTwoProcs) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); msgs::Int32 req; @@ -148,6 +150,8 @@ TEST_F(twoProcSrvCall, SrvTwoProcs) /// that the service call does not succeed. TEST_F(twoProcSrvCall, SrvRequestWrongReq) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + msgs::Vector3d wrongReq; msgs::Int32 rep; bool result; @@ -178,6 +182,8 @@ TEST_F(twoProcSrvCall, SrvRequestWrongReq) /// verify that the service call does not succeed. TEST_F(twoProcSrvCall, SrvRequestWrongRep) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + msgs::Int32 req; msgs::Vector3d wrongRep; bool result; @@ -207,6 +213,8 @@ TEST_F(twoProcSrvCall, SrvRequestWrongRep) /// are used. TEST_F(twoProcSrvCall, SrvTwoRequestsOneWrong) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + msgs::Int32 req; msgs::Int32 goodRep; msgs::Vector3d badRep; @@ -244,6 +252,8 @@ TEST_F(twoProcSrvCall, SrvTwoRequestsOneWrong) /// of available services. TEST_F(twoProcSrvCall, ServiceList) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; @@ -287,6 +297,8 @@ TEST_F(twoProcSrvCall, ServiceList) /// information about the service. TEST_F(twoProcSrvCall, ServiceInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; diff --git a/test/integration/twoProcsSrvCallStress.cc b/test/integration/twoProcsSrvCallStress.cc index c6f2c9d1..483662c8 100644 --- a/test/integration/twoProcsSrvCallStress.cc +++ b/test/integration/twoProcsSrvCallStress.cc @@ -38,6 +38,8 @@ static std::string g_topic = "/foo"; // NOLINT(*) ////////////////////////////////////////////////// TEST(twoProcSrvCall, ThousandCalls) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsSrvCallReplierInc, partition}); diff --git a/test/integration/twoProcsSrvCallSync1.cc b/test/integration/twoProcsSrvCallSync1.cc index 32b8e9f3..92e006ac 100644 --- a/test/integration/twoProcsSrvCallSync1.cc +++ b/test/integration/twoProcsSrvCallSync1.cc @@ -43,6 +43,8 @@ static int data = 5; /// the timeout. TEST(twoProcSrvCallSync1, SrvTwoProcs) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsSrvCallReplier, partition}); diff --git a/test/integration/twoProcsSrvCallWithoutInput.cc b/test/integration/twoProcsSrvCallWithoutInput.cc index 447dd7ca..15be3976 100644 --- a/test/integration/twoProcsSrvCallWithoutInput.cc +++ b/test/integration/twoProcsSrvCallWithoutInput.cc @@ -107,6 +107,8 @@ void wrongResponse(const msgs::Vector3d &/*_rep*/, bool /*_result*/) /// calls. TEST_F(twoProcSrvCallWithoutInput, SrvTwoProcs) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; @@ -148,6 +150,8 @@ TEST_F(twoProcSrvCallWithoutInput, SrvTwoProcs) /// should verify that the service call does not succeed. TEST_F(twoProcSrvCallWithoutInput, SrvRequestWrongRep) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + msgs::Vector3d wrongRep; bool result; unsigned int timeout = 1000; @@ -174,6 +178,8 @@ TEST_F(twoProcSrvCallWithoutInput, SrvRequestWrongRep) /// are used. TEST_F(twoProcSrvCallWithoutInput, SrvTwoRequestsOneWrong) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + msgs::Int32 goodRep; msgs::Vector3d badRep; bool result; @@ -208,6 +214,8 @@ TEST_F(twoProcSrvCallWithoutInput, SrvTwoRequestsOneWrong) /// getting the list of available services. TEST_F(twoProcSrvCallWithoutInput, ServiceList) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; @@ -250,6 +258,8 @@ TEST_F(twoProcSrvCallWithoutInput, ServiceList) /// getting information about the service. TEST_F(twoProcSrvCallWithoutInput, ServiceInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; diff --git a/test/integration/twoProcsSrvCallWithoutInputStress.cc b/test/integration/twoProcsSrvCallWithoutInputStress.cc index 2acc7b77..901d364e 100644 --- a/test/integration/twoProcsSrvCallWithoutInputStress.cc +++ b/test/integration/twoProcsSrvCallWithoutInputStress.cc @@ -38,6 +38,8 @@ static std::string g_topic = "/foo"; // NOLINT(*) ////////////////////////////////////////////////// TEST(twoProcSrvCallWithoutInput, ThousandCalls) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsSrvCallWithoutInputReplierInc, g_partition}); diff --git a/test/integration/twoProcsSrvCallWithoutInputSync1.cc b/test/integration/twoProcsSrvCallWithoutInputSync1.cc index 118f1eff..b7057543 100644 --- a/test/integration/twoProcsSrvCallWithoutInputSync1.cc +++ b/test/integration/twoProcsSrvCallWithoutInputSync1.cc @@ -42,6 +42,8 @@ static std::string g_topic = "/foo"; // NOLINT(*) /// the timeout. TEST(twoProcSrvCallWithoutInputSync1, SrvTwoProcs) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsSrvCallWithoutInputReplier, g_partition}); diff --git a/test/integration/twoProcsSrvCallWithoutOutput.cc b/test/integration/twoProcsSrvCallWithoutOutput.cc index 81968b19..7b2088f7 100644 --- a/test/integration/twoProcsSrvCallWithoutOutput.cc +++ b/test/integration/twoProcsSrvCallWithoutOutput.cc @@ -88,6 +88,8 @@ void reset() /// verify that the service call does not succeed. TEST_F(twoProcSrvCallWithoutOutput, SrvRequestWrongReq) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + msgs::Vector3d wrongReq; wrongReq.set_x(1); @@ -112,6 +114,8 @@ TEST_F(twoProcSrvCallWithoutOutput, SrvRequestWrongReq) /// getting the list of available services. TEST_F(twoProcSrvCallWithoutOutput, ServiceList) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; @@ -154,6 +158,8 @@ TEST_F(twoProcSrvCallWithoutOutput, ServiceList) /// getting information about the service. TEST_F(twoProcSrvCallWithoutOutput, ServiceInfo) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + reset(); transport::Node node; diff --git a/test/integration/twoProcsSrvCallWithoutOutputStress.cc b/test/integration/twoProcsSrvCallWithoutOutputStress.cc index 3e8d6590..d913790d 100644 --- a/test/integration/twoProcsSrvCallWithoutOutputStress.cc +++ b/test/integration/twoProcsSrvCallWithoutOutputStress.cc @@ -38,6 +38,8 @@ static std::string g_topic = "/foo"; // NOLINT(*) ////////////////////////////////////////////////// TEST(twoProcSrvCallWithoutOuput, ThousandCalls) { + CHECK_UNSUPPORTED_IMPLEMENTATION("zenoh") + auto pi = gz::utils::Subprocess( {test_executables::kTwoProcsSrvCallWithoutOutputReplierInc, g_partition}); diff --git a/test/test_utils.hh b/test/test_utils.hh index ff611398..e31ab271 100644 --- a/test/test_utils.hh +++ b/test/test_utils.hh @@ -21,6 +21,9 @@ #include #include #include +#include + +#include "gz/transport/Helpers.hh" namespace testing { @@ -39,4 +42,11 @@ namespace testing } } // namespace testing +#define CHECK_UNSUPPORTED_IMPLEMENTATION(...) \ +if(std::unordered_set({__VA_ARGS__}).count(\ + gz::transport::getTransportImplementation()) != 0) \ + GTEST_SKIP() << "gz-transport implementation '" \ + << gz::transport::getTransportImplementation() << "' unsupported"; + + #endif // GZ_TRANSPORT_TEST_UTILS_HH_ From da600f20d888b7519d5eb48e39118532658e990a Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Mon, 12 May 2025 17:24:44 +0000 Subject: [PATCH 11/11] style Signed-off-by: Ian Chen --- python/test/pubSub_TEST.py | 1 - test/test_utils.hh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/python/test/pubSub_TEST.py b/python/test/pubSub_TEST.py index 000bf0e4..7f823a06 100644 --- a/python/test/pubSub_TEST.py +++ b/python/test/pubSub_TEST.py @@ -54,7 +54,6 @@ def tearDown(self): # Check that the publisher publishes a message of the appropriate type # but doesn't publish when the message is not the appropriate type. def test_publish_msg(self): - # if transport_implementation() == "zenoh": string_msg = StringMsg() string_msg.data = "Hello" self.assertTrue(self.pub.publish(self.vector3d_msg)) diff --git a/test/test_utils.hh b/test/test_utils.hh index e31ab271..b6e87753 100644 --- a/test/test_utils.hh +++ b/test/test_utils.hh @@ -43,7 +43,7 @@ namespace testing } // namespace testing #define CHECK_UNSUPPORTED_IMPLEMENTATION(...) \ -if(std::unordered_set({__VA_ARGS__}).count(\ +if (std::unordered_set({__VA_ARGS__}).count(\ gz::transport::getTransportImplementation()) != 0) \ GTEST_SKIP() << "gz-transport implementation '" \ << gz::transport::getTransportImplementation() << "' unsupported";