Conversation
|
New CI
|
mikaelarguedas
left a comment
There was a problem hiding this comment.
test logic looks good to me. A few nitpick comments and questions.
Question (sorry if it's obvious, I didn't follow closely the remapping implementation): Is it necessary to do everything with asyncio and coroutines ?
test_cli_remapping/package.xml
Outdated
|
|
||
| <buildtool_depend>ament_cmake_auto</buildtool_depend> | ||
|
|
||
| <exec_depend>test_msgs</exec_depend> |
There was a problem hiding this comment.
As this is a test package that doesnt install anything, I think this is not necessary
test_cli_remapping/package.xml
Outdated
|
|
||
| <build_depend>test_msgs</build_depend> | ||
| <build_depend>rclcpp</build_depend> | ||
| <build_depend>ament_cmake</build_depend> |
There was a problem hiding this comment.
Nit: alphabetical order, we usually put the buildtool_depend before the build_depends as well
test_cli_remapping/CMakeLists.txt
Outdated
|
|
||
| add_executable(name_maker_rclcpp | ||
| test/name_maker.cpp) | ||
| target_compile_features(name_maker_rclcpp PRIVATE cxx_lambdas) |
There was a problem hiding this comment.
Something like it is. Alternatively I can change this to set_property(TARGET name_maker_rclcpp PROPERTY CXX_STANDARD 11)
There was a problem hiding this comment.
Would setting the the CMAKE_CXX_STANDARD globally like we do in the other packages do the job ?
system_tests/test_communication/CMakeLists.txt
Lines 5 to 8 in 84c035d
There was a problem hiding this comment.
It would, though I'm not a fan of setting things globally in cmake. I find it easier to debug stuff when I can see what is set on a specific target.
There was a problem hiding this comment.
I'm not a fan of setting things globally in cmake
In general I agree.
In this specific case, we do target and rely on c++14 globally in ROS 2 so I think that setting the standard globally should be done in all packages to avoid inconsistency or surprises.
There was a problem hiding this comment.
In this specific case, we do target and rely on c++14 globally in ROS 2 so I think that setting the standard globally should be done in all packages to avoid inconsistency or surprises.
Thats a good point for this package. I'll change it.
For downstream users I disagree about it meaning the standard should be set globally. Instead I think ament_target_depenencies() below should have given the target the standard required to include rclcpp headers. This would act on a package level like target_compile_features(... PUBLIC ...) does on a target level.
test_cli_remapping/package.xml
Outdated
| <license>Apache License 2.0</license> | ||
|
|
||
| <build_depend>test_msgs</build_depend> | ||
| <build_depend>rclcpp</build_depend> |
There was a problem hiding this comment.
If nothing these are needed only for testing they should only be test_depends and not build depends right ?
There was a problem hiding this comment.
Does test_depends say something is needed both tests are building and when tests are running?
There was a problem hiding this comment.
my understanding is that test_depends are dependencies needed for building and running the tests (things you don't need to have available to build or run the package).
From the REP: When building with testing enabled, the <test_depend> packages are available for configuring and building the tests as well as running them.
test_cli_remapping/CMakeLists.txt
Outdated
| project(test_cli_remapping) | ||
|
|
||
| find_package(ament_cmake_auto REQUIRED) | ||
| ament_auto_find_build_dependencies() |
There was a problem hiding this comment.
If the build dependencies are required to compile we should specify it here (as we should error at CMake configure time if a dependency is missing and not at compile time)
There was a problem hiding this comment.
I'm not sure what you mean. Where you looking for explicit find_package() calls for build dependencies? Added that in 8112882
|
|
||
| auto do_nothing = []( | ||
| const test_msgs::srv::Empty::Request::SharedPtr /*request*/, | ||
| test_msgs::srv::Empty::Response::SharedPtr /*response*/) -> void |
There was a problem hiding this comment.
I know this is used for testing only but I think misra prefers void casting unused parameters to arguments without a name
|
|
||
|
|
||
| def get_environment_variable(name): | ||
| """Get enironment variable or raise if it does not exist.""" |
| """Get enironment variable or raise if it does not exist.""" | ||
| path = os.getenv(name) | ||
| if not path: | ||
| raise EnvironmentError('Missing environment variable %r' % name) |
There was a problem hiding this comment.
Nit: quoting the env var printed.
Also why do we need %r here ?
There was a problem hiding this comment.
%r isn't necessary. I used it to make the output have quotes around name. "%s" would work too.
There was a problem hiding this comment.
Sounds good, I'm fine either way 👍
68fb36c to
1fe0d27
Compare
|
Thanks for the review @mikaelarguedas Remapping doesn't need coroutines. They are a consequence of ros2/launch#51. |
mikaelarguedas
left a comment
There was a problem hiding this comment.
lgtm, thanks for iterating
| def get_environment_variable(name): | ||
| """Get environment variable or raise if it does not exist.""" | ||
| path = os.getenv(name) | ||
| if not path: |
There was a problem hiding this comment.
Nit: pedantically this should be if path is None as some environment can exist and be set but not trigger the if (like an empty string). In the context of this test, it may be more appropriate to expect valid paths and check for path existence rather than empty string or None
|
The tests introduced in this PR are failing on the Windows debug nightly: https://ci.ros2.org/view/nightly/job/nightly_win_deb/903/ |
Adds a new package
test_cli_remappingthat checks if command line remapping arguments passed to a process result in changes to the names it uses.