Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for rmw_connextdds #463

Merged
merged 5 commits into from
Mar 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 32 additions & 8 deletions test_communication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,32 @@ if(BUILD_TESTING)
set(rmw_implementation2_is_connext TRUE)
endif()

# TODO(asorbini) Skip tests between rmw_connext_cpp and rmw_connextdds
# since they are not meant to coexist (and used incompatible typecodes by default).
set(rmw_implementation1_is_connextdds FALSE)
if(rmw_implementation1 MATCHES "(.*)connextdds")
set(rmw_implementation1_is_connextdds TRUE)
endif()
set(rmw_implementation2_is_connextdds FALSE)
if(rmw_implementation2 MATCHES "(.*)connextdds")
set(rmw_implementation2_is_connextdds TRUE)
endif()

set(rmw_implementation1_is_connext_cpp FALSE)
if(rmw_implementation1 MATCHES "(.*)connext(.*)_cpp")
set(rmw_implementation1_is_connext_cpp TRUE)
endif()
set(rmw_implementation2_is_connext_cpp FALSE)
if(rmw_implementation2 MATCHES "(.*)connext(.*)_cpp")
set(rmw_implementation2_is_connext_cpp TRUE)
endif()

if((rmw_implementation1_is_connextdds AND rmw_implementation2_is_connext_cpp) OR
(rmw_implementation1_is_connext_cpp AND rmw_implementation2_is_connextdds)
)
set(SKIP_TEST "SKIP_TEST")
endif()

set(rmw_implementation1_is_cyclonedds FALSE)
set(rmw_implementation2_is_cyclonedds FALSE)
if(rmw_implementation1 MATCHES "(.*)cyclonedds(.*)")
Expand Down Expand Up @@ -249,14 +275,9 @@ if(BUILD_TESTING)

# TODO(mikaelarguedas) Simpler way to blacklist specific tests (e.g. regex matching)
# TODO different vendors can't talk to each other right now
if(NOT rmw_implementation1 STREQUAL rmw_implementation2 AND
(NOT(rmw_implementation1 MATCHES "(.*)connext(.*)" AND rmw_implementation2 MATCHES "(.*)connext(.*)"))
)
set(SKIP_TEST "SKIP_TEST")
endif()

# TODO(mikaelarguedas) connext_dynamic doesn't support C services for now
if((client_library1 STREQUAL "rclpy" AND rmw_implementation1 MATCHES "rmw_connext_dynamic_cpp") OR
# TODO(asorbini): Remove Connext exceptions once ros2/rmw_connext is deprecated.
if(NOT rmw_implementation1 STREQUAL rmw_implementation2 OR
(client_library1 STREQUAL "rclpy" AND rmw_implementation1 MATCHES "rmw_connext_dynamic_cpp") OR
(client_library2 STREQUAL "rclpy" AND rmw_implementation2 MATCHES "rmw_connext_dynamic_cpp")
)
set(SKIP_TEST "SKIP_TEST")
Expand Down Expand Up @@ -449,6 +470,7 @@ if(BUILD_TESTING)
endif()

macro(serialize)
# TODO(asorbini): Remove this exception once ros2/rmw_connext is deprecated.
set(SKIP_TEST "")
if(${rmw_implementation} STREQUAL "rmw_connext_dynamic_cpp")
message(STATUS "skipping serialize tests for ${rmw_implementation}")
Expand Down Expand Up @@ -481,11 +503,13 @@ if(BUILD_TESTING)
endmacro()

macro(pub_sub_serialized)
# TODO(asorbini): Remove this exception once ros2/rmw_connext is deprecated.
set(SKIP_TEST "")
if(${rmw_implementation} STREQUAL "rmw_connext_dynamic_cpp")
message(STATUS "skipping serialize tests for ${rmw_implementation}")
set(SKIP_TEST "SKIP_TEST")
endif()

set(target_name "test_publisher_subscriber_serialized${target}${target_suffix}")
ament_add_gtest(
${target_name} test/test_publisher_subscriber_serialized.cpp
Expand Down
2 changes: 1 addition & 1 deletion test_quality_of_service/test/test_deadline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ using namespace std::chrono_literals;
/// Test Deadline with a single publishing node and single subscriber node
TEST_F(QosRclcppTestFixture, test_deadline) {
int expected_number_of_events = 4;
// Bump deadline duration when testing against rmw_connext_cpp to
// Bump deadline duration when testing against rmw_connextdds to
// cope with the longer discovery times it entails.
const std::chrono::milliseconds deadline_duration =
this_rmw_implementation.find("connext") != std::string::npos ? 2s : 1s;
Expand Down
2 changes: 1 addition & 1 deletion test_quality_of_service/test/test_lifespan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using namespace std::chrono_literals;

TEST_F(QosRclcppTestFixture, test_lifespan) {
const int history = 2;
// Bump lifespan duration when testing against rmw_connext_cpp to
// Bump lifespan duration when testing against rmw_connextdds to
// cope with the longer discovery times it entails.
const std::chrono::milliseconds lifespan_duration =
this_rmw_implementation.find("connext") != std::string::npos ? 2s : 1s;
Expand Down
4 changes: 3 additions & 1 deletion test_security/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ if(BUILD_TESTING)
set(ENV_PATH "$ENV{PATH}")
file(TO_CMAKE_PATH "${ENV_PATH}" ENV_PATH)
set(TEST_PATH "${ENV_PATH}")
if(rmw_implementation STREQUAL "rmw_connext_cpp")
if(rmw_implementation MATCHES "rmw_connext(.*)")
# Connext 5.3.1 needs RTI's OpenSSL binaries (based on EOL 1.0.2) to be
# on the PATH at runtime as the system version of OpenSSL is not supported
set(RTI_BIN_PATH "$ENV{RTI_OPENSSL_BIN}")
Expand All @@ -269,9 +269,11 @@ if(BUILD_TESTING)
endif()

# TODO(jacobperron) Disable Connext on Windows until we fix issue with CI
# TODO(asorbini): Remove exceptions once ros2/rmw_connext is deprecated.
if(
(rmw_implementation STREQUAL "rmw_connext_cpp" AND NOT WIN32) OR
(rmw_implementation STREQUAL "rmw_connext_dynamic_cpp" AND NOT WIN32) OR
(rmw_implementation STREQUAL "rmw_connextdds" AND NOT WIN32) OR
rmw_implementation STREQUAL "rmw_fastrtps_cpp" OR
rmw_implementation STREQUAL "rmw_fastrtps_dynamic_cpp" OR
rmw_implementation STREQUAL "rmw_cyclonedds_cpp"
Expand Down