I´m trying to configure MSTest build plugin on jenkins, but I´m getting the following error:
Path To MSTest.exe: mstest.exe Result file was not found so no action has been taken. file:/C:/Program%20Files%20(x86)/Jenkins/jobs/SoftwrenchvNext/workspace/TestResult.trx FATAL: null java.lang.NullPointerException at org.jenkinsci.plugins.MsTestBuilder.perform(MsTestBuilder.java:144)
The configuration simply specifies TestResult.trx as ResultFileName. This file is not versioned, and I expect it to be created on each build.
What needs to be done for that?
To configure a MSTest installation, go to Manage Jenkins -> Configure System (or Manage Jenkins -> Global Tool Configuration in Jenkins 2.8, possibly earlier) and add a MSTest installation. Name is mandatory. If Path to MSTest is left blank, the default is MSTest.exe. MSTestRunner can be used as a build step.
Jenkins provides an out of box functionality for Junit, and provides a host of plugins for unit testing for other technologies, an example being MSTest for . Net Unit tests. If you go to the link https://wiki.jenkins-ci.org/display/JENKINS/xUnit+Plugin it will give the list of Unit Testing plugins available.
The MSTest plugin analyzes the test execution reports (TRX) files generated by mstest and vstest. console. These files include a test execution summary, and detailed data about what happened during the tests execution.
This plugin publishes test results of an execution of a testing tool in Jenkins.
After some investigation I was able to get MSTest to work in Jenkins by doing the following:
Select Manage Jenkins
From within the Manage Jenkins choose Configure System
In Configure System you will need to find MSTest and Add your MSTest configuration
Enter your configuration as you see fit. Mine appears as follows:
Save the configuration and then go to your build project and configure the appropriate items like shown below:
One thing to note is that I did not follow any of the steps listed on the author's site because they didn't seem to make any sense to me. I did however read the code and spent some time digging and realized that the missing piece was in the Configure System page of Jenkins.
Cheers!
I too had this exact same error message!
My recommendation is to replace the "Run unit tests with MSTest" step. with an "Execute Windows batch command" step. This worked for me.
Command
del TestResults.trx "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\MSTest.exe" /testcontainer:Example.Tests\bin\Debug\Example.Tests.dll /resultsfile:TestResults.trx
Using this technique you may still use the "Publish MSTest test result report" step specifying...
Test report TRX file
TestResults.trx
Good luck!
Also, you can "simulate" the "Continue on failed tests" functionality with an "EXIT" call, seen below.
del TestResults.trx "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\MSTest.exe" /testcontainer:Example.Tests\bin\Debug\Example.Tests.dll /resultsfile:TestResults.trx /nologo EXIT /B 0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With