Publish test file .TRX to .XML on jenkins

4,040 views
Skip to first unread message

ok999

unread,
Feb 8, 2016, 12:19:24 PM2/8/16
to Jenkins Users
hey guys, 
The unit test & integration test stages in the pipeline for a .net app, returns the .trx file as a result. I know that there is a plugin called "Publish MSTEST test result report". But i dont know how to use this in a pipeline. For a regular individual job, i can just create a job and point to the .trx file, that way the result is published on the jenkins console. 

Question: Have anyone done this in a pipeline? (Publishing a .trx file on jenkins as a stage in the pipeline) 

I came accross this blog. And so downloaded the "msxsl.exe" and used the same file (mstest-to-junit_withOutput.xsl) to test initially. 

This file "mstest-to-junit_withOutput.xsl" doesnt come with the plugin as quoted below from the blog

"You can find this file in your Jenkins home folder (if you have MSTest plugin installed): 
…\Jenkins\plugins\mstest\WEB-INF\classes\hudson\plugins\mstest\mstest-to-junit.xsl"

I inserted a windows batch in the pipeline, like so 

stage name: 'Publish test result', concurrency: 1
 bat 'C:\\bin\\msxsl.exe TestResult.trx "C:\\Jenkins\\plugins\\mstest\\WEB-INF\\mstest-to-junit_withOutput.xsl" -o %cd%\\Build-%BUILD_NUMBER%\\JUnitLikeResultsOutputFile1.xml'

The stage executes and returns the output .xml file, but i don't see it on the jenkins console. It only exist in the filesystem. 


Thanks in advance!
 

ok999

unread,
Feb 8, 2016, 10:29:44 PM2/8/16
to Jenkins Users
Ok there was an option to publish in the drop down of the pipeline configuration

Fernando Urkijo

unread,
Apr 19, 2017, 10:15:42 AM4/19/17
to Jenkins Users
Can you please tell me where is that drop down? don't see it anywhere
Reply all
Reply to author
Forward
0 new messages