-
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
Explicit output format always outputs JSON but only on one machine #1173
Comments
Did you get any resolution to this? I'm seeing the same behaviour on my PC. I can get a "coverage.json" file to be created by using "/p:CollectCoverage=true", but all other coverlet related parameters don't seem to be respected: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=coverage.cobertura.xml In the above example, neither the output foramt is changed nor the output name. |
I've been messing with this for hours too. I get exactly the same as artoxian. set up a tiny project from a turorial and get coverage.json but never anythging else. |
@artoxian @jimdeane, the issue was fixed by the microsoft guys with sdk 7.0.101 that was released last week microsoft/vstest#4014. I just checked it with a repro from another related issue and it works fine. Please give it a try again. |
I'm closing this as the external issue was fixed and already released. Feel free to reopen. |
Issue Description
I am currently going open source with one of my projects and using/learning GitHub actions for the first time.
I am coming from Azure DevOps with a lot of experience with pipelines as well. During this process, I am at the point of generating code coverage reports that can be consumed by either Coveralls or CodeCov.
Once I got it all set up and building using my own hosted agents on my build server, I noticed that the report being generated is in the JSON format even though I explicitly used the
dotnet test
command to use the lcov format. I tried other formats as well but no matter what format I use, it generates it in JSON format.The next thing I tried is I manually tried to run the
dotnet test
command on the project in the build agent itself on my build server to see if I could get it work properly and of course it did not work, because I did not have the .NET SDK 5.0.x installed. So I manually installed the SDK so I could do some troubleshooting and attempted the command again. This time the command of course ran successfully, but I still had the same behavior as the agent itself and the coverage report was still in JSON format even though my command was explicitly using the lcov format.At this point I tried running the
dotnet test
command on my local dev machine and low and behold, it works just fine with no issue.I also tried this using a GitHub Hosted server instead of my server, and it still does not work.
Everything points to some kind of difference from the machines and that I am doing everything correctly.
Any guidance or help on this issue would be greatly appreciated. 🙂
Commands Used/Attempted:
dotnet test MyProject.csproj /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOuputFormat=lcov
and
dotnet test MyProject.csproj /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOuputFormat=cobertura
Workflow YAML Being Used:
Local Machine Environment
Personal Build Server Environment
GitHub Hosted Environment
Steps to reproduce
I suppose you could setup an agent on your local dev machine, setup one using the GitHub hosted server using
windows-latest
and then run thedotnet test
command on the dev machine pointed to the repo of the project.Expected Behavior
When running the
dotnet test
command with the proper code coverage parameters, the expected output format will be produced when it is a GitHub hosted server, a personal machine with a setup agent, or simply from the project on a local dev machine.Actual Behavior
dotnet test
command for project on local dev machine works just finedotnet test
command for project on personal build server with agent only generates JSON formatdotnet test
command using GitHub Hosted server only generates JSON formatThe text was updated successfully, but these errors were encountered: