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:
Installing the Plugin
On the Jenkins home page, click Manage Jenkins.
Click Manage Plugins.
Switch to the Available tab.
Search for zephyr and select the Zephyr Scale plugin.
Click Install without restart.
Setting Up the Plugin for Jenkins
Once you've installed the plugin, follow these steps to set it up:
Go to the Jenkins home page.
Click Manage Jenkins.
Click Configure System.
Scroll to the Zephyr Scale section, click Add, select Zephyr Scale Cloud and enter your API key for Zephyr Scale Cloud.
Click Test Configuration to ensure that the connection is valid.
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:
Go to the Jenkins home page.
Click Manage Jenkins.
Choose Configuration as Code.
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.
6. In the configuration file, specify the type of instance you want to configure: Cloud or Server.
If Cloud, provide 2 attributes as below.
If Server, specify 4 attributes as below.
If using a custom configuration file, ensure to include following attributes:
7. When the configuration file is completed, specify the path to the file on your local machine and click Apply new configuration.
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.
On the Jenkins dashboard, click your project.
Click Configure in the sidebar.
Click Post-build Actions to fast-scroll to the Post-Build Action section.
Click Add post-build action and select Zephyr Scale: Publish Test Results from the list:
A new section appears with the configuration fields.
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.
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:
On the Jenkins dashboard, click your project.
Click Configure in the sidebar.
Scroll down to the Build section and click Add build step.
Select Zephyr Scale: Download Feature Files from the list:
A new section appears with the configuration fields.
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.
Click Save.