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

Robot Framework 3.3.0, tests failed and is unstable but still showing green check mark.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • robot-plugin
    • None

      I am using Robot Framework plugin version 3.3.0 and have an issue with the unstable threshold option.

      My post section of the pipeline looks like this:

      post {
          always {
            node('user') {
              dir("$WORKSPACE/logs") {
                archiveArtifacts artifacts: '**', fingerprint: true
              }
      
              robot(
                disableArchiveOutput: true,
                outputPath: 'logs',
                logFileName: 'log.html',
                outputFileName: 'output.xml',
                reportFileName: 'report.html',
                passThreshold: 100,
                unstableThreshold: 90.0
              )
            }
          }
          failure {
            node('rack1') {
              slackSend(....)
            }
          }
          cleanup {
            node('user') {
              cleanWs(deleteDirs: true)
            }
          }
        }

      So the problem is that the build will show as a complete pass even if there were some fails.

      Even if there are 5 fails it will still show as a green check mark as you can see on the bottom left of the picture above. I would like it to show the unstable yellow exclamation icon if there it's between 90% - 100% that passed. I have even tried changing the unstable threshold to 50% and it still shows a green check mark.

      A bit more info on how I run my tests because it might be relevant. I run my robot tests using a custom CLI (written in golang) which always returns a status code of 0, and also it adds a bunch of variables/arguments we typically use for our tests. It's basically a wrapper to the robot command. After the tests are completed, my CLI wraps to call Rebot and create an output.xml, report.html and log.html for all the test cases ran.

      Can you help me figure out why this is happening?

      EDIT: Some more info, this pipeline is run through a JobDSL pipelieJob pulled from git. It uses lightweight checkout and has no other steps.

      EDIT2: I tried downgrading to 3.2.0 and 3.0.0 and still the same issue. I noticed that adding robot as a post command on a freestyle job does mark in UNSTABLE. In a pipeline post, it does not seem to mark the build as unstable, I noticed though putting  currentBuild.result = 'UNSTABLE' does force it to become unstable.

            aleksisimell Aleksi Simell
            sohmahmood Sohaib
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: