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

Enable reuse of launch testing functionality #236

Merged
merged 4 commits into from
May 17, 2019
Merged

Conversation

hidmic
Copy link
Contributor

@hidmic hidmic commented May 15, 2019

Connected to ros2/ros_testing#1. This pull request enables reuse of the launch_test CLI and add_launch_test CMake macro functionality, to be leveraged by the ros2test and ros_testing packages.

Incidentally, a bug was found during the testing phase and thus this PR includes a fix for it, in it's own separate commit.

@hidmic hidmic added in progress Actively being worked on (Kanban column) in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels May 15, 2019
@@ -45,7 +45,7 @@ def _match(expected, actual):
return lambda expected, actual: expected in actual
elif hasattr(expected_output, 'search'):
return lambda expected, actual: (
expected.match(actual.replace(os.linesep, '\n')) is not None
expected.search(actual.replace(os.linesep, '\n')) is not None
Copy link
Contributor

@pbaughman pbaughman May 15, 2019

Choose a reason for hiding this comment

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

I encountered this same issue while trying to improve the test coverage on launch_testing. A simple test that catches this issue and prevents regression would be something like

def test_works_with_regex(self):                 
    assertInStdout(                              
        self.proc_output,                        
        re.compile(r'Called with arguments \S+'),
        'terminating_proc-2'                     
    )                                            

You can add it to the bottom of test_io_handler_and_assertions.py You'll also need to import re at the top

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good!

@hidmic hidmic requested a review from wjwwood May 16, 2019 19:58
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
…nStdout

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 merged commit 7329a3e into master May 17, 2019
@delete-merged-branch delete-merged-branch bot deleted the hidmic/add-ros2-testing branch May 17, 2019 04:10
@hidmic hidmic removed the in review Waiting for review (Kanban column) label May 17, 2019
jacobperron added a commit that referenced this pull request May 18, 2019
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.

None yet

3 participants