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

Update documentation for junit Pipeline step return value

    Details

    • Similar Issues:

      Description

      I just recently saw a discussion on gitter, where Jesse Glick mentioned that the junit task returns a hudson.tasks.junit.TestResultSummary.

      This is a very cool feature and I bet many people like to use it, but I couldn't find it anywhere in the official documentation.

      Jesse Glick @jglick Aug. 30 23:00
      @sshepel you need to use the return value from the junit step, as above

      Serhii Shepel @sshepel Aug. 30 23:01
      But ATM currentBuild.rawBuild.getAction(AbstractTestResultAction.class) returns summary for all mvn test calls...
      hm I didn't know that junit has return value
      interesting
      so, does this means that smth like this should work: def platformTestResults = junit allowEmptyResults: true, testResults: '*/target/surefire-reports/.xml'?

      Jesse Glick @jglick Aug. 30 23:33
      @sshepel yes

      Serhii Shepel @sshepel 00:08
      Ok, thanks @jglick will check that tomorrow

      Serhii Shepel @sshepel 00:33
      @jglick hm, decided to do a quick test, and got failure... What kind of value junit step shout return?
      I thought that it should be hudson.tasks.junit.TestResultAction, am I wrong?
      oh, strange it returns hudson.tasks.junit.TestResultSummary
      then how can I get failureDiffString

      Jesse Glick @jglick 02:16
      .failCount as previously mentioned

      Serhii Shepel @sshepel 10:32
      failCount will return Gets the total number of failed tests. whereas failureDiffString returns Gets the diff string of failures... Anyway I can live without it Once again, thanks a lot @jglick

       

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            Yes, at a minimum JUnitResultsStep/help.html should document this. Perhaps some edits to jenkins.io as well, TBD.

            Show
            jglick Jesse Glick added a comment - Yes, at a minimum JUnitResultsStep/help.html should document this. Perhaps some edits to jenkins.io as well, TBD.
            Hide
            jglick Jesse Glick added a comment -

            FTR introduced in JENKINS-27395 by Andrew Bayer.

            Show
            jglick Jesse Glick added a comment - FTR introduced in JENKINS-27395 by Andrew Bayer .

              People

              • Assignee:
                Unassigned
                Reporter:
                dageissl Daniel Geißler
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: