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

Workflow support for NUnit plugin

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: nunit-plugin
    • Labels:
    • Environment:
      Jenkins: 1.606, NUnit Plugin: 0.16
    • Similar Issues:

      Description

      Add support for the Workflow plugin by implementing the SimpleBuildStep. https://github.com/jenkinsci/workflow-plugin/blob/master/basic-steps/CORE-STEPS.md#adding-support-from-plugins

        Attachments

          Issue Links

            Activity

            Hide
            duemir Denys Digtiar added a comment -

            Pipeline support seems to be implemented in PR#11

            Show
            duemir Denys Digtiar added a comment - Pipeline support seems to be implemented in PR#11
            Hide
            kinow Bruno P. Kinoshita added a comment -

            merged a pull request for tap-plugin this weekend, adding pipeline support. Now looking at image-gallery, next one is nunit.

            Show
            kinow Bruno P. Kinoshita added a comment - merged a pull request for tap-plugin this weekend, adding pipeline support. Now looking at image-gallery, next one is nunit.
            Hide
            kinow Bruno P. Kinoshita added a comment -

            Pull request merged. Version 0.18 released.

            Show
            kinow Bruno P. Kinoshita added a comment - Pull request merged. Version 0.18 released.
            Hide
            sebgod Sebastian Godelet added a comment -

            Bruno P. Kinoshita, thanks for this , do you know if JENKINS-37136 is fixable in a similar fashion?

            Show
            sebgod Sebastian Godelet added a comment - Bruno P. Kinoshita , thanks for this , do you know if JENKINS-37136 is fixable in a similar fashion?
            Hide
            kinow Bruno P. Kinoshita added a comment -

            I think so Sebastian Godelet, though you better check with the plug-in maintainer of the git-chooser-alternative-plugin. By the way, the jenkins_release tweet bot tweeted NUnit 0.18, so I think you can try it already in a test bed server, and if that works, use nunit + workflow in production

            Show
            kinow Bruno P. Kinoshita added a comment - I think so Sebastian Godelet , though you better check with the plug-in maintainer of the git-chooser-alternative-plugin. By the way, the jenkins_release tweet bot tweeted NUnit 0.18, so I think you can try it already in a test bed server, and if that works, use nunit + workflow in production
            Hide
            sebgod Sebastian Godelet added a comment -

            Bruno P. Kinoshita This plugin update shouldn't require any Jenkins update (I'm running 2.9), right?

            Show
            sebgod Sebastian Godelet added a comment - Bruno P. Kinoshita This plugin update shouldn't require any Jenkins update (I'm running 2.9), right?
            Hide
            kinow Bruno P. Kinoshita added a comment -

            Not really. The minimum requirement for Jenkins, for the NUnit plug-in is 1.580.1 in pom.xml

            Show
            kinow Bruno P. Kinoshita added a comment - Not really. The minimum requirement for Jenkins, for the NUnit plug-in is 1.580.1 in pom.xml
            Hide
            hieber Thomas Hieber added a comment -

            Sounds really great, because I Need this function for my new workflow.
            But I am not able to find out, how to use this function because, when I try this in Snippet Generator,
            Sample Step: "Step: General Build Step"
            Build Step: "Publish NUnit test result Report"

            all I receive is:
            step <object of type hudson.plugins.nunit.NUnitPublisher>

            For other types of steps I get a resonable line like:
            step([$class: 'XUnitPublisher', testTimeMargin: '3000', thresholdMode: 1, thresholds: [[$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: ''], [$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '']]])

            At the Moment I have no idea, how I could add the "Publish NUnit test result Report" step. (There seems to be no other documentation then Snippet Generator, so I am lost here.)

            Show
            hieber Thomas Hieber added a comment - Sounds really great, because I Need this function for my new workflow. But I am not able to find out, how to use this function because, when I try this in Snippet Generator, Sample Step: "Step: General Build Step" Build Step: "Publish NUnit test result Report" all I receive is: step <object of type hudson.plugins.nunit.NUnitPublisher> For other types of steps I get a resonable line like: step([$class: 'XUnitPublisher', testTimeMargin: '3000', thresholdMode: 1, thresholds: [ [$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: ''] , [$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: ''] ]]) At the Moment I have no idea, how I could add the "Publish NUnit test result Report" step. (There seems to be no other documentation then Snippet Generator, so I am lost here.)
            Hide
            hieber Thomas Hieber added a comment -

            There seems to be no way to find out, how to use this plugin in a workflow. (see my other comment...)

            Show
            hieber Thomas Hieber added a comment - There seems to be no way to find out, how to use this plugin in a workflow. (see my other comment...)
            Hide
            sebgod Sebastian Godelet added a comment -

            Thomas Hieber, this is from the linked PR:

            I implemented the interface SimpleBuildStep to make it available for pipeline scripts.
            you can now include it inside your Jenkinsfile like:
            step([$class: 'NUnitPublisher', testResultsPattern: '*/TestResults/.xml', debug: false, keepJUnitReports: true, skipJUnitArchiver:false, failIfNoResults: true]) 
            
            Show
            sebgod Sebastian Godelet added a comment - Thomas Hieber , this is from the linked PR: I implemented the interface SimpleBuildStep to make it available for pipeline scripts. you can now include it inside your Jenkinsfile like: step([$class: 'NUnitPublisher' , testResultsPattern: '*/TestResults/.xml' , debug: false , keepJUnitReports: true , skipJUnitArchiver: false , failIfNoResults: true ])
            Hide
            sid_s Sid S added a comment - - edited

            Sebastian Godelet this is great. I did notice that if there is a single file, like "build\TestResult.xml" but if you set

            testResultPattern:'**\\TestResult.xml' 
            

            then you get 2x the test failures. For some reason it double counts. Is this a known issue?

            Show
            sid_s Sid S added a comment - - edited Sebastian Godelet this is great. I did notice that if there is a single file, like "build\TestResult.xml" but if you set testResultPattern: '**\\TestResult.xml' then you get 2x the test failures. For some reason it double counts. Is this a known issue?
            Hide
            slide_o_mix Alex Earl added a comment -

            Are you sure there are no other TestResult.xml files in the workspace?

            Show
            slide_o_mix Alex Earl added a comment - Are you sure there are no other TestResult.xml files in the workspace?
            Hide
            baraghu Raghavendra Bankapur added a comment -

            I too am getting error using this plugin. Below is the error I am seeing.

            Can anyone help?
            java.io.IOException: Could not transform the NUnit report. Please report this issue to the plugin author
            at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:71)
            at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:29)
            at hudson.FilePath.act(FilePath.java:996)
            at hudson.FilePath.act(FilePath.java:974)
            at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:286)
            at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:78)
            at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:65)
            at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
            at hudson.security.ACL.impersonate(ACL.java:221)
            at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
            at java.util.concurrent.FutureTask.run(Unknown Source)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at java.lang.Thread.run(Unknown Source)
            Caused by: org.xml.sax.SAXParseException; systemId: file:/D:/CodeFromJenkins/temporary-junit-reports/temp-junit.xml; lineNumber: 2; columnNumber: 3; Content is not allowed in prolog.
            at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
            at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
            at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
            at hudson.plugins.nunit.NUnitReportTransformer.splitJUnitFile(NUnitReportTransformer.java:102)
            at hudson.plugins.nunit.NUnitReportTransformer.transform(NUnitReportTransformer.java:72)
            at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:66)

            Show
            baraghu Raghavendra Bankapur added a comment - I too am getting error using this plugin. Below is the error I am seeing. Can anyone help? java.io.IOException: Could not transform the NUnit report. Please report this issue to the plugin author at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:71) at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:29) at hudson.FilePath.act(FilePath.java:996) at hudson.FilePath.act(FilePath.java:974) at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:286) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:78) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:65) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49) at hudson.security.ACL.impersonate(ACL.java:221) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.xml.sax.SAXParseException; systemId: file:/D:/CodeFromJenkins/temporary-junit-reports/temp-junit.xml ; lineNumber: 2; columnNumber: 3; Content is not allowed in prolog. at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(Unknown Source) at hudson.plugins.nunit.NUnitReportTransformer.splitJUnitFile(NUnitReportTransformer.java:102) at hudson.plugins.nunit.NUnitReportTransformer.transform(NUnitReportTransformer.java:72) at hudson.plugins.nunit.NUnitArchiver.invoke(NUnitArchiver.java:66)
            Hide
            slide_o_mix Alex Earl added a comment -

            Raghavendra Bankapur Please upload your nunit xml files.

            Show
            slide_o_mix Alex Earl added a comment - Raghavendra Bankapur  Please upload your nunit xml files.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Alex Earl
            Path:
            pom.xml
            src/main/java/hudson/plugins/nunit/NUnitArchiver.java
            src/main/java/hudson/plugins/nunit/NUnitPublisher.java
            src/main/java/hudson/plugins/nunit/NUnitReportTransformer.java
            src/main/resources/hudson/plugins/nunit/NUnitPublisher/config.jelly
            src/main/resources/index.jelly
            src/test/java/hudson/plugins/nunit/NUnitArchiverTest.java
            src/test/java/hudson/plugins/nunit/NUnitIntegrationTest.java
            src/test/java/hudson/plugins/nunit/NUnitPublisherTest.java
            src/test/java/hudson/plugins/nunit/NUnitReportTransformerTest.java
            src/test/java/hudson/plugins/nunit/NUnitToJUnitXslTest.java
            src/test/resources/hudson/plugins/nunit/NUnit-issue34452.xml
            http://jenkins-ci.org/commit/nunit-plugin/5bd699cedeae13475a3321637da3d5c47397b362
            Log:
            Fix JENKINS-27618, JENKINS-27906, JENKINS-34452, JENKINS-42967

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Alex Earl Path: pom.xml src/main/java/hudson/plugins/nunit/NUnitArchiver.java src/main/java/hudson/plugins/nunit/NUnitPublisher.java src/main/java/hudson/plugins/nunit/NUnitReportTransformer.java src/main/resources/hudson/plugins/nunit/NUnitPublisher/config.jelly src/main/resources/index.jelly src/test/java/hudson/plugins/nunit/NUnitArchiverTest.java src/test/java/hudson/plugins/nunit/NUnitIntegrationTest.java src/test/java/hudson/plugins/nunit/NUnitPublisherTest.java src/test/java/hudson/plugins/nunit/NUnitReportTransformerTest.java src/test/java/hudson/plugins/nunit/NUnitToJUnitXslTest.java src/test/resources/hudson/plugins/nunit/NUnit-issue34452.xml http://jenkins-ci.org/commit/nunit-plugin/5bd699cedeae13475a3321637da3d5c47397b362 Log: Fix JENKINS-27618 , JENKINS-27906 , JENKINS-34452 , JENKINS-42967
            Hide
            slide_o_mix Alex Earl added a comment -

            Will be fixed in 0.19, will no longer need to use step(), you can use just nunit 

            Show
            slide_o_mix Alex Earl added a comment - Will be fixed in 0.19, will no longer need to use step(), you can use just nunit 

              People

              Assignee:
              slide_o_mix Alex Earl
              Reporter:
              tomppa Tom Hannelius
              Votes:
              14 Vote for this issue
              Watchers:
              17 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: