Publishing unit test results without TFS  
Author Message
Andy D





PostPosted: Visual Studio Performance Tools (Profiler), Publishing unit test results without TFS Top

Hi, I want to publish some unit test results to a system testing team without the use of TFS. I've recently moved over from a java project were all junit test results were published to system test in a junit report. This is idea for my organisation. Here the system test team are totally separated from development so TFS is not an option, and they will only accept code into system test if similar junit style unit test reports can be provided ! I really don't want to have to use NAnt and NUnit2Report, so am hoping there’s another option...



Visual Studio Team System10  
 
 
dhopton MSFT





PostPosted: Visual Studio Performance Tools (Profiler), Publishing unit test results without TFS Top

Well, there is nothing today, and I dont think we have any plans to change this in the future -- with TFS you get a huge range of things that publishing the results is more than just reporting. Linking with Work Items, assment of a build through BVTs at build time, lots of things like that.

I understand you problem, but right now your only solution is to roll your own by parsing the TRX file format (which is non-Schema'd XML).

Sorry :(



 
 
Andy D





PostPosted: Visual Studio Performance Tools (Profiler), Publishing unit test results without TFS Top

This is disapointing for us as TFS is not an option at this stage, we already have global processes in place for builds/ work items etc which will take years to change.

I'm really impressed with the unit test and code coverage, so it's a real shame no method to export the results in a format other then trx is/will be included in the product. If anyone has written a trx parsing routine, please pass on ! Thanks.


 
 
Beth Massi





PostPosted: Visual Studio Performance Tools (Profiler), Publishing unit test results without TFS Top

I think it's just a matter of creating the right XSLT for what you want. I'm also looking for a starter template. If I find/roll one I'll post it back here.
 
 
Beth Massi





PostPosted: Visual Studio Performance Tools (Profiler), Publishing unit test results without TFS Top

Here's a simple template that will display the results of the .trx file:

< xml version="1.0" encoding="utf-8" >

<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:param name="today"></xsl:param>

<xsl:param name="results"></xsl:param>

<xsl:param name="pass" select="10"/>

<xsl:param name="fail" select="1"/>

<xsl:template match="/">

<html>

<body style="font-family:Verdana; font-size:10pt">

<h1>Test Results Summary</h1>

<table style="font-family:Verdana; font-size:10pt">

<tr>

<td><b>Run Date/Time</b></td>

<td><xsl:value-of select="$today"/></td>

</tr>

<tr>

<td><b>Results File</b></td>

<td><xsl:value-of select="$results"/></td>

</tr>

</table>

<a href="coverage.htm">Coverage Summary</a>

<xsl:call-template name="summary" />

<xsl:call-template name="details" />

</body>

</html>

</xsl:template>

<xsl:template name="summary">

<h3>Test Summary</h3>

<table style="width:640;border:1px solid black;font-family:Verdana; font-size:10pt">

<tr>

<td style="font-weight:bold">Total</td>

<td style="font-weight:bold">Failed</td>

<td style="font-weight:bold">Passed</td>

<td style="font-weight:bold">Inconclusive</td>

</tr>

<tr>

<td ><xsl:value-of select="count(//UnitTestResult/outcome/value__)"/></td>

<td style="background-color:pink;"><xsl:value-of select="count(//UnitTestResult/outcome/value__[.=$fail])"/></td>

<td style="background-color:lightgreen;"><xsl:value-of select="count(//UnitTestResult/outcome/value__[.=$pass])"/></td>

<td style="background-color:yellow;"><xsl:value-of select="count(//UnitTestResult/outcome/value__[.!=$pass and .!=$fail])"/></td>

</tr>

</table>

</xsl:template>

<xsl:template name="details">

<h3>Unit Test Results</h3>

<table style="width:640;border:1px solid black;font-family:Verdana; font-size:10pt;">

<tr>

<td style="font-weight:bold">Test Name</td>

<td style="font-weight:bold">Result</td>

</tr>

<xsl:for-each select="//UnitTestResult">

<tr>

<xsl:attribute name="style">

<xsl:choose>

<xsl:when test="number(outcome/value__ = $fail)">background-color:pink;</xsl:when>

<xsl:when test="number(outcome/value__ = $pass)">background-color:lightgreen;</xsl:when>

<xsl:otherwise>background-color:yellow;</xsl:otherwise>

</xsl:choose>

</xsl:attribute>

<td>

<xsl:value-of select="testName"/>

</td>

<td>

<xsl:choose>

<xsl:when test="number(outcome/value__ = $fail)">FAILED</xsl:when>

<xsl:when test="number(outcome/value__ = $pass)">Passed</xsl:when>

<xsl:otherwise>Inconclusive</xsl:otherwise>

</xsl:choose>

</td>

</tr>

</xsl:for-each>

</table>

</xsl:template>

</xsl:stylesheet>


 
 
bubblez





PostPosted: Visual Studio Performance Tools (Profiler), Publishing unit test results without TFS Top

hi all
i was told to solve the same problem. as i found this thread the rest was easy ;) thanks for the given xslt. my extended template is made up of it and i added some useful functionality and improved the markup.
I had some problems with the datetime convertion between javascript Date object and DateTime in .Net. Still i'm not able to use the TestRun/finishTime value, instead i had to use the endTime of the last UnitTestResult element. The problem is that the timestamps in the TestRun element doesn't use the same 0-Date. In UnitTestResult the base for the timestamps is 1.1.0001 as usual in .net. But does anyone now how to figure out the dates in the TestRun section

here you can see the template:
http://bubblez.ambitiouslemon.com/upload/viewTestResults.xslt (actually not up to date, but good enough)

 
 
bubblez





PostPosted: Visual Studio Performance Tools (Profiler), Publishing unit test results without TFS Top

can't anybody tell my why the timestamp in the Tests/TestRun/result/runInfoList/_items/element/timestamp/dateData is

1. 19 digits long
2. can not be converted with the same routine as Tests/TestRun/result/startTime/dateData

i really can not figure out how to manage these other timestamps, and i'd really be appreciated to know it...


 
 
Necromancer





PostPosted: Visual Studio Performance Tools (Profiler), Publishing unit test results without TFS Top

Does anyone have a webtest trx xsl parser out there I've been working on one but its been slow going.

thanks


 
 
dhopton MSFT





PostPosted: Visual Studio Performance Tools (Profiler), Publishing unit test results without TFS Top

Bubblez: I believe it's a TickCount, not a DateTime.

 
 
MatthewVincent





PostPosted: Visual Studio Performance Tools (Profiler), Publishing unit test results without TFS Top

Still wondering if there is a webtest trx xsl parser out there This would be infinitely helpful.
 
 
Gilmorenator





PostPosted: Visual Studio Performance Tools (Profiler), Publishing unit test results without TFS Top

Hi bubblez,

Thanks for the XSL file....

I'm having a small problem with it and can't figure it out and believe me i've tried all day...

I get the following error 'null'is null or not an object

Any ideas on a solution for this one would be awesome!

Cheers

Dave