Skip to content

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

Merged
clalancette merged 5 commits intomasterfrom
log_to_stderr
Feb 28, 2020
Merged

Add the ability to assert in stdout or stderr.#378
clalancette merged 5 commits intomasterfrom
log_to_stderr

Conversation

@clalancette
Copy link
Copy Markdown
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
Copy Markdown

@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
Copy Markdown
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>
@clalancette clalancette merged commit 70f1c95 into master Feb 28, 2020
@delete-merged-branch delete-merged-branch bot deleted the log_to_stderr branch February 28, 2020 20:22
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.

3 participants