Publish test file .TRX to .XML on jenkins

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Publish test file .TRX to .XML on jenkins

niristotle okram
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!
 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/06e07dba-1dd3-47bf-ba64-e46cccb54c64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Publish test file .TRX to .XML on jenkins

niristotle okram
Ok there was an option to publish in the drop down of the pipeline configuration




On Monday, February 8, 2016 at 11:19:24 AM UTC-6, ok999 wrote:
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 "<a href="https://wiki.jenkins-ci.org/display/JENKINS/MSTest+Plugin" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fwiki.jenkins-ci.org%2Fdisplay%2FJENKINS%2FMSTest%2BPlugin\46sa\75D\46sntz\0751\46usg\75AFQjCNEE0eV91fyfPFpO8rZ6PUknEuzvZA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fwiki.jenkins-ci.org%2Fdisplay%2FJENKINS%2FMSTest%2BPlugin\46sa\75D\46sntz\0751\46usg\75AFQjCNEE0eV91fyfPFpO8rZ6PUknEuzvZA&#39;;return true;">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 <a href="https://testingisland.wordpress.com/2014/02/17/integrating-saucelabs-reports-with-mstest-and-jenkins/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Ftestingisland.wordpress.com%2F2014%2F02%2F17%2Fintegrating-saucelabs-reports-with-mstest-and-jenkins%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNEfKqRWMWsvhiETUWiV_Nzp4KHVAw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Ftestingisland.wordpress.com%2F2014%2F02%2F17%2Fintegrating-saucelabs-reports-with-mstest-and-jenkins%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNEfKqRWMWsvhiETUWiV_Nzp4KHVAw&#39;;return true;">blog. And so downloaded the "msxsl.exe" and used the same file (<a title="MSTest to JUnit with Console Output" href="https://dl.dropboxusercontent.com/u/17544582/TestingIsland/mstest-to-junit_withOutput.xsl" style="font-stretch:inherit;font-size:14px;line-height:21px;vertical-align:baseline;color:rgb(0,102,204)" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fdl.dropboxusercontent.com%2Fu%2F17544582%2FTestingIsland%2Fmstest-to-junit_withOutput.xsl\46sa\75D\46sntz\0751\46usg\75AFQjCNEUmnGPUmgtUJE5VkRVQUGZYiTJSQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fdl.dropboxusercontent.com%2Fu%2F17544582%2FTestingIsland%2Fmstest-to-junit_withOutput.xsl\46sa\75D\46sntz\0751\46usg\75AFQjCNEUmnGPUmgtUJE5VkRVQUGZYiTJSQ&#39;;return true;">mstest-to-junit_withOutput.xsl) to test initially. 

This file "<a title="MSTest to JUnit with Console Output" href="https://dl.dropboxusercontent.com/u/17544582/TestingIsland/mstest-to-junit_withOutput.xsl" style="font-stretch:inherit;font-size:14px;line-height:21px;vertical-align:baseline;color:rgb(0,102,204)" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fdl.dropboxusercontent.com%2Fu%2F17544582%2FTestingIsland%2Fmstest-to-junit_withOutput.xsl\46sa\75D\46sntz\0751\46usg\75AFQjCNEUmnGPUmgtUJE5VkRVQUGZYiTJSQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\75https%3A%2F%2Fdl.dropboxusercontent.com%2Fu%2F17544582%2FTestingIsland%2Fmstest-to-junit_withOutput.xsl\46sa\75D\46sntz\0751\46usg\75AFQjCNEUmnGPUmgtUJE5VkRVQUGZYiTJSQ&#39;;return true;">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!
 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ce7ef7e9-c26c-400d-8b01-36d4f8532092%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Publish test file .TRX to .XML on jenkins

Fernando Urkijo
Can you please tell me where is that drop down? don't see it anywhere

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/8f58775f-89da-42b6-9f51-d3ba086b25fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...