Capture stdout/stderr for shed_diff and shed_update XUnit reports#344
Capture stdout/stderr for shed_diff and shed_update XUnit reports#344
Conversation
|
(Rebasing + fixing tests now...) |
a80fb61 to
fecfb9e
Compare
|
Timestamps gone crazy, github is not displaying this well for me, but I tried refactoring a lot of the duplicated functionality out - hope this okay @erasche. Another upshot is that less of planemo.io needs to be exposed as well. Not sure it actually works yet though :). |
|
@jmchilton oh wow, that is absolutely ok. I definitely should've seen that easy place to refactor. I'll give it a test locally. |
|
@martenson did you have opinions on this? |
|
I am not experienced with stream handling so I cannot comment on the architecture but I like the functionality and simple approach. Thanks @erasche |
Capture stdout/stderr for shed_diff and shed_update XUnit reports
|
This is fine for now, the approach needs to be reworked to be thread safe someday (i.e. log the output instead of capturing it) if we want to build a planemo web app. Thanks a bunch @erasche. |
|
Agreed. I just didn't have the time/energies for a full rewrite of all echoing to logging. Will have to contribute that someday. A planemo web app? Are we building our own IDE? Neato. |
|
Less of an IDE than just a shed management app: #169 (comment) |
@jmchilton would you mind putting eyes to this if you have time? @martenson you might be interested in this as well.
The Good
XUnit reports for shed_update and shed_diff will now contain stdout/stderr, and make those available to browse in Jenkins
The Bad
Logs under
--report_xunitare no longer pretty colours. They're boring black and white. Seems like an acceptable loss since you gain awesome XUnit reports.If
--report_xunitis not specified, tests are still colourful.The Ugly
This PR provides a small class called
planemo.io.Capturingwhich lets you capture stdout/stderr for any function calls, and then process that data at your convenience. You don't have to rearchitect any of the existing infrastructure for logging user facing messages, you can just capture it and deal with it as you please. This code smells and it's pretty stinky. Instead of some way to handle message propagation properly and dispatching messages to handlers which care about them, we monkey patchsys.std*. I am not proud of this, but it solves the problem simply and quickly with very few changes.The whole of
cmd_shed_updateandcmd_shed_diffare probably in dire need of a refactoring