2

How can I get the code coverage for XUnit tests on the TFS for ASP.NET Core? I don't quite find any good information on the internet.

Any help?

Stefan
  • 1,590
  • 3
  • 18
  • 33
  • Which build are you using? XAML build or Vnext build? – PatrickLu-MSFT Nov 23 '16 at 14:41
  • I use Vnext build – Stefan Nov 23 '16 at 18:01
  • 1
    My company has had success using [OpenCover](https://github.com/OpenCover/opencover) running over .NET Core applications by making our source projects .NET Platform Standard compliant and then running the tests on a Windows CI server using the traditional .NET Framework. It looks like OpenCover can be ran from TFS, so that would be a way to accomplish this. I wrote up a detailed answer on how to accomplish it here: http://stackoverflow.com/a/39324025/735679 – Technetium Nov 23 '16 at 18:10

1 Answers1

0

For now, the default code coverage option it's only support with VS test. To get this with XUnit tests, you may have to use 3-party tool to achieve it. Such as using OpenCover like comment suggested to generated a xml report file.

And then either publish the xml test result to server or using the customization of the build summary to display the report. Detail steps you can refer the answer of Robert K in this question Display OpenCover results in TFS 2015 build Summary

Community
  • 1
  • 1
PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62