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

SauceConnect step fails in Declarative pipeline: Missing required parameter: "sauceConnectPath"

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The following code fails on the sauceconnect step unless the script block is uncommented:
      https://raw.githubusercontent.com/bitwiseman/JS-Nightwatch.js/issue/declarative/sauceConnectPath/Jenkinsfile

      pipeline {
          agent any
          stages {
              stage ("Build") {
                  steps {
                      // Install dependencies
                      sh 'npm install'
                  }
              }
              stage ("Test") {
                  steps {
      //              script {
                      // Add sauce credentials
                      sauce('f0a6b8ad-ce30-4cba-bf9a-95afbc470a8a') {
                          // Start sauce connect
                          sauceconnect(options: '', useGeneratedTunnelIdentifier: false, verboseLogging: false) {
      
                          }
                      }
      //              }
                  }
              }
          }
      }
      

      The error is:

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: 16: Missing required parameter: "sauceConnectPath" @ line 16, column 25.
                                 sauceconnect(options: '', useGeneratedTunnelIdentifier: false, verboseLogging: false) {
                                 ^
      
      1 error
      
      	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
      	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1073)
      	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591)
      	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
      	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
      	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
      	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
      	at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
      	at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
      	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:67)
      	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:429)
      	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:392)
      	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:221)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:404)
      Finished: FAILURE
      

        Attachments

          Activity

          Hide
          abayer Andrew Bayer added a comment - - edited

          So...I would consider this very much a bug in the Sauce plugin rather than Declarative. If you look at https://github.com/jenkinsci/sauce-ondemand-plugin/blob/master/src/main/java/com/saucelabs/jenkins/pipeline/SauceConnectStep.java#L49-L55, you can see that the sauceconnect step in fact has four required parameters - if any of them should actually be optional, they shouldn't be in the @DataBoundConstructor, and they should instead have their own @DataBoundSetter.

          And I should mention that I'm actually not sure how this works outside Declarative! =)

          Show
          abayer Andrew Bayer added a comment - - edited So...I would consider this very much a bug in the Sauce plugin rather than Declarative. If you look at https://github.com/jenkinsci/sauce-ondemand-plugin/blob/master/src/main/java/com/saucelabs/jenkins/pipeline/SauceConnectStep.java#L49-L55 , you can see that the sauceconnect step in fact has four required parameters - if any of them should actually be optional, they shouldn't be in the @DataBoundConstructor , and they should instead have their own @DataBoundSetter . And I should mention that I'm actually not sure how this works outside Declarative! =)
          Hide
          rtyler R. Tyler Croy added a comment -

          Gavin Mogan, my colleague Liam Newman were hoping to feature the Sauce OnDemand plugin in another blog post around Declarative Pipeline.

          Would that be sufficient motivation to fix this issue mebbe?

          Show
          rtyler R. Tyler Croy added a comment - Gavin Mogan , my colleague Liam Newman were hoping to feature the Sauce OnDemand plugin in another blog post around Declarative Pipeline. Would that be sufficient motivation to fix this issue mebbe?
          Hide
          halkeye Gavin Mogan added a comment -

          Do you have a timeline for that? I've been looking at this one and the related one (JENKINS-37610) on and off the last couple of weeks but been busy with an important internal project (DIE FLASH DIE).

          Can it wait till early next week? I should have time then.

          Show
          halkeye Gavin Mogan added a comment - Do you have a timeline for that? I've been looking at this one and the related one ( JENKINS-37610 ) on and off the last couple of weeks but been busy with an important internal project (DIE FLASH DIE). Can it wait till early next week? I should have time then.
          Hide
          rtyler R. Tyler Croy added a comment -

          Most definitely can wait until early next week. We're queuing up a blog series to start after the 1.0 launch of Declarative Pipeline (~ feb 4/5th)

          Show
          rtyler R. Tyler Croy added a comment - Most definitely can wait until early next week. We're queuing up a blog series to start after the 1.0 launch of Declarative Pipeline (~ feb 4/5th)
          Hide
          halkeye Gavin Mogan added a comment -

          Okay, I had time today, so did a bit of refactoring. Should be released tomorrow, monday at the latest.

          Show
          halkeye Gavin Mogan added a comment - Okay, I had time today, so did a bit of refactoring. Should be released tomorrow, monday at the latest.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gavin Mogan
          Path:
          src/main/java/com/saucelabs/jenkins/pipeline/SauceConnectStep.java
          http://jenkins-ci.org/commit/sauce-ondemand-plugin/18608f6f3e3188fd0c4f3f0d5002291575c35fb1
          Log:
          Make parameters for sauceconnect pipeline step optional - JENKINS-41236

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gavin Mogan Path: src/main/java/com/saucelabs/jenkins/pipeline/SauceConnectStep.java http://jenkins-ci.org/commit/sauce-ondemand-plugin/18608f6f3e3188fd0c4f3f0d5002291575c35fb1 Log: Make parameters for sauceconnect pipeline step optional - JENKINS-41236
          Hide
          halkeye Gavin Mogan added a comment -

          Liam Newman
          this should now be fixed in 1.160

          https://github.com/saucelabs/jenkins-sauce-ondemand-plugin/blob/master/CHANGELOG.md#jenkins-1160---2017-01-27

          I'll mark it as resolved, reopen if necessary

          Show
          halkeye Gavin Mogan added a comment - Liam Newman this should now be fixed in 1.160 https://github.com/saucelabs/jenkins-sauce-ondemand-plugin/blob/master/CHANGELOG.md#jenkins-1160---2017-01-27 I'll mark it as resolved, reopen if necessary

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            bitwiseman Liam Newman
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: