-
Notifications
You must be signed in to change notification settings - Fork 50
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
Sloretz/test discovery #512
base: rolling
Are you sure you want to change the base?
Conversation
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
<!-- <depend>mininet</depend> TODO this rosdep key --> | ||
<depend>rclcpp</depend> | ||
<depend>test_msgs</depend> | ||
<depend>pytest</depend> |
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.
<depend>pytest</depend> | |
<depend>ament_cmake_pytest</depend> |
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.
Improved package.xml in 4df83da
ament_cmake_pytest
is a test_depend
, but pytest
is still a run depend for the tests that run as root
test_discovery/CMakeLists.txt
Outdated
find_package(ament_lint_auto REQUIRED) | ||
ament_lint_auto_find_test_dependencies() | ||
|
||
ament_add_pytest_test(test_discovery tests/test_discovery.py TIMEOUT 800) |
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.
find_package(ament_lint_auto REQUIRED) | |
ament_lint_auto_find_test_dependencies() | |
ament_add_pytest_test(test_discovery tests/test_discovery.py TIMEOUT 800) | |
find_package(ament_lint_auto REQUIRED) | |
ament_lint_auto_find_test_dependencies() | |
find_package(ament_cmake_pytest REQUIRED) | |
ament_add_pytest_test(test_discovery tests/test_discovery.py TIMEOUT 800) |
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.
Finding ament_cmake_pytest
should be part of ament_lint_auto_find_test_dependencies now that it's in the package.xml
in 4df83da
cmd = [] | ||
cmd.append('sudo') | ||
cmd.append(sys.executable) | ||
cmd.append('-m') | ||
cmd.append('pytest') | ||
cmd.append('-c') | ||
cmd.append(str(get_tests_dir() / 'conftest.py')) | ||
if args.select: | ||
cmd.append('-k') | ||
cmd.append(args.select) | ||
cmd.append(f'--rmws={":".join(rmw_implementations)}') | ||
cmd.append(f'--ros-workspaces={":".join(get_workspaces())}') | ||
cmd.append(str(get_tests_dir() / 'test_discovery.py')) |
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.
Nit
cmd = [] | |
cmd.append('sudo') | |
cmd.append(sys.executable) | |
cmd.append('-m') | |
cmd.append('pytest') | |
cmd.append('-c') | |
cmd.append(str(get_tests_dir() / 'conftest.py')) | |
if args.select: | |
cmd.append('-k') | |
cmd.append(args.select) | |
cmd.append(f'--rmws={":".join(rmw_implementations)}') | |
cmd.append(f'--ros-workspaces={":".join(get_workspaces())}') | |
cmd.append(str(get_tests_dir() / 'test_discovery.py')) | |
cmd = [ | |
'sudo', | |
sys.executable, | |
'-m', | |
'pytest', | |
'-c', | |
str(get_tests_dir() / 'conftest.py') | |
] | |
if args.select: | |
cmd.extend(['-k', args.select]) | |
cmd.extend([ | |
f'--rmws={":".join(rmw_implementations)}', | |
f'--ros-workspaces={":".join(get_workspaces())}', | |
str(get_tests_dir() / 'test_discovery.py' | |
]) |
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.
Using more lists and extend in 371ec23
auto end_time = clock->now() + rclcpp::Duration::from_seconds(kMaxDiscoveryTime); | ||
while (rclcpp::ok() && publisher->get_subscription_count() == 0) { | ||
if (clock->now() >= end_time) { | ||
return 0; |
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.
Maybe add a warning on timeout?
This pull request has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/ros-2-tsc-meeting-minutes-2023-02-16/29927/1 |
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
Signed-off-by: Shane Loretz <sloretz@google.com>
This pull request has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/proposal-restrict-dds-to-localhost-by-default/36018/4 |
Part of ros2/ros2#1359
This adds a new package
test_discovery
which tests the new discovery behavior. There are two kinds of tests: ones that run withcolcon test
, and ones that require being run manually because they require root access.The tests in
colcon test
use the host's networking, so I assume they could run on any platform, but they only test the "same host" case. The ones requiring root use mininet to test both the same host and different host cases.I'm sure this is missing rosdep key definitions.
Running non-root tests:
Running root tests
State as of 2023/02/14
non-root tests:
Root tests: