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

Add the ability to assert in stdout or stderr. #378

Merged
merged 5 commits into from Feb 28, 2020
Merged

Conversation

clalancette
Copy link
Contributor

Since we are switching the underlying logging to be stderr,
this is going to be important for tests. This commit
refactors assertInStdout() to be assertInStream(), which
takes in the stream to be asserted on. It then recreates
assertInStdout() on top of that, and adds in assertInStderr().

It also changes assertWaitFor() to wait on the stderr stream
by default.

Signed-off-by: Chris Lalancette clalancette@openrobotics.org

This goes along with ros2/rcutils#196

Copy link
Contributor

@hidmic hidmic left a comment

Choose a reason for hiding this comment

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

LGTM pending green CI

Copy link
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

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

lgtm

Since we are switching the underlying logging to be stderr,
this is going to be important for tests.  This commit
refactors assertInStdout() to be assertInStream(), which
takes in the stream to be asserted on.  It then recreates
assertInStdout() on top of that, and adds in assertInStderr().

It also changes assertWaitFor() to wait on the stderr stream
by default.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Once we backport this to Eloquent, this will allow users to
write tests that work in both Eloquent and newer releases.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
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