Output XML in JUnit format for CI?

Jun 25, 2012 at 5:13 AM
Edited Jun 25, 2012 at 5:14 AM

I would like to run my T.S.T tests on TeamCity or Jenkins for Continuous Integration. I believe the XML format currently produced by T.S.T is not consumable directly by TeamCity or Jenkins. Would I have to write an XSLT transformation to the ubiquitous JUnit format myself, or is there some such transformation available already? Or are there better way to reach my goal?

Jun 25, 2012 at 9:52 PM

I was able to to integrate TST tests with TeamCity by creating a version of Internal.RunOneSuiteInternal that prints out a few things around the test:

##teamcity[testStarted name=''TestNameGoesHere"]

And after the test either:

##teamcity[testFinished name=''TestNameGoesHere'' duration=''TestDurationGoesHere']

or

##teamcity[testFailed name=''TestNameGoesHere'']

depending if the test passed or failed.

I put that version of Internal.RunOneSuiteInternal in a different database along with modified versions of versions of the Runner.RunAll, Runner.RunSuite, Internal.RunTestSession and Internal.RunOneSuiteInternal that called it. The change was pretty easy. I've also added statement coverage statistics to that code. Clean up the code and getting some tests around it are one of my backburner projects.

Jun 26, 2012 at 4:07 AM

Thank you for your input! I can see that outputting TeamCity tags might work for TeamCity. However, I would like to have a more generic solution, and still believe that outputting in the generic JUnit XML format might be useful.

Jun 26, 2012 at 4:56 AM

If you work on the JUnit XML approach, please post here how that worked out for you.