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

Request to make MSTest Plugin compatible with the new workflow

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: mstest-plugin
    • Labels:
    • Environment:
      open-source Jenkins 1.647 as well as the Cloubees jenkins.
    • Similar Issues:

      Description

      The Pipeline's script generator doesn't show the MSTest plugin as one of the compatible plug-in as of now. As a workaround, i am using the below batch command to get the publish working from the workflow.

      [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 JUnitLikeResultsOutputFile1.xml'
      step([$class: 'JUnitResultArchiver', allowEmptyResults: true, testResults: 'JUnitLikeResultsOutputFile1.xml'])]

      But this involves, using the "msxsl.exe" and a .xls file for the transformation of the .trx file to .xls.

        Attachments

          Issue Links

            Activity

            Hide
            phillipjohnson Phillip Johnson added a comment - - edited

            +1 for this feature. Anyone else who stumbles on this, you can try converting the results to HTML using the trx2html tool and then using the Publish HTML plugin to create a report.

            Here's an example:

                        bat("start /D E:\\tools\\trx2html\\0.6 trx2html.exe somefile.trx")
                        publishHTML([
                            allowMissing: false,
                            alwaysLinkToLastBuild: false,
                            keepAll: false,
                            reportDir: 'TestResults',
                            reportFiles: "somefile.trx.htm",
                            reportName: 'My Test Results'])
            
            Show
            phillipjohnson Phillip Johnson added a comment - - edited +1 for this feature. Anyone else who stumbles on this, you can try converting the results to HTML using the trx2html tool and then using the Publish HTML plugin to create a report. Here's an example: bat("start /D E:\\tools\\trx2html\\0.6 trx2html.exe somefile.trx") publishHTML([ allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'TestResults', reportFiles: "somefile.trx.htm", reportName: 'My Test Results'])
            Hide
            jflord78 Jean Lord added a comment -

            We have been using the MSTest Plugin for a few years and have been very happy with it. We are moving over to using a pipeline and would like to be able to use the MSTest Plugin in that context. We will try the above mentioned workarounds, but it would be awesome if pipeline support was added to this plugin.

            Thank you

            Show
            jflord78 Jean Lord added a comment - We have been using the MSTest Plugin for a few years and have been very happy with it. We are moving over to using a pipeline and would like to be able to use the MSTest Plugin in that context. We will try the above mentioned workarounds, but it would be awesome if pipeline support was added to this plugin. Thank you
            Hide
            stautz85 Sebastian added a comment - - edited

            Warning: At my system the classnames are dropped and then there is no structure.

            My alternative is to use the xUnit-Plugin (actual 1.102) which has a MSTest parser.

            You can create code like this in the snippet generator:

            step([$class : 'XUnitPublisher', testTimeMargin: '3000', thresholdMode: 1,
                thresholds: [
                    [$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '0'],
                    [$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '']
             ],
                tools : [[$class: 'MSTestJunitHudsonTestType', deleteOutputFiles: true, failIfNotNew: false, pattern: "TestResults\\*.trx", skipNoTestFiles: false, stopProcessingIfError: true]]
            ])

             

            Show
            stautz85 Sebastian added a comment - - edited Warning: At my system the classnames are dropped and then there is no structure. My alternative is to use the xUnit-Plugin (actual 1.102) which has a MSTest parser. You can create code like this in the snippet generator: step([$class : 'XUnitPublisher' , testTimeMargin: '3000' , thresholdMode: 1, thresholds: [ [$class: 'FailedThreshold' , failureNewThreshold: '', failureThreshold: ' ', unstableNewThreshold: ' ', unstableThreshold: ' 0'], [$class: 'SkippedThreshold' , failureNewThreshold: '', failureThreshold: ' ', unstableNewThreshold: ' ', unstableThreshold: ' '] ], tools : [[$class: 'MSTestJunitHudsonTestType' , deleteOutputFiles: true , failIfNotNew: false , pattern: "TestResults\\*.trx" , skipNoTestFiles: false , stopProcessingIfError: true ]] ])  
            Hide
            nilleb Ivo Bellin Salarin added a comment -

            Dear MSTest plugin users, please read the following message: https://groups.google.com/forum/m/#!topic/jenkinsci-users/jhdBwKNMJzo
            And leave your opinion.
            See you in two weeks

            Show
            nilleb Ivo Bellin Salarin added a comment - Dear MSTest plugin users, please read the following message: https://groups.google.com/forum/m/#!topic/jenkinsci-users/jhdBwKNMJzo And leave your opinion. See you in two weeks
            Hide
            nilleb Ivo Bellin Salarin added a comment -

            For those using the xUnit plugin: I have proposed a pull request to the maintainer, so he will get a few bugfixes. If it does the job you're willing to do, that's great. But, I have to admit that your example wasn't clear, and if you want to elaborate, you're welcome.

            Show
            nilleb Ivo Bellin Salarin added a comment - For those using the xUnit plugin: I have proposed a pull request to the maintainer, so he will get a few bugfixes. If it does the job you're willing to do, that's great. But, I have to admit that your example wasn't clear, and if you want to elaborate, you're welcome.
            Hide
            stautz85 Sebastian added a comment -

            Everything is fine when i'm using your mstest plugin (0.19) directly (in a freestyle project).

            Sorry, i was too vague. The classname tag is empty in the generated junit files. Im using the newest xUnit plugin 1.102.

            Show
            stautz85 Sebastian added a comment - Everything is fine when i'm using your mstest plugin (0.19) directly (in a freestyle project). Sorry, i was too vague. The classname tag is empty in the generated junit files. Im using the newest xUnit plugin 1.102.
            Hide
            nilleb Ivo Bellin Salarin added a comment -

            So, you are saying that the xUnit plugin is missing the className. You would like to have the possibility to use MSTest 0.19 in a pipelined fashion.
            You have this two choices: wait two weeks for the official release of the MSTest plugin, OR test the alpha of that release.
            The third solution is to contact the xUnit plugin maintainer and ask him to accept the PR I opened, which brings him the functionality of MSTest 0.19.

            Show
            nilleb Ivo Bellin Salarin added a comment - So, you are saying that the xUnit plugin is missing the className. You would like to have the possibility to use MSTest 0.19 in a pipelined fashion. You have this two choices: wait two weeks for the official release of the MSTest plugin, OR test the alpha of that release. The third solution is to contact the xUnit plugin maintainer and ask him to accept the PR I opened, which brings him the functionality of MSTest 0.19.
            Hide
            stautz85 Sebastian added a comment -

            I'm fine with waiting for your update. Its not that urgent for me.

            As the last version of the xUnit plugin is from May 2016 (i'm having no information why), i would not hope for new version soon .

            Show
            stautz85 Sebastian added a comment - I'm fine with waiting for your update. Its not that urgent for me. As the last version of the xUnit plugin is from May 2016 (i'm having no information why), i would not hope for new version soon .
            Show
            nilleb Ivo Bellin Salarin added a comment - https://github.com/jenkinsci/mstest-plugin/releases/tag/mstest-0.20

              People

              Assignee:
              nilleb Ivo Bellin Salarin
              Reporter:
              okram999 Niristotle Okram
              Votes:
              13 Vote for this issue
              Watchers:
              17 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: