How do I get Team Build to show test results and c

2019-01-25 14:32发布

问题:

Has anybody had any success getting Team Build to show xUnit.net test results and code coverage in the build report? The MSBuild runner is running the tests just fine and the results are in the log file, but the test results and code coverage results areas of the build report say "No test result" and "No coverage result" respectively. Is Team Build looking for a certain location / format for the test results to be exported by the xUnit.net runner?

回答1:

TFS/TeamBuild definitely requires the test results in a particular format, they also need to be specifically published to TFS as well.

I'm currently looking at this problem for the Gallio test runner, and can offer two potential options:

  1. Try wrapping the xUnit tests inside the 'Generic Test' project type that VSTS offers - this is where MSTest executes the xUnit test runner.
  2. Come up with an XSLT transform (or similar) that can map the xUnit results to the MSTest schema (see http://www.codeplex.com/nunit4teambuild for an example of this approach for NUnit tests).


回答2:

See also http://jonnekats.wordpress.com/2009/05/07/integrate-xunit-tests-into-your-daily-team-build/