This blog will be a deeper dive into Jenkins and RedLine13 and look at executing different test types with Jenkins and RedLine13. Continuous Integration and Continuous Delivery (CI/CD) is a convenient way to build and test your application. Jenkins, one of the most popular open source tool used to perform CI/CD tasks, can also be used to schedule load tests on RedLine13.
If you haven’t configured Jenkins with RedLine13, follow this article.
You can execute the different test types with Jenkins and RedLine13:
- RedLine13 Custom Test
- RedLine13 Gatling Test
- RedLine13 JMeter Test
- RedLine13 Scenario Test
All test types include support for Thresholds marking a build as unstable or failed based on criteria:
- Success Ratio – Percentage of tests/virtual users passed.
- Response Time – Average overall response time.
In the above example the build will be marked as unstable if response time is above 1000 ms and below 2000 ms. And it will be marked as failed if the response time is above 2000ms.
Configuring RedLine13 Custom Test
You can execute a Custom Test written in either PHP, NodeJs or Python. More information about writing a Custom Test.
To configure a Custom Test in Jenkins,follow the steps below
- Login to Jenkins and navigate to your project on home screen.
- Navigate to Configure project and click on Add build step then select RedLine13 Custom type from drop down.
Enter Name and Description in the General Properties section.
In the Custom Test Properties section, enter the absolute local path for Custom File In Project and Language of test. It can be Python, PHP or NodeJS.
To add any extra files to the test, you can use Add Extra Files option. Select the choice of your language (PHP, NodeJS or Python) by using the Language of test dropdown menu.
You can also select AWS cloud instance location size and other properties in advanced AWS Cloud Properties.
Once everything is configured, click on the Save button to save the Jenkins project.
Configuring RedLine13 Gatling Test
To configure a Gatling test on Jenkins, navigate to Configure project, as done above, and then select RedLine13 Gatling option from the Add build step drop down.
Enter Name and Description in the General Properties section.
Enter the absolute file path of the Gatling File in the Project field. You can select the Gatling version from the dropdown menu.
To pass any parameters to the test, use the Gatling Options field.
Similar to RedLine13 Custom test, you can select the cloud properties using Cloud Properties.
Configuring RedLine13 JMeter Test
To configure a JMeter test on Jenkins, navigate to configure project, as done above, and then select RedLine13 JMeter in Jenkins Build step.
Similar to above tests you can enter the name and description of your test in the General Properties section.
Specify absolute path of your JMeter script file in JMeter File in Project field. You can also pass any other external files like CSV files or external library files using Add Extra Files button.
If you wish to add extra plugins that are defined in RedLine13, you can add them to your test by plugin field. For example to add extras set click on add plugin by name button and then enter “extras” in the text box.
To pass parameters to JMeter script, you can use JMeter options to specify JVM options. For example, to increase heap memory you can use JVM options field.
Add your Test instance location and other properties and click on Save to save RedLine13 JMeter test in Jenkins.
Configuring RedLine13 Scenario Test
RedLine13 Scenario Test will allow you to run specific load tests from RedLine13 over and over again. These type of tests do not allow customization or overrides but keep the required assets stored on RedLine13. Scenario tests are available as Freestyle or Pipeline which will be described below.
To make a test available to scenario testing, you must save it as a template on RedLine13. On the test completion page, select ‘Jenkins’
On the test page, ‘Save for Jenkins’
Now you have a Scenario available for the RedLine13 Jenkins Plugin.
Now you will be able to select above test template in Jenkins project.
You can also run the tests from Pipeline project Type. A Pipeline is a collection of jobs used to build, deploy and test your software.The key feature of this pipeline is to define the entire deployment flow through the code.
Login to Jenkins and navigate to Pipeline project. Click on Pipeline Syntax.
Select the desired test type. Enter the required details as mentioned above.
Click on Generate Pipeline Script to generate the pipeline script.
Use the generated pipeline script in your pipeline and save the Project setup.
Steps to Run Test from Jenkins
Once the Jenkins build step is configured with the required test type, click on Build Now to run the tests. You can see the test status on the console.
Once the test is completed, you can see the report by clicking on RedLine13 Report. The report will give insights about the test as shown below.