The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Feature #12673

There should be a Result#output that allows access to combined stderr & stdout

Added by Justin Stoller about 2 years ago. Updated about 2 years ago.

Status:ClosedStart date:02/15/2012
Priority:NormalDue date:
Assignee:Dominic Maraglia% Done:

0%

Category:Harness DSL
Target version:-
Patch:None Branch:
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

Pieter mentioned this to me in discussion.

I think he can give his use case much better description than I, Pieter?

History

#1 Updated by Pieter van de Bruggen about 2 years ago

Specifically, as it stands you can make the following assertions:

assert_equal 'Warning!\n', stderr
assert_equal 'Yup, I did stuff\n', stdout

but information on whether the end user will see this:

Warning!
Yup, I did stuff

or this:

Yup, I did stuff
Warning!

is completely unknowable. This problem only gets worse as the length of content output to STDOUT and STDERR grows. Cases where STDERR and STDOUT print interleaved content is another layer of frustration atop that.

Having the end result for both streams combined gives you the ability to make better assertions about order, via the transitive property (if lines ‘A’ and ‘C’ went to STDERR, and ‘B’ went to STDOUT, then if the unified output was ‘A\nB\nC\n’ I know that ‘A’ printed to STDERR before ‘B’, and ‘C’ printed to STDERR afterwards).

#2 Updated by Dominic Maraglia about 2 years ago

  • Status changed from Unreviewed to Needs More Information

I understand the use case for this addition though I wonder how many tests cases will need to check the ordering of STDOUT/STDERR output.

Do you suggest creating an entirely new output stream that replaces both STDERR and STDOUT? Or would we would be adding an additional stream, not eliminating STDOUT and STDERR, correct?

#3 Updated by Pieter van de Bruggen about 2 years ago

The expectation is that this would be in addition to STDOUT and STDERR.

#4 Updated by Justin Stoller about 2 years ago

  • Category set to Harness DSL
  • Status changed from Needs More Information to In Topic Branch Pending Review

Pull Request here: https://github.com/puppetlabs/puppet-acceptance/pull/147

#5 Updated by Justin Stoller about 2 years ago

  • Assignee changed from Pieter van de Bruggen to Dominic Maraglia

#6 Updated by Justin Stoller about 2 years ago

  • Status changed from In Topic Branch Pending Review to Closed

Merged here: https://github.com/puppetlabs/puppet-acceptance/commit/3be93a6e05a7a67fd40c7ddb5157dac4d304921c

Also available in: Atom PDF