I'm trying to get PartCover reports to generate correctly in TeamCity 5.0. When I click the Code Coverage tab in the build details, the reports are empty.
I'm using the sln2008 build agent and my PartCoverage settings are as follows:
Include Patterns:
[*]*
Report XSLT:
C:\Program Files\PartCover .NET 2.3\xslt\Report By Assembly.xslt=>ByAssembly.html
C:\Program Files\PartCover .NET 2.3\xslt\Report By Class.xslt=>ByClass.html
Bonus points if you can describe how to include those reports (or just the important parts) with the email that TeamCity sends for successful/failed builds. I would like to continue using the sln2008 build agent, if possible, and not a different build agent.
I had the same problem with the PartCover reports. So I have been trying to make it work right and I just discovered that the problem was the two XSLT files that come with the PartCover distribution.
I fixed these files and now everything is working fine for me:
report by assembly
report by class
I hope you find this useful. Also, any feedback about this files is welcomed, so we can provide the commutiy with correct files.
After playing a little bit with the fixed reports from yeyeyerman, I've finally created a completely new XSLT report, that also contains method-level coverage details and some other interesting stuff.
You can download the XSLT from my blog post here: http://gasparnagy.blogspot.com/2010/09/detailed-report-for-partcover-in.html
The problem may just be the xsl - I initially assumed that the files installed with partcover would work without modification, but it seems not to match the input file - the first significant line is
which is quite different from
The calculations for code size also appear to be wrong - it should be ./Method/pt rather than ./method/code/pt
Please check tests are running under x86. Make sure partcover is installed to the C:\Program Files\PartCover .NET 2.3\xslt on the build agent machine.
Please check build agent windows service is running under administrator user accound, but not under LOCAL SYSTEM account.
Just having run through this problem myself. I thought I solved the issue by using yeyeyerman's answer. Indeed, it will build, but reading the build report I could see the "report by assembly" couldn't be compiled. Reason was that "report by assembly" was missing 2 lines of xml at the very end:
Adding that to the end of the file solved the stylesheet compilation issue, as the tags weren't properly closed before :).