launch_ros icon indicating copy to clipboard operation
launch_ros copied to clipboard

Unit tests for composition actions

Open sloretz opened this issue 5 years ago • 10 comments

This is the start of unit tests for composition. It depends on #8, so if you'd like to run locally make a branch that merges this branch and #8 .

Issues to resolve:

  1. How to make launch_test test_launch_ros/test/rostest/composition.test.py part of the test suite in a pure python package?
  2. Add log_level to ComposableNodeDescription
  3. Edit: resolved by #16 LaunchComposableNodes returns actions to be executed when the container emits the event OnProcessStart, but that means they won't trigger if the container process is already started. At the moment composable nodes launching only works via the composable_node_descriptions on the container action
  4. How to handle failures to launch nodes? Should emit an event so other launch actions can do something if a node fails to launch
  5. How to unload nodes? Should emit an event with the node unique_id so it's possible to make an unload action

sloretz avatar Apr 16 '19 23:04 sloretz

@sloretz #8 just got merged, mind to check if this is still working and put it on review (or not)?

hidmic avatar Apr 30 '19 22:04 hidmic

@hidmic The test passes running with:

launch_test src/ros2/launch_ros/test_launch_ros/test/rostest/composition.test.py

This isn't ready to be merged as the test is not run with colcon test --packages-select test_launch_ros. I'm not sure how to make a launch test part of the test suite for a pure python package. Is there a pytest plugin for launch-test? If not, a quick alternative would be a test file that called launch_test using subprocess.

sloretz avatar May 01 '19 00:05 sloretz

That's a good point, we don't have a tool for that atm. I've filed an issue https://github.com/ros2/launch/issues/237.

hidmic avatar May 01 '19 00:05 hidmic

@sloretz with https://github.com/ros2/launch/pull/236 now we can call launch_test from Python code to some extent.

hidmic avatar May 15 '19 15:05 hidmic

@sloretz once https://github.com/ros2/launch/pull/312 goes in, we can have launch tests in pure Python packages.

hidmic avatar Aug 20 '19 20:08 hidmic

A few issues that may be relevant:

  • https://github.com/ros2/launch_ros/issues/107
  • https://github.com/ros2/launch_ros/issues/108

jacobperron avatar Dec 17 '19 01:12 jacobperron

@sloretz I rebased this and I'm going to try and resurrect it in general, hope you don't mind.

wjwwood avatar Jan 18 '20 00:01 wjwwood

@wjwwood friendly ping

hidmic avatar Apr 04 '22 12:04 hidmic

I do not remember what I was going to do to "resurrect" these tests...

I'll re-review it, but I'm afraid after dropping the ball on this I've lost context.

wjwwood avatar Apr 04 '22 17:04 wjwwood

I'm guessing it needs to be updated to use the "launch tests from python packages" updates and/or changed to not use ready_fn in favor of pytest.

wjwwood avatar Apr 04 '22 17:04 wjwwood