To Execute Tests in Jenkins
In this procedure, you create a Jenkinsfile in your test directory that includes a function call:
This function can optionally take an argument, such as the location of the tests.
You upload the contents of your test directory to Jenkins and BAT executes tests when the function is called. The Jenkinsfile in the bat.demo repo includes configuration code that identifies the location of a test repository.
The apiTests function calls the class pipeline.groovy inside the alfred project:
A groovy script executes that downloads the latest version of the BAT wrapper and runs the test project with the distribution.
To execute tests in Jenkins:
Create a named Jenkinsfile in your test directory at the same level as bat.yaml. For example:
In Jenkinsfile, call apiTests:
Upload the contents of your test directory to Jenkins.
Bat executes tests in your test directory on Jenkins. If your bat.raml includes a cron expression, tests run repeatedly as specified.