-
Notifications
You must be signed in to change notification settings - Fork 161
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
Remove unncecessary dependencies in tests #1114
Remove unncecessary dependencies in tests #1114
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would like to have a couple of confirmation for this, for me it seems to be better to keep these.
CC: @clalancette @cottsay
I think we should do something like this, but it will have to be more in-depth. In particular, we currently compile the same test multiple times, one for each RMW implementation we've found. But as you've noted, we don't actually need to do that; we just need to set So I think we should go further here and refactor this whole thing to only compile each of the tests once. There are some examples on how to do this in https://github.com/ros2/system_tests/blob/rolling/test_rclcpp/CMakeLists.txt . Not only will this improve our compilation times, it will also allow us to remove the last use of @cwecht are you willing to look at doing what I outlined above? |
75c0738
to
308585c
Compare
Yes, done :) |
308585c
to
ec44471
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cwecht Thanks for getting this going.
First of all, with these changes I'm seeing my build times cut in half. So that is a great start.
Second, since we are removing the RMW_IMPLEMENTATION at build-time, we can also remove a whole slew of code inside the tests themselves that deal with all of that. I've pushed a commit which makes all of those changes (9c5363e).
Third, I found that some of the tests that were being run before weren't being run in this implementation. So I fixed that as well (ec44471).
Finally, the one real problem I have with this change is the rcl_add_custom_gtest_test
. That is confusingly similar to the already existing rcl_add_custom_gtest
. Also, it doesn't seem to be gtest-specific; it ends up calling ament_add_test
, which doesn't really seem gtest
-specific. And that cmake function has a lot of options that seem to be unused (I only see ENV
and TIMEOUT
being used anywhere). So I'd like to rethink that function a bit, either by using existing functionality, or by simplifying it and calling it something else. Thoughts?
rcl_add_custom_gtest_test is a copy of ament_add_gtest_test. With ament_add_gtest_test the name of the test and the executable must be the same. With rcl_add_custom_gtest_test the can diverge. With respect of its current usage scenario rcl_add_custom_gtest_test is a bit to complex, yes. |
OK, I see. Thanks for the context. I think what I'd rather do here is to add a new optional argument ( If you are willing to do that, please open up a new PR to |
@clalancette I opted for adding a parameter TEST_NAME in ament/ament_cmake#492 instead of EXECUTABLE as seems to fit a bit better. |
@cwecht Can you please add a |
ec6f9e4
to
5a832b7
Compare
@clalancette done.
done. |
That last build failed because of an compilatin error in rclpy? |
Signed-off-by: Christopher Wecht <cwecht@mailbox.org>
Signed-off-by: Christopher Wecht <cwecht@mailbox.org>
Signed-off-by: Christopher Wecht <cwecht@mailbox.org>
Since we are just using the environment variables to test now, we don't need all of this superfluous infrastructure for generating different RMW implementations. Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
5a832b7
to
f3ac65f
Compare
Oh, right. This PR needs to be rebased due to the latest changes. I've gone ahead and done that. |
This PR removes AMENT_DEPENDENCIES to the respective RMW implementation in the RMW specific tests. I don't quite get why they have been there in the first place: having the RMW implementation mentioned as ament dependency should only result in linking against the RMW implementation, shouldn't it? For me this doesn't make sense, as the RMW implementation sould be loaded dynamically based on the RMW_IMPLEMENTATION environment variable.
With this PR the CMakeLists.txt gets quite a bit simple, too.