Jenkins Integration

Jenkins is a continuous integration tool that helps with the deployment of software projects. Through this, you can run automated tests while building a project, and monitor the results.

The Zephyr Scale Jenkins plugin enables a task that reports on Zephyr Scale automated test results.

Workflow: Zephyr Scale and Jenkins

Here's how the components work together:

64107f1f8f6b3.png
64107f212a052.png

Installing the Plugin

  1. On the Jenkins home page, click Manage Jenkins.

  2. Click Manage Plugins.

    64107f22aba05.png
  3. Switch to the Available tab.

    64107f245562e.png
  4. Search for zephyr and select the Zephyr Scale plugin.

    64107f25b8815.png
  5. Click Install without restart.

Setting Up the Plugin for Jenkins

Once you've installed the plugin, follow these steps to set it up:

  1. Go to the Jenkins home page.

  2. Click Manage Jenkins.

  3. Click Configure System.

    64107f275bb54.png
  4. Scroll to the Zephyr Scale section, click Add, select Zephyr Scale Cloud and enter your API key for Zephyr Scale Cloud.

    64107f28ea6df.png
  5. Click Test Configuration to ensure that the connection is valid.

    64107f2a4fa14.png
  6. Once valid, click Save.

Setting Up the Zephyr Scale Plugin for Jenkins using Jenkins Configuration as Code

After installing the Jenkins Configuration as Code plugin, follow these steps to configure the Zephyr Scale plugin:

  1. Go to the Jenkins home page.

  2. Click Manage Jenkins.

  3. Choose Configuration as Code.

64107f2bc87b8.png

4. Select Download Configuration to get a pre-made configuration file or create a custom YAML file.

5. Open the downloaded file and scroll down to the Zephyr Scale section at the bottom.

64107f2d364f2.png

6. In the configuration file, specify the type of instance you want to configure: Cloud or Server.

  1. If Cloud, provide 2 attributes as below.64107f2f1028f.png

  2. If Server, specify 4 attributes as below.

    64107f30d1120.png
  3. If using a custom configuration file, ensure to include following attributes:

    64107f32b07ca.png

    7. When the configuration file is completed, specify the path to the file on your local machine and click Apply new configuration.

    64107f3481053.png

    Note: If the YAML file is configured incorrectly (wrong user data or missing attributes), no instances would be configured.

Publishing Jenkins Test Results to Zephyr Scale

The post-build task explained here helps you configure the publishing of Jenkins automated-test results to Jira once a project build completes.

  1. On the Jenkins dashboard, click your project.

  2. Click Configure in the sidebar.

  3. Click Post-build Actions to fast-scroll to the Post-Build Action section.

  4. Click Add post-build action and select Zephyr Scale: Publish Test Results from the list:

    64107f3854946.png

    A new section appears with the configuration fields.

  5. Complete the configuration fields:

    • Jira instance - The URL of your Jira Cloud instance.

    • Project key - The Jira project key where the results will be sent.

    • Test framework - Select either Cucumber or Zephyr Scale Output Result for JUnit.

    • File path - The file path for the results file that is generated from the automated tests.

    • Automatically create non-existing test cases (optional) - This creates a relationship with the test case key used to annotate a test within a development project.

      64107f39b3ec9.png
  6. Click Save.

Running BDD Test Cases in Jira

This build task pulls existing BDD test cases from Zephyr Scale. When you execute these tests within Jenkins, the results are then sent back to Zephyr Scale.

To enable this task to run before a build takes place, complete the following steps:

  1. On the Jenkins dashboard, click your project.

  2. Click Configure in the sidebar.

  3. Scroll down to the Build section and click Add build step.

  4. Select Zephyr Scale: Download Feature Files from the list:

    64107f3b1f16f.png

    A new section appears with the configuration fields.

  5. Complete the configuration fields:

    • Jira instance - The URL of your Jira Cloud instance.

    • Project key - The Jira project key where the results will be sent.

    • Target path - The file path for the results file that is generated from the automated tests.

      64107f3c75cd2.png
  6. Click Save.

Publication date: