This guide will help you in setting up a Jenkins pipeline to run useMango™ tests. Follow the steps outlined here to run useMango™ tests and view the results.
Prerequisites:
To use Jenkins Pipeline, you will need:
Jenkins 2.x or later (older versions back to 1.642.3 may work but are not recommended).
Pipeline plugin, which is installed as a part of the Suggested Plugins.
Let’s start by creating the useMangoApiKey credentials that the Jenkins Pipeline script will need to retrieve useMango™ tests from your account:
Now, to set up the Jenkins pipeline,
Create a Pipeline project in Jenkins.
Next, we need to add parameters. Parameters allow you to prompt users for one or more inputs that will be passed into a build. In the Rebuild options choose This project is parameterized. We will need a total of four parameters (2 String and 1 Choice parameters).
Click on Add Parameter and pick String Parameter from the dropdown menu, then enter Project as the Name. If the project you’re testing isn’t going to change, you can set a Default Value. The value will be the project you are testing in useMango™.
Create a new String Parameter, then enter Tags as the Name.
Finally, we need a Choice Parameter. From the dropdown choose Choice Parameter and add the following choices to it:
Scroll down to the Pipeline section and select Pipeline Script from SCM from the Definition dropdown. Select Git from the SCM dropdown menu. In the Repository URL text field, paste the following useMango Jenkins public repository URL:
https://github.com/infuse-consulting/jenkins.git
Click on Apply, and Save the changes.
To build the project, go to Build with Parameters, add the parameter values and examine the results.
An example is shown below:
If you are not familiar with the process of viewing test results in Jenkins, you can learn more about it here.