0

how can i run a serverspec script in a jenkins pipeline? I try this

node {
  stage('serverspec') {
     sh 'rake spec'
  }
}

but then I get the following error:

 Port "8080" should be listening
 Failure/Error: it { should be_listening }
 Errno::ENOTTY:
   Inappropriate ioctl for device

I already to write a kind of wrapper-bash-wrapper which call the $ rake spec command but it don't change the result. I already found out a tutorial in which there a install additional a Rake plugin, but I can't don't under what's the different to a direct call of the test cases Maybe someone here can give me a hint or an short explanation what I am doing wrong. best regards Dan

  • Based on the information given in the question, the Jenkins part of this is fine and the Serverspec part is not. Please give information on that. – Matthew Schuchard Aug 21 '18 at 14:04
  • First of all I would like to thank you for your post. At the point I write this posting I was not sure what information I can give about serverspec to help people to help me resolve this problem. But there a good news I resolve the problem yesterday and forget to set the post on resolved, sorry for that. The problem was that serverspec try to get the username by ruby function and this part don't work if I run it by a pipeline-script. I resolved it by replacing the function by an environment variable –  Aug 22 '18 at 05:47
  • 1
    You can actually customize that in Serverspec's boilerplate `spec_helper.rb` to behave differently if you need it to. – Matthew Schuchard Aug 22 '18 at 14:18

0 Answers0