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

Script not found results in success in durable-task-plugin

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: durable-task-plugin
    • Labels:
      None
    • Environment:
      CloudBees Jenkins Enterprise 2.121.1.2-rolling
      Durable Task Plugin: 1.22
    • Similar Issues:

      Description

      When running the powershell task, if the path you pass doesn't exist, the step does not cause the build to fail:
      pipeline:
      node("WINDOWS_MACHINE"){
      powershell("a_file_that_doesnt_exist")
      }
      output:

      Running in Durability level: MAX_SURVIVABILITY
      [Pipeline] node
      Running on <VM NAME> in D:\J\workspace\TEST_POWERSHELL_STEP
      [Pipeline]

      { [Pipeline] powershell [TEST_POWERSHELL_STEP] Running PowerShell script powershell.exe : a_file_that_doesnt_exist : The term 'a_file_that_doesnt_exist' is not recognized as the name of a cmdlet, function, At D:\J\workspace\TEST_POWERSHELL_STEP@tmp\durable-feef7c1b\powershellWrapper.ps1:5 char:3 + & powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Fi ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (a_file_that_doe...let, function, :String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At D:\J\workspace\TEST_POWERSHELL_STEP@tmp\durable-feef7c1b\powershellScript.ps1:1 char:1 + a_file_that_doesnt_exist + ~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (a_file_that_doesnt_exist:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException [Pipeline] }

      [Pipeline] // node
      [Pipeline] End of Pipeline
      Finished: SUCCESS

      I would expect that unless i have asked for the return code, the step should cause the build to fail. This should act the same way as if the calling script returned an invalid error code.

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            peanderson peter anderson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: