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

Skip some event tests on rmw_zenoh #1180

Merged
merged 5 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions rcl/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ function(test_target)
ament_add_gtest_test(test_events
TEST_NAME test_events${target_suffix}
ENV ${rmw_implementation_env_var}
TIMEOUT 120
)

ament_add_gtest_test(test_wait
Expand Down
42 changes: 42 additions & 0 deletions rcl/test/rcl/test_events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,17 @@ class TestEventFixture : public ::testing::TestWithParam<TestIncompatibleQosEven
// init publisher events
publisher_event = rcl_get_zero_initialized_event();
ret = rcl_publisher_event_init(&publisher_event, &publisher, pub_event_type);
if (ret == RCL_RET_UNSUPPORTED) {
GTEST_SKIP();
}
fujitatomoya marked this conversation as resolved.
Show resolved Hide resolved
ASSERT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;

// init subscription event
subscription_event = rcl_get_zero_initialized_event();
ret = rcl_subscription_event_init(&subscription_event, &subscription, sub_event_type);
if (ret == RCL_RET_UNSUPPORTED) {
GTEST_SKIP();
}
ASSERT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
}

Expand Down Expand Up @@ -376,6 +382,10 @@ conditional_wait_for_msgs_and_events(
*/
TEST_F(TestEventFixture, test_pubsub_no_deadline_missed)
{
if (std::string(rmw_get_implementation_identifier()).find("rmw_zenoh_cpp") == 0) {
GTEST_SKIP();
}

setup_publisher_subscriber_and_events_and_assert_discovery(
RCL_PUBLISHER_OFFERED_DEADLINE_MISSED,
RCL_SUBSCRIPTION_REQUESTED_DEADLINE_MISSED);
Expand Down Expand Up @@ -443,6 +453,10 @@ TEST_F(TestEventFixture, test_pubsub_no_deadline_missed)
*/
TEST_F(TestEventFixture, test_pubsub_deadline_missed)
{
if (std::string(rmw_get_implementation_identifier()).find("rmw_zenoh_cpp") == 0) {
GTEST_SKIP();
}

setup_publisher_subscriber_and_events_and_assert_discovery(
RCL_PUBLISHER_OFFERED_DEADLINE_MISSED,
RCL_SUBSCRIPTION_REQUESTED_DEADLINE_MISSED);
Expand Down Expand Up @@ -518,6 +532,10 @@ TEST_F(TestEventFixture, test_pubsub_deadline_missed)
*/
TEST_F(TestEventFixture, test_pubsub_liveliness_kill_pub)
{
if (std::string(rmw_get_implementation_identifier()).find("rmw_zenoh_cpp") == 0) {
GTEST_SKIP();
}

setup_publisher_subscriber_and_events_and_assert_discovery(
RCL_PUBLISHER_LIVELINESS_LOST,
RCL_SUBSCRIPTION_LIVELINESS_CHANGED);
Expand Down Expand Up @@ -597,6 +615,10 @@ TEST_F(TestEventFixture, test_pubsub_liveliness_kill_pub)
*/
TEST_P(TestEventFixture, test_pubsub_incompatible_qos)
{
if (std::string(rmw_get_implementation_identifier()).find("rmw_zenoh_cpp") == 0) {
GTEST_SKIP();
}

const auto & input = GetParam();
const auto & qos_policy_kind = input.qos_policy_kind;
const auto & publisher_qos_profile = input.publisher_qos_profile;
Expand Down Expand Up @@ -707,6 +729,11 @@ TEST_F(TestEventFixture, test_event_is_valid)

rcl_ret_t ret = rcl_publisher_event_init(
&publisher_event_test, &publisher, RCL_PUBLISHER_OFFERED_DEADLINE_MISSED);

if (ret == RCL_RET_UNSUPPORTED) {
GTEST_SKIP();
}

ASSERT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
EXPECT_TRUE(rcl_event_is_valid(&publisher_event_test));

Expand Down Expand Up @@ -754,6 +781,10 @@ TEST_F(TestEventFixture, test_event_is_invalid) {
*/
TEST_F(TestEventFixture, test_sub_message_lost_event)
{
if (std::string(rmw_get_implementation_identifier()).find("rmw_zenoh_cpp") == 0) {
GTEST_SKIP();
}

const rmw_qos_profile_t subscription_qos_profile = default_qos_profile;

rcl_ret_t ret = setup_subscriber(subscription_qos_profile);
Expand Down Expand Up @@ -866,6 +897,10 @@ void event_callback(const void * user_data, size_t number_of_events)
*/
TEST_F(TestEventFixture, test_pub_matched_unmatched_event)
{
if (std::string(rmw_get_implementation_identifier()).find("rmw_zenoh_cpp") == 0) {
Copy link
Member

@Yadunund Yadunund Sep 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahcorde this event should we supported in rmw_zenoh.

GTEST_SKIP();
}

rcl_ret_t ret;

// Create one publisher
Expand Down Expand Up @@ -977,6 +1012,10 @@ TEST_F(TestEventFixture, test_pub_matched_unmatched_event)
*/
TEST_F(TestEventFixture, test_sub_matched_unmatched_event)
{
if (std::string(rmw_get_implementation_identifier()).find("rmw_zenoh_cpp") == 0) {
Copy link
Member

@Yadunund Yadunund Sep 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahcorde this event should we supported in rmw_zenoh.

GTEST_SKIP();
}

rcl_ret_t ret;

// Create one subscriber
Expand Down Expand Up @@ -1199,6 +1238,9 @@ TEST_F(TestEventFixture, test_sub_previous_matched_event)
// init subscriber event
rcl_event_t sub_matched_event = rcl_get_zero_initialized_event();
ret = rcl_subscription_event_init(&sub_matched_event, &subscription, RCL_SUBSCRIPTION_MATCHED);
if (ret == RCL_RET_UNSUPPORTED) {
GTEST_SKIP();
}
ASSERT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
{
Expand Down