Forum Discussion

pgp's avatar
pgp
New Contributor
3 years ago

Is it possible to execute ReadyAPI testrunner in a <containerized> jenkins?

Hi,

    I've been trying to run in a dev environment the docker  ReadyAPI testrunner in a Jenkins pipeline.

 

Goal:

    ->Execute testsuite without the need of a readyapi plugin. This restriction is unfortunately given. Due to our license server we can't use a newer version than 3.3.0

 

So far I tried as follow:

 

 

stage('Test') {
  steps {    
      sh 'docker run -v="${WORKSPACE}/test":/project -v="${WORKSPACE}/test":/reports -e LICENSE_SERVER="xxx.xxx.xxx.xxx:xxx" -e COMMAND_LINE="-fproject/ -FHTML \'project/hello_rest_test.xml\'" smartbear/ready-api-soapui-testrunner:3.3.0'
  }
}
      

 

 

The runner reaches the license server correctly and it gets activated. The problem is that it seems that it does not find the project file as I get the following message:

The specified project file "project/hello_rest_test.xml" does not exist.

 

I've tried different approach like the one as follows:

 

stage('Test') {
  steps {
    script {
       def image = docker.image('smartbear/ready-api-soapui-testrunner:3.3.0')
               .withRun('-v="${WORKSPACE}/test":"/project" -v="${WORKSPACE}/test":"/reports" -e LICENSE_SERVER="xxx.xxx.xxx.xxx:xxxx" -e COMMAND_LINE="-fproject/ -FHTML \'project/hello_rest_test.xml\'"')
               {c->
                   sh "docker logs ${c.id} -f"
               }
     }
  }
}

 

 

Logs are similar, the runner gets activated but it does not find the test file. 

So my first question is, is it what I'm trying to do possible? Because may be I'm just trying to do something that it is not.

For instance, if I run it out of Jenkins then it works.

I noticed that Jenkins runs the docker container with '-w' parameter establishing the actual Jenkins Workspace as the testrunner container workdir, could it be that this breaks the testrunner container?

 

Looking forward any kind of hint you may provide even if the answer is that this is not possible to do it is fine too at least I'll know I'm on a dead end 🙂

Thanks

5 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    What Readyapi plugin needed? Are you using testrunner command to invoke the tests?
    • pgp's avatar
      pgp
      New Contributor

      I'm running it on a Jenkins Pipeline.

      I'm using the following testrunner: https://support.smartbear.com/readyapi/docs/integrations/docker/soapui.html

      And I'm running it in Jenkins like defined here and the script itself the one I wrote on my first post: https://www.jenkins.io/doc/book/pipeline/docker/

       

      Without Jenkins I succeeded but when I'm running it within a Jenkins Pipeline I can't manage to make the testrunner to find the xml with the testsuite.

      That's why I'm wondering whether I'm doing something wrong or perhaps I may be missing something here or may be this is not even possible to do.

       

       

      • nmrao's avatar
        nmrao
        Champion Level 3

        Without Jenkins I succeeded

        What command did you use in above case?

         


         but when I'm running it within a Jenkins Pipeline I can't manage to make the testrunner to find the xml with the testsuite.

        What command are using in this case in the pipe line?