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.

Integration Script Explained

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:

  1. Log in to Jenkins as an administrator.

  2. Click Manage Jenkins on the left and then click Manage Plugins:

    Jenkins configuration
  3. On the next page, switch to the Available tab, find the PostBuildScript Plugin in it and install that plugin.

    Install plugin
  4. Restart Jenkins, if needed.

Configure the job

After you install the plugin, you can configure the job:

  1. In Jenkins, on the main screen, click your job and select Configure in the menu on the left:

    Configure Jenkins job
  2. Go to Post-build Actions.

    Important

    The script should run after the build and automated tests are over.

    Post-build Actions tab
  3. 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.

    Execute scripts menu item
  4. Click Add generic script file:

    Add genericscript file button
  5. 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:

    Generic script file path box
  6. 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.

See Also

Continuous Integration

Integration Script Explained

Bamboo Integration

Publication date: