-
Notifications
You must be signed in to change notification settings - Fork 29
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
Send all stderr and stdout to the output channel when a DVC process fails #3857
Conversation
…wable) DVC processes
@@ -164,8 +164,8 @@ export class DvcRunner extends Disposable implements ICli { | |||
{ | |||
...baseEvent, | |||
duration: stopWatch.getElapsedTime(), | |||
exitCode, | |||
stderr | |||
errorOutput: stderr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[F] The runner and viewer show processes in the foreground so there is no change for these
@@ -180,8 +196,8 @@ export class Cli extends Disposable implements ICli { | |||
{ | |||
...baseEvent, | |||
duration, | |||
exitCode: cliError.exitCode, | |||
stderr: cliError.stderr | |||
errorOutput: all || cliError.stderr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[F] If we have captured a valid all string (length > 0) then we will use that, otherwise use the stderr from the generated error. I feel like this way there will always be something provided to the output channel
backgroundProcess.all?.on( | ||
'data', | ||
chunk => (all += transformChunkToString(chunk)) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be moved to a private function, or even a util (just because it's being duplicated from line 83)? That would also make sure this line is covered since line 83 is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did have this in a separate helper function but the string was not captured as expected and passed to the catch block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Thanks for taking this so quickly @mattseddon1 |
Code Climate has analyzed commit 3c8c9d1 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 91.6% (85% is the threshold). This pull request will bring the total coverage in the repository to 94.9%. View more on Code Climate. |
As discussed in the cross-team meeting this morning (cc @dberenbaum).
It is useful to send all of the stderr/stdout to the output channel when a DVC process fails. This PR makes the necessary updates.
Demo
Screen.Recording.2023-05-10.at.2.41.28.pm.mov