trx2html 0.7 crashes with "Not Runnable" result entries

May 16, 2011 at 9:03 PM

Not sure if this is a big problem (and certainly is a corner case in my scenario) but if results (trx) file contains "Not Runnable" entries, tr2xhtml crashes.

----------------

Processing vs2010 trx file
Unhandled Exception: System.NullReferenceException: Object reference not set toan instance of an object.   at trx2html.Parser.TrxParser.<Parse>b__c(<>f__AnonymousType3`2 <>h__TransparentIdentifier3)   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)   at trx2html.Parser.TestRunResult..ctor(String name, String runUser, IEnumerable`1 items)   at trx2html.Parser.TrxParser.Parse(String filePath)   at trx2html.ReportGenerator.GenerateReport(String fileName)   at trx2html.Program.Main(String[] args)

----------------

If you need to repro this, you can easily write a dummy function (or just some existing generic method) and prefix the function with [TestMethod] to get a Not Runnable entry in your trx file.

Another crash issue is even more corner-case (not related to the above) but the tool crashes because of unhandled XML exceptions:

- Unhandled Exception: System.Xml.XmlException: There are multiple root elements.

- Unhandled Exception: System.Xml.XmlException: Unexpected XML declaration. 

I did not want to start a new topic just for the second part. As for the first problem, it's not a huge problem for me personally but it's a bug nonetheless imho. Thanks for your work.

Coordinator
May 17, 2011 at 4:32 PM

I've checkin a patch to fix this