2

I am tring to run the SoapUI TestRunner via a commandline in Jenkins. This is the SoapUI TestRunner commandline:

"/home/able/readyapi/installation/bin/testrunner.sh" -spayments-chain -r -a -j -f${WORKSPACE} "-RJUnit-Style HTML Report" -FXML -Enn-0716 "-TTestCase jenkins_test" /home/able/jenkins/workspace/REGRESSION_0716/test_automation

I generated a shell script in Jenkins' Pipeline Syntax leading to this shell script:

sh script: '"/home/able/readyapi/installation/bin/testrunner.sh" -spayments-chain -r -a -j -f${WORKSPACE} "-RJUnit-Style HTML Report" -FXML -Enn-0716 "-TTestCase jenkins_test" /home/able/jenkins/workspace/REGRESSION_0716/test_automation'

This gets me the following error:

sh: 0: Can't open script:

Can I anybody tell me with this information what I am doing wrong? Please let me know if you need more info. I am not very familiar with linux and shell.

K2017
  • 53
  • 2
  • 8

1 Answers1

0

The syntax should be simply

sh '"/home/able/readyapi/installation/bin/testrunner.sh" -spayments-chain -r -a -j -f${WORKSPACE} "-RJUnit-Style HTML Report" -FXML -Enn-0716 "-TTestCase jenkins_test" /home/able/jenkins/workspace/REGRESSION_0716/test_automation'

so it is quite literally telling you that script: should not be there.

The quoting around the first argument is batshit crazy, but not incorrect. It is equivalent to the more idiomatic

sh '/home/able/readyapi/installation/bin/testrunner.sh -spayments-chain -r -a -j -f"${WORKSPACE}" "-RJUnit-Style HTML Report" -FXML -Enn-0716 "-TTestCase jenkins_test" /home/able/jenkins/workspace/REGRESSION_0716/test_automation'

You'll notice I added quotes around -f${WORKSPACE} as well as removed them around the script's name. The quotes around "-RJUnit-Style HTML Report" look bewildering too, but if it works for you, I guess they are correct. (Maybe it should be -RJunit-Style "HTML Report" though? Or -R"Junit-Style HTML Report"? And similarly for the -T option later on.)

tripleee
  • 175,061
  • 34
  • 275
  • 318
  • Hi tripleee, thanks for your input. After using sh '/home/able/readyapi/installation/bin/testrunner.sh -spayments-chain -r -a -j -f"${WORKSPACE}" "-RJUnit-Style HTML Report" -FXML -Enn-0716 "-TTestCase jenkins_test" /home/able/jenkins/workspace/REGRESSION_0716/test_automation' I now get a "sh: 0: Can't open " message. I think the "-RJUnit-Style HTML Report" is correct since I copied that from SoapUI. Do you maybe have other suggestions? – K2017 Dec 05 '19 at 09:38
  • Just `sh: 0: Can't open ` with nothing after it? Probably show the entire `pipeline { ... }` anyway (I suggest you edit your question to update it, or maybe ask a new question). – tripleee Dec 05 '19 at 09:43