title: Jenkins: how to use parameters to skip pipeline parallel steps?
body: <p>I have a pipeline which runs a bunch of different tests in parallel. Sometimes one of those tests fail, and I want to restart that test only. Before I used pipelines, I used the Matrix Reloaded plugin to achieve this. I want to achieve the same thing with pipelines, and I believe that one way to achieve this is through build parameters.</p>
  
  <p>I have the following pipeline:</p>
  
  <pre><code>pipeline {
      agent any
  
      parameters {
          booleanParam(name: 'RUBY_LINUX', defaultValue: true, description: 'Ruby unit tests on Linux')
          booleanParam(name: 'RUBY_MACOS', defaultValue: true, description: 'Ruby unit tests on macOS')
      }
  
      stages {
          stage('test') {
              steps {
                  parallel(
                      'Ruby unit tests on Linux': {
                          node('linux') {
                              if (params.RUBY_LINUX) {
                                  echo 'Ran test.'
                              } else {
                                  echo 'Skipped test.'
                              }
                          }
                      },
                      'Ruby unit tests on macOS': {
                          node('macos') {
                              if (params.RUBY_MACOS) {
                                  echo 'Ran test.'
                              } else {
                                  echo 'Skipped test.'
                              }
                          }
                      }
                  )
              }
          }
      }
  }
  </code></pre>
  
  <p>But this gives me an error:</p>
  
  <pre><code>org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
  WorkflowScript: 24: Expected a step @ line 24, column 13.
                 if (params.RUBY_LINUX) {
                 ^
  
  WorkflowScript: 41: Expected a step @ line 41, column 13.
                 if (params.RUBY_MACOS) {
                 ^
  </code></pre>
  
  <p>How can I solve this?</p>