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

Completes integration tests for action client/server #331

Merged
merged 5 commits into from
Nov 29, 2018

Conversation

hidmic
Copy link
Contributor

@hidmic hidmic commented Nov 15, 2018

Closes #328. It builds on top of the work done for #323. At the end, this PR must included tests for:

@hidmic hidmic added the in progress Actively being worked on (Kanban column) label Nov 15, 2018
@hidmic hidmic changed the title [DO NOT MERGE] Improves test_action_communication [DO NOT MERGE] Completes integration tests for action client/server Nov 15, 2018
@hidmic hidmic changed the title [DO NOT MERGE] Completes integration tests for action client/server [DO NOT MERGE NOR REVIEW] Completes integration tests for action client/server Nov 15, 2018
@hidmic hidmic force-pushed the hidmic/complete-action-tests branch from 33bc503 to 9ab994e Compare November 16, 2018 19:13
hidmic and others added 2 commits November 22, 2018 11:14
Added action cancel test

Added action result communication test

Added action status communication test

Added action feedback communication test

Fix wrong return code in action client
@apojomovsky apojomovsky changed the title [DO NOT MERGE NOR REVIEW] Completes integration tests for action client/server Completes integration tests for action client/server Nov 26, 2018

bool is_goal_request_ready(false);
bool is_cancel_request_ready(false);
bool is_result_request_ready(false);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@apojomovsky here and everywhere else it applies, consider using {} instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

done!

num_services, // number_of_services
rcl_get_default_allocator());
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
rcl_reset_error();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@apojomovsky considering that above's pattern of wait set initialization repeats quite often for both server and client, I believe we can push out to SetUp() and Teardown() methods.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point, just did as suggested. thanks!

@jacobperron jacobperron self-requested a review November 27, 2018 17:31
ret = rcl_wait_set_fini(&wait_set);
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
rcl_reset_error();
EXPECT_EQ(this->is_goal_request_ready, true) << rcl_get_error_string().str;
Copy link
Member

Choose a reason for hiding this comment

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

Also, expect cancel and result requests are false.

Copy link
Contributor

Choose a reason for hiding this comment

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

done, thanks!

&this->is_status_ready,
&this->is_goal_response_ready,
&this->is_cancel_response_ready,
&this->is_result_response_ready);

EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
Copy link
Member

Choose a reason for hiding this comment

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

Also:

EXPECT_FALSE(this->is_feedback_ready);
EXPECT_FALSE(this->is_status_ready);
EXPECT_TRUE(this->is_goal_response_ready);
EXPECT_FALSE(this->is_cancel_response_ready);
EXPECT_FALSE(this->is_result_response_ready);

Copy link
Contributor

Choose a reason for hiding this comment

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

done, thanks!

@@ -275,8 +266,7 @@ TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_goal_c
}


TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_cancel_comm)
{
TEST_F(CLASSNAME(TestActionCommunication, RMW_IMPLEMENTATION), test_valid_cancel_comm) {
Copy link
Member

Choose a reason for hiding this comment

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

style nit: I think the brace should go on the next line, following the style guide for functions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oops, got confused about that. done, thanks!

ret = rcl_wait_set_fini(&wait_set);
&this->is_goal_request_ready,
&this->is_cancel_request_ready,
&this->is_result_request_ready);
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
Copy link
Member

Choose a reason for hiding this comment

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

Also,

EXPECT_FALSE(this->is_goal_request_ready);
EXPECT_TRUE(this->is_cancel_request_ready);
EXPECT_FALSE(this->is_result_request_ready);

Copy link
Contributor

Choose a reason for hiding this comment

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

done, thanks!

&this->is_status_ready,
&this->is_goal_response_ready,
&this->is_cancel_response_ready,
&this->is_result_response_ready);
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
Copy link
Member

Choose a reason for hiding this comment

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

Also,

EXPECT_FALSE(this->is_feedback_ready);
EXPECT_FALSE(this->is_status_ready);
EXPECT_FALSE(this->is_goal_response_ready);
EXPECT_TRUE(this->is_cancel_response_ready);
EXPECT_FALSE(this->is_result_response_ready);

Copy link
Contributor

Choose a reason for hiding this comment

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

done, thanks!

EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
rcl_reset_error();

ret = rcl_action_server_wait_set_get_entities_ready(
&wait_set,
&this->wait_set_server,
&this->action_server,
&is_goal_request_ready,
&is_cancel_request_ready,
&is_result_request_ready);
EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
Copy link
Member

Choose a reason for hiding this comment

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

Check ready flags for expected values.

Copy link
Contributor

Choose a reason for hiding this comment

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

done, thanks!

&this->is_status_ready,
&this->is_goal_response_ready,
&this->is_cancel_response_ready,
&this->is_result_response_ready);
Copy link
Member

Choose a reason for hiding this comment

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

Check ready flags for expected values.

Copy link
Contributor

Choose a reason for hiding this comment

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

done, thanks!

&this->is_status_ready,
&this->is_goal_response_ready,
&this->is_cancel_response_ready,
&this->is_result_response_ready);
Copy link
Member

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor

Choose a reason for hiding this comment

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

done, thanks!

&this->is_status_ready,
&this->is_goal_response_ready,
&this->is_cancel_response_ready,
&this->is_result_response_ready);
Copy link
Member

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor

Choose a reason for hiding this comment

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

done, thanks!

&this->num_clients_client,
&this->num_services_client);
ASSERT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
ret = rcl_wait_set_init(
Copy link
Member

Choose a reason for hiding this comment

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

Alternatively, the action wait set functions should support multiple clients/servers per wait set. i.e. we can put the action client and server into a single wait set. I'm fine leaving these tests using two wait sets though, I'll leave it up to you.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a good detail, I thought I needed individual wait sets here. Using a single one looks a lot cleaner, will simplify that now.

Copy link
Contributor

Choose a reason for hiding this comment

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

done!

@apojomovsky
Copy link
Contributor

Thanks for the review guys, just finished addressing your comments.
I'm working on tests to exercise the examples found here now.

Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

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

LGTM pending green CI

@apojomovsky
Copy link
Contributor

apojomovsky commented Nov 29, 2018

CI:

  • Linux: Build Status
  • Linux aarch64: Build Status
  • MacOS: Build Status
  • Windows: Build Status

@apojomovsky
Copy link
Contributor

CI is passing so I'll merge this one and send a separate PR with the tests that exercise the examples

@apojomovsky apojomovsky merged commit dfaa412 into master Nov 29, 2018
@tfoote tfoote removed the in progress Actively being worked on (Kanban column) label Nov 29, 2018
@dirk-thomas
Copy link
Member

The new test failed on one of the last nightly jobs: https://ci.ros2.org/view/nightly/job/nightly_linux-aarch64_debug/651/testReport/

Also do you still need the branch or can it be deleted?

@apojomovsky
Copy link
Contributor

Sorry for that @dirk-thomas , this seems to be related to using tight timeouts in the wait_sets, will send a fix for that shortly.
Regarding this branch, I'll take care of removing it after the fix gets merged.

@dirk-thomas
Copy link
Member

Please update these tests to actually check if they work for each rmw implementation. Currently they only test the default and won't allow is to catch regressions in any other typesupport.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants