-
Notifications
You must be signed in to change notification settings - Fork 322
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
dotnet test output with color #641
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ba44c9b
let the console write color pass to vstask
smadala 6872442
Merge branch 'master' into console-color-2
smadala 02421c4
update tests
smadala 134bade
* Rename OutputUtilities to OutputExtensions
smadala 3730e7e
Add color to trx logger messages
smadala 02afb9c
Merge branch 'master' into console-color-2
smadala 67471ab
Add Output.Information overload method
smadala 1417bd7
Merge branches 'console-color-2' and 'console-color-2' of https://git…
smadala 20d70be
Nit fixes
smadala acc9ef3
Remove ConsoleColorHelper
smadala 3b0bcb3
Merge branch 'master' into console-color-2
smadala cd33e7a
Add Quite flag functionality for console logger
smadala a69d88d
Add test for Quiet option
smadala c107e02
Fix failing test
smadala ec40813
Merge branch 'master' into console-color-2
smadala 1055e65
Merge branch 'master' into console-color-2
smadala fbf1447
Remove Ignore for color tests
smadala f680f65
Merge branch 'console-color-2' of https://github.com/smadala/vstest i…
smadala 620d842
Make Console.ForegroundColor test Inconclusive if can't set Console.F…
smadala 21b9ea4
Merge branch 'master' into console-color-2
smadala File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,23 +33,15 @@ public int Execute() | |
FileName = hostExe, | ||
Arguments = string.Join(" ", this.allArgs), | ||
UseShellExecute = false, | ||
CreateNoWindow = true, | ||
RedirectStandardError = true, | ||
RedirectStandardOutput = true | ||
}; | ||
|
||
Tracing.Trace("VSTest: Starting vstest.console..."); | ||
Tracing.Trace("VSTest: Arguments: " + processInfo.FileName + " " + processInfo.Arguments); | ||
|
||
using (var activeProcess = new Process { StartInfo = processInfo }) | ||
{ | ||
activeProcess.OutputDataReceived += (sender, args) => Console.WriteLine(args.Data); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good change 👍 |
||
activeProcess.ErrorDataReceived += (sender, args) => Console.WriteLine(args.Data); | ||
|
||
activeProcess.Start(); | ||
this.activeProcessId = activeProcess.Id; | ||
activeProcess.BeginOutputReadLine(); | ||
activeProcess.BeginErrorReadLine(); | ||
|
||
activeProcess.WaitForExit(); | ||
Tracing.Trace("VSTest: Exit code: " + activeProcess.ExitCode); | ||
|
57 changes: 0 additions & 57 deletions
57
src/Microsoft.TestPlatform.CoreUtilities/Output/ConsoleColorHelper.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What are the scenarios we have tried?
dotnet test
in cmd, powershell, bashdotnet test
from Process.CreateProcess of any appvstest.console
is called from VSTS task or a jenkins/travis or any CI systemWe should ensure that CI tasks that run as services (and thus not interactive) don't face any issues with this approach.
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.
Also try "dotnet watch test" and make sure the color flows all the way through.
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.
@codito
dotnet test
working fine for above three scenarios. No color is displaying fordotnet test
on VSTS task (same behavior asdotnet build
).@shanselman Yes,
dotnet watch test
displaying colored output.