Add pass_all_args attr to include tag#710
Conversation
4239a43 to
73a9430
Compare
|
Wow, this sounds amazing. Lots of |
There was a problem hiding this comment.
I don't see expectations for include_arg or if_test in the test file, even though they are set below.
There was a problem hiding this comment.
I'm only setting those (https://github.com/ros/ros_comm/blob/add_pass_all_args/tools/roslaunch/test/xml/test-arg-all.xml#L6-L7) because they're required in the included file, which I'm reusing from another test (https://github.com/ros/ros_comm/blob/add_pass_all_args/tools/roslaunch/test/xml/test-arg-include.xml#L4-L5), where they're used for a different testing purpose. I could test their values here, but I feel that that case (passing an arg that is required in an included file) is already covered by testing the value of the required arg.
|
Does the patch result in no exception being thrown in the following case anymore:
If that is the case I think it would be good to preserve the exception. |
|
Beside my previous comment the patch looks good to me (merge pending the decision into which ROS distro this and followup changes should be released). |
There was a problem hiding this comment.
this value "not_set" is the same as the upstream test-arg-include.xml. Should we use a different value here?
There was a problem hiding this comment.
I believe this would affect the test for /notall_optional/include_test/p2_test
|
I think this should work fine. |
|
@scpeters, your test case should work fine. Did you try it? |
|
No, I didn't test it. Sorry for the noise. |
|
Sorry I didn't understand @dirk-thomas 's comment, but now I do. |
|
@dirk-thomas, I understand the motivation behind your desire to have that exception behavior, and I would go further to say that it would be nice to always throw an exception in the case that the parent launch file explicitly sets an arg while including a file that sets the same arg constant, whether or not That is, ideally, it would only be legal to attempt to pass an arg to a child that sets the same arg constant in the case that the passing is implicit, via However, I don't see a way to implement that behavior without making intrusive changes into how roslaunch passes arguments from parent to child. We'd need to carry with each argument how it was set (implicitly via For future reference, I added a test that checks for that exception behavior, commented out for now: https://github.com/ros/ros_comm/blob/add_pass_all_args/tools/roslaunch/test/unit/test_xmlloader.py#L1040-L1053. It is very good that you brought up this point, as I found a nasty bug while investigating the question, and added more tests as a result: https://github.com/ros/ros_comm/blob/add_pass_all_args/tools/roslaunch/test/unit/test_xmlloader.py#L1020-L1037. |
|
Test passed. |
|
@ros/ros_team Please review and state your opinion to merge this into Indigo and Jade. |
|
Having written it, I can't review it, but I vote to merge into both distros. It's a new feature that has no effect unless explicitly enabled, and I feel confident in both the characterization of the behavior and the coverage of the test suite. However, I can appreciate the general stability argument for Indigo, in which case we can just put it in Jade. |
|
Result from today: merge to indigo and jade. |
|
Some tests failed. Are those flaky tests? Can the builds be re-triggered? |
|
The two failing roswtf tests are due to ros/catkin#777 and will pass once that fix is available in a released catkin package. If there are more failing tests that is likely due to the patch. |
|
@ros-pull-request-builder retest this please |
b9ab84f to
0fa7e49
Compare
|
And squashed. |
Add pass_all_args attr to include tag
|
@gerkey Please update the ROS wiki in the near future to document this new argument and comment here with a link to the diff. |
|
Docs updated! |
|
Thank you. I added the version number to it in case anyone wants to check: http://wiki.ros.org/action/diff/roslaunch/XML/include?action=diff&rev1=6&rev2=7 |
|
Awesome, thanks. I wanted to do that, but didn't know which version it would appear in. |
Add pass_all_args attr to include tag
Add a new attribute,
pass_all_args, to theincludetag. It's a bool, with default of false. E.g.:If false, then nothing changes from existing behavior.
If true, then all args set in the current context are added to the child context that is created for processing the included file. You can do this instead of explicitly listing each argument that you want to pass down.
Notes on behavior when
pass_all_args="true":<arg>tag explicitly passes down an argument that is also set in the parent, then that explicit value overrides.