Jenkins Integration
Integration with Jenkins means that you can create and update automation tasks from your Jenkins job, and send test results to Zephyr Squad from these jobs.
To do this, you use script code that sends API requests to Zephyr Squad. This page explains how you can call this script from a Jenkins job.
Requirements
To configure Jenkins jobs and settings, you need to have Administrator permissions for your Jenkins instance.
The Jenkins nodes, where the integration code will run, should have access to Internet and your Jira project.
Prepare sample script
You can either write the integration script from scratch, but we’d recommend editing an example script.
Important
Make sure to replace constants in this script – access key, user ids, project keys, result file name, and others – with the data relevant to your Zephyr project.
Configure your Jenkins instance
The integration script should run after the build and automated tests are over, typically, at the end of the job execution. To run the script at this point, you need to install a special plugin into your Jenkins instance:
Log in to Jenkins as an administrator.
Click Manage Jenkins on the left and then click Manage Plugins:
On the next page, switch to the Available tab, find the PostBuildScript Plugin in it and install that plugin.
Restart Jenkins, if needed.
Configure the job
After you install the plugin, you can configure the job:
In Jenkins, on the main screen, click your job and select Configure in the menu on the left:
Go to Post-build Actions.
Important
The script should run after the build and automated tests are over.
Click Add post-build action and select Execute scripts from the menu (this item is added by the PostBuildScript plugin). This will append the Execute Script actions to your Jenkins job.
Click Add generic script file:
In the action properties, in the Generic script file path box, enter the name of your script file. Configure other parameters like run conditions or the node for the run:
Save the changes.
Now, if you run your job, it will connect to Zephyr Squad, create (or update) an automation task in it and attach test results to this task.