Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-8805

Problem with MSTest post build action with following message: "FATAL: No MSTest TRX test report files were found. Configuration error?"

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: mstest-plugin
    • Labels:
      None
    • Environment:
      Windows XP SP3; Jenkins installed local; MSTest with UnitTest in Visual Studio 2008, Version 9
    • Similar Issues:

      Description

      MSTest with UnitTests work without problems but in the After build step I activated the MSTest post build step and a .trx file is requested. The path is to the generated .trx file from the build but the build ends with the message
      "FATAL: No MSTest TRX test report files were found. Configuration error?"

      The file is definitly there, it was created!
      Also wildcards doesn't work in this case.

        Attachments

          Activity

          cld2403 Claudia Drabetz created issue -
          cld2403 Claudia Drabetz made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          cld2403 Claudia Drabetz made changes -
          Due Date 2011-02-21 00:00:00.0
          Hide
          robsimon robsimon added a comment - - edited

          1) It should silently ignore missing trx files

          2) wildcards as seen in JUnit

          **/build/test-reports/*.xml

          are preferable and would decrease the amount of missing a test result

          Show
          robsimon robsimon added a comment - - edited 1) It should silently ignore missing trx files 2) wildcards as seen in JUnit **/build/test-reports/*.xml are preferable and would decrease the amount of missing a test result
          Hide
          larsskj larsskj added a comment -

          It appears the plugin doesn't have the same notion of "workspace" as the rest of Hudson: On my Windows slaves, workspace is defined to be

          C:\Build

          and I check out a Subversion repository from <some-path>/trunk, the workspace will actually be

          C:\Build\trunk

          NAnt and other plugins seems to now that the workspace is the latter, whereas this plugin expects it to be the former...

          Modifying the path from 'TestResults.trx' to 'trunk\TestResults.trx' suddenly made everything work.

          Show
          larsskj larsskj added a comment - It appears the plugin doesn't have the same notion of "workspace" as the rest of Hudson: On my Windows slaves, workspace is defined to be C:\Build and I check out a Subversion repository from <some-path>/trunk, the workspace will actually be C:\Build\trunk NAnt and other plugins seems to now that the workspace is the latter, whereas this plugin expects it to be the former... Modifying the path from 'TestResults.trx' to 'trunk\TestResults.trx' suddenly made everything work.
          Hide
          gbois Gregory Boissinot added a comment -

          Maybe the xUnit plugin solves your problem.

          Show
          gbois Gregory Boissinot added a comment - Maybe the xUnit plugin solves your problem.
          Hide
          vishal_gupta Vishal Gupta added a comment -

          Under "Run unit test with MSTest" Result File Name path should be relative to .jenkins\workspace[job name]OR your .trx file should generate under .jenkins\workspace[job name] path.
          So under Publish MSTest test result reports we need to specify the path which is relative to .jenkins\workspace[job name].
          Example :
          Under "Run unit test with MSTest" Result File Name path = C:\Users[user_name]\.jenkins\workspace[job_name]\ResultMSTest.trx
          then your .trx will be generated at that path.
          Under "Publish MSTest test result report" = ResultMSTest.trx

          This will publish the result report !

          Show
          vishal_gupta Vishal Gupta added a comment - Under "Run unit test with MSTest" Result File Name path should be relative to .jenkins\workspace[job name]OR your .trx file should generate under .jenkins\workspace[job name] path. So under Publish MSTest test result reports we need to specify the path which is relative to .jenkins\workspace[job name]. Example : Under "Run unit test with MSTest" Result File Name path = C:\Users[user_name]\.jenkins\workspace[job_name]\ResultMSTest.trx then your .trx will be generated at that path. Under "Publish MSTest test result report" = ResultMSTest.trx This will publish the result report !
          Hide
          gopivinay gopivinay gande added a comment -

          I have some porblems displaying my .trx file here is my console script

          32 1/1 test(s) Passed
          20:53:32
          20:53:32 Summary
          20:53:32 -------
          20:53:32 Test Run Completed.
          20:53:32 Passed 1
          20:53:32 ---------
          20:53:32 Total 1
          20:53:32 Results file: F:\RequestManagement\Jenkins\jobs\NewTestJob2\workspace\trunk\build\TestOutput\results.trx
          20:53:32 Test Settings: Local
          20:53:34 ********************** The msbuild mstest task for this hudson job is finished *************************************
          20:53:34 Done Building Project "F:\RequestManagement\Jenkins\jobs\NewTestJob2\workspace\trunk\build\MasterBuildScript.proj" (UnitTest target(s)).
          20:53:34
          20:53:34 Build succeeded.
          20:53:34 0 Warning(s)
          20:53:34 0 Error(s)
          20:53:34
          20:53:34 Time Elapsed 00:00:39.24
          20:53:34 Processing tests results in file(s) results.trx
          20:53:34 FATAL: No MSTest test report files were found.
          20:53:34 FATAL: No MSTest TRX test report files were found. Configuration error?
          20:53:34 Build step 'Publish MSTest test result report' marked build as failure
          20:53:34 Finished: FAILURE

          Show
          gopivinay gopivinay gande added a comment - I have some porblems displaying my .trx file here is my console script 32 1/1 test(s) Passed 20:53:32 20:53:32 Summary 20:53:32 ------- 20:53:32 Test Run Completed. 20:53:32 Passed 1 20:53:32 --------- 20:53:32 Total 1 20:53:32 Results file: F:\RequestManagement\Jenkins\jobs\NewTestJob2\workspace\trunk\build\TestOutput\results.trx 20:53:32 Test Settings: Local 20:53:34 ********************** The msbuild mstest task for this hudson job is finished ************************************* 20:53:34 Done Building Project "F:\RequestManagement\Jenkins\jobs\NewTestJob2\workspace\trunk\build\MasterBuildScript.proj" (UnitTest target(s)). 20:53:34 20:53:34 Build succeeded. 20:53:34 0 Warning(s) 20:53:34 0 Error(s) 20:53:34 20:53:34 Time Elapsed 00:00:39.24 20:53:34 Processing tests results in file(s) results.trx 20:53:34 FATAL: No MSTest test report files were found. 20:53:34 FATAL: No MSTest TRX test report files were found. Configuration error? 20:53:34 Build step 'Publish MSTest test result report' marked build as failure 20:53:34 Finished: FAILURE
          Hide
          gopivinay gopivinay gande added a comment -

          I wanted to Display my results on the jenkins Dash Board ( Steps i follwed)
          1.configures and runned my test whcih created the Trx file
          2)added a plugin in post build actions called publish Mstest result report.

          Show
          gopivinay gopivinay gande added a comment - I wanted to Display my results on the jenkins Dash Board ( Steps i follwed) 1.configures and runned my test whcih created the Trx file 2)added a plugin in post build actions called publish Mstest result report.
          Hide
          vishal_gupta Vishal Gupta added a comment -

          What have have you provided in publish Mstest result report ??
          In your case it should be relative to your workspace.
          Example : publish Mstest result report : trunk\build\TestOutput\results.trx

          Show
          vishal_gupta Vishal Gupta added a comment - What have have you provided in publish Mstest result report ?? In your case it should be relative to your workspace. Example : publish Mstest result report : trunk\build\TestOutput\results.trx
          Hide
          gopivinay gopivinay gande added a comment -

          the plugin and here is configuration that i have used as shown

          Show
          gopivinay gopivinay gande added a comment - the plugin and here is configuration that i have used as shown
          gopivinay gopivinay gande made changes -
          Attachment screenshot-1.jpg [ 23468 ]
          Hide
          gopivinay gopivinay gande added a comment -

          I have attached you the trx file and folder generated .Here iam running web performance test.

          Show
          gopivinay gopivinay gande added a comment - I have attached you the trx file and folder generated .Here iam running web performance test.
          gopivinay gopivinay gande made changes -
          Attachment Files.zip [ 23469 ]
          Hide
          gopivinay gopivinay gande added a comment -

          I have attached the files and screen shot showing you the way i followed you to achive ( display the trx results to dashboard)

          1) added the plugin to publish
          2) trx file was generated and path was given as shown in screen shot
          this is the error that i get
          4 Time Elapsed 00:00:39.24
          20:53:34 Processing tests results in file(s) results.trx
          20:53:34 FATAL: No MSTest test report files were found.
          20:53:34 FATAL: No MSTest TRX test report files were found. Configuration error?
          20:53:34 Build step 'Publish MSTest test result report' marked build as failure
          20:53:34 Finished: FAILURE

          Can you please give me pointer or any alternative to achive this .

          Show
          gopivinay gopivinay gande added a comment - I have attached the files and screen shot showing you the way i followed you to achive ( display the trx results to dashboard) 1) added the plugin to publish 2) trx file was generated and path was given as shown in screen shot this is the error that i get 4 Time Elapsed 00:00:39.24 20:53:34 Processing tests results in file(s) results.trx 20:53:34 FATAL: No MSTest test report files were found. 20:53:34 FATAL: No MSTest TRX test report files were found. Configuration error? 20:53:34 Build step 'Publish MSTest test result report' marked build as failure 20:53:34 Finished: FAILURE Can you please give me pointer or any alternative to achive this .
          Hide
          vishal_gupta Vishal Gupta added a comment -

          As I mention earlier it should be :
          publish Mstest result report : trunk\build\TestOutput\results.trx

          "Path for result report should be relative to your workspace!".

          Show
          vishal_gupta Vishal Gupta added a comment - As I mention earlier it should be : publish Mstest result report : trunk\build\TestOutput\results.trx "Path for result report should be relative to your workspace!".
          Hide
          gopivinay gopivinay gande added a comment -

          Thanks Vishal ....It got passed through the step .BUt i coudn't see any results or any information from .trx

          17:07:57 Loading F:\RequestManagement\Jenkins\jobs\NewTestJob2\workspace\trunk\Hp.Rm.PropelWebTests\Deployment.testsettings...
          17:07:57 Loading F:\RequestManagement\Jenkins\jobs\NewTestJob2\workspace\trunk\Hp.Rm.PropelWebTests\Hp.Rm.PropelWebTests.vsmdi...
          17:07:58 Starting execution...
          17:10:02
          17:10:02 Results Top Level Tests
          17:10:02 ------- ---------------
          17:10:02 Passed (SampleTests/)f:\requestmanagement\jenkins\jobs\newtestjob2\workspace\trunk\hp.rm.propelwebtests\hp.rm.propelwebtests\servicecatalog\singletenant\webtest\loginlogout.webtest
          17:10:02 1/1 test(s) Passed
          17:10:02
          17:10:02 Summary
          17:10:02 -------
          17:10:02 Test Run Completed.
          17:10:02 Passed 1
          17:10:02 ---------
          17:10:02 Total 1
          17:10:02 Results file: F:\RequestManagement\Jenkins\jobs\NewTestJob2\workspace\trunk\build\TestOutput\results.trx
          17:10:02 Test Settings: Deployment
          17:10:02 ********************** The msbuild mstest task for this hudson job is finished *************************************
          17:10:02 Done Building Project "F:\RequestManagement\Jenkins\jobs\NewTestJob2\workspace\trunk\build\MasterBuildScript.proj" (UnitTest target(s)).
          17:10:02
          17:10:02 Build succeeded.
          17:10:02 0 Warning(s)
          17:10:02 0 Error(s)
          17:10:02
          17:10:02 Time Elapsed 00:02:06.02
          17:10:02 Processing tests results in file(s) trunk\build\TestOutput\results.trx
          17:10:02 trunk\build\TestOutput\results.trx
          17:10:02 Finished: SUCCESS

          how am i gonna see my Stats from the trx file on to jenkins Dash borad

          Show
          gopivinay gopivinay gande added a comment - Thanks Vishal ....It got passed through the step .BUt i coudn't see any results or any information from .trx 17:07:57 Loading F:\RequestManagement\Jenkins\jobs\NewTestJob2\workspace\trunk\Hp.Rm.PropelWebTests\Deployment.testsettings... 17:07:57 Loading F:\RequestManagement\Jenkins\jobs\NewTestJob2\workspace\trunk\Hp.Rm.PropelWebTests\Hp.Rm.PropelWebTests.vsmdi... 17:07:58 Starting execution... 17:10:02 17:10:02 Results Top Level Tests 17:10:02 ------- --------------- 17:10:02 Passed (SampleTests/)f:\requestmanagement\jenkins\jobs\newtestjob2\workspace\trunk\hp.rm.propelwebtests\hp.rm.propelwebtests\servicecatalog\singletenant\webtest\loginlogout.webtest 17:10:02 1/1 test(s) Passed 17:10:02 17:10:02 Summary 17:10:02 ------- 17:10:02 Test Run Completed. 17:10:02 Passed 1 17:10:02 --------- 17:10:02 Total 1 17:10:02 Results file: F:\RequestManagement\Jenkins\jobs\NewTestJob2\workspace\trunk\build\TestOutput\results.trx 17:10:02 Test Settings: Deployment 17:10:02 ********************** The msbuild mstest task for this hudson job is finished ************************************* 17:10:02 Done Building Project "F:\RequestManagement\Jenkins\jobs\NewTestJob2\workspace\trunk\build\MasterBuildScript.proj" (UnitTest target(s)). 17:10:02 17:10:02 Build succeeded. 17:10:02 0 Warning(s) 17:10:02 0 Error(s) 17:10:02 17:10:02 Time Elapsed 00:02:06.02 17:10:02 Processing tests results in file(s) trunk\build\TestOutput\results.trx 17:10:02 trunk\build\TestOutput\results.trx 17:10:02 Finished: SUCCESS how am i gonna see my Stats from the trx file on to jenkins Dash borad
          Hide
          jfaenomoto João Enomoto added a comment -

          Just pointing out that I had a similar log on my build and I got it solved:

          I'm running a local Jenkins server in Windows with a unique constructor on it, so no interactions with Jenkins slaves. My workspace was configure to output .trx on a hardcoded file path (something like 'C:\TestResults\') which was different from job's workspace.

          Looks like Jenkins can't access hardcoded paths, which is certainly a security measure to avoid access to system directories.

          The solution was use WORKSPACE placeholder variable to set in execution script (which was a command prompt) and setting plugin's TRX path to */.trx (which is every .trx file in job's workspace). That solved the problem.

          Show
          jfaenomoto João Enomoto added a comment - Just pointing out that I had a similar log on my build and I got it solved: I'm running a local Jenkins server in Windows with a unique constructor on it, so no interactions with Jenkins slaves. My workspace was configure to output .trx on a hardcoded file path (something like 'C:\TestResults\') which was different from job's workspace. Looks like Jenkins can't access hardcoded paths, which is certainly a security measure to avoid access to system directories. The solution was use WORKSPACE placeholder variable to set in execution script (which was a command prompt) and setting plugin's TRX path to * / .trx (which is every .trx file in job's workspace). That solved the problem.
          Hide
          jfaenomoto João Enomoto added a comment - - edited

          To ilustrate, I'm giving away my build example.

          Execute Windows command prompt:
          cd\
          cd TestResults\
          rm * -r
          rm "%WORKSPACE%\myresult.trx"

          cd \
          cd Release\
          mstest /testcontainer:"UnitTest.dll" /resultsfile:"%WORKSPACE%\myresult.trx"

          Publish MSTest test report:
          **/*.trx

          More on Jenkins environment variables: https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project

          Hope I could help.

          Show
          jfaenomoto João Enomoto added a comment - - edited To ilustrate, I'm giving away my build example. Execute Windows command prompt: cd\ cd TestResults\ rm * -r rm "%WORKSPACE%\myresult.trx" cd \ cd Release\ mstest /testcontainer:"UnitTest.dll" /resultsfile:"%WORKSPACE%\myresult.trx" Publish MSTest test report: ** / *.trx More on Jenkins environment variables: https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project Hope I could help.
          Hide
          nilleb Ivo Bellin Salarin added a comment -

          Since version 0.11, wildcards and ant fileset patterns are supported.
          Paths should be considered as relative to the workspace.

          Feel free to use jenkins well known variables.

          Show
          nilleb Ivo Bellin Salarin added a comment - Since version 0.11, wildcards and ant fileset patterns are supported. Paths should be considered as relative to the workspace. Feel free to use jenkins well known variables.
          nilleb Ivo Bellin Salarin made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 138949 ] JNJira + In-Review [ 188245 ]

            People

            • Assignee:
              cld2403 Claudia Drabetz
              Reporter:
              cld2403 Claudia Drabetz
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: