Skip to content
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

Adapt to '--ros-args ... [--]'-based ROS args extraction #52

Merged
merged 3 commits into from
Aug 7, 2019

Conversation

hidmic
Copy link
Contributor

@hidmic hidmic commented Aug 5, 2019

Precisely what the title says. Connected to ros2/rcl#477.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
@hidmic hidmic force-pushed the hidmic/ros-args-extraction branch from 1945644 to 31a4b53 Compare August 5, 2019 19:14
@hidmic hidmic merged commit 7e4f431 into master Aug 7, 2019
@delete-merged-branch delete-merged-branch bot deleted the hidmic/ros-args-extraction branch August 7, 2019 15:58
@@ -82,7 +82,5 @@ def test_push_ros_namespace(config):
node_namespace=config.node_ns,
)
node._perform_substitutions(lc)
expected_cmd_len = 2 if config.expected_ns is not None else 1
assert expected_cmd_len == len(node.cmd)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should have been updated to:

    expected_cmd_len = 3 if config.expected_ns is not None else 2
    assert expected_cmd_len == len(node.cmd)

Checking that __ns:=/ is not added when the expanded namespace is '' is important.

Copy link
Contributor Author

@hidmic hidmic Aug 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is that the original test was incorrect, as node.cmd substitutions are not resolved by node._perform_substitutions().

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The len of the list is the same before and after performing the substitutions, so it was ok correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The len of the list is the same before and after performing the substitutions

That is a result of the current implementation, and thus not guaranteed nor enforced by the API.

Checking that __ns:=/ is not added when the expanded namespace is '' is important.

I agree with this, but the former test was not adequate for said purpose. We can change either launch_ros.actions.Node implementation or the test itself to query the fully resolved cmd instead of counting substitutions and expecting them to be right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants