-
Notifications
You must be signed in to change notification settings - Fork 386
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
Added logging to Coverage to help with debugging #341
Conversation
Exceptions were being swallowed and there was no indication why coverage didn't occur
Codecov Report
@@ Coverage Diff @@
## master #341 +/- ##
=========================================
- Coverage 87.1% 87.01% -0.1%
=========================================
Files 31 32 +1
Lines 3033 3050 +17
=========================================
+ Hits 2642 2654 +12
- Misses 391 396 +5 |
Codecov Report
@@ Coverage Diff @@
## master #341 +/- ##
==========================================
- Coverage 87.1% 86.99% -0.11%
==========================================
Files 31 31
Lines 3033 3092 +59
==========================================
+ Hits 2642 2690 +48
- Misses 391 402 +11 |
@derhally thanks a lot for this! Will take a look later today |
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.
Added some thoughts
Thank's a lot for help!
@derhally CI fail on |
Need to call BeginErrorReadLine and BeginOutputReadLine to start reading from those streams.
Remove message parameter from LogError with exception overload. Use the current foreground color when writing Info to console.
@tonerdo @derhally I did some tests I cannot show LogInformation/LogVerbose(https://docs.microsoft.com/en-us/visualstudio/msbuild/obtaining-build-logs-with-msbuild?view=vs-2017#verbosity-settings) message, Warning and Exception are ok, do you have same issue? |
So, I completely glossed over that I didn't switch CoverageResultTask to use the logger instead of console. I fixed that. It seems if you use "dotnet test" you need to specify |
For now I think we should use
and run build
I get only warning notification
I dunno why information is not shown @tonerdo do you have some idea? Maybe you've more experience with msbuild. |
An option is to use Console for the Logger.Information and still use the MSBuild logger for Error and Warning so that those go through the build system |
Could be a breaking change, because until today coverlet users expect console output with percentace, if we use build system log a "quiet" verbosity will suppress all output. |
@derhally are you able to complete this PR if not I could do last minor open changes with no problem(if you're busy, you already did a great work on this)! |
@MarcoRossignoli which track would you prefer, should the CovverageResultTask use
Either way, the behavior would be same as before. |
|
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.
@MarcoRossignoli totally agree. I'm thinking we could add a |
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.
Thank you @derhally!
Seems that for now we can use The worst part is that we get output also for others, but better than nothing for now. |
There was no indication why coverage didn't occur because the exception occurring inside Coverage class was being swallowed.
I was missing an dependency and had no way of knowing that. This should help.