Run massively scalable performance tests on web, mobile, and APIs

Request a Demo
Sep. 29th, 2016

How to Easily Automate Performance Tests in Jenkins

JMeter is one of the most popular and powerful open-source load testing tools. However, the JMeter script can be hard to manage. A simple request can turn into 100+ unreadable lines, and changes can be made only through JMeter.

Load Testing with JMeter

Description: creen Shot 2016-09-25 at 3.56.10 PM.png

An easier solution is Taurus, an open-source test automation tool based on YAML that simplifies the Continuous Integration (CI) processes. Scripts on Taurus are easy to create, understand and change.

 

How to Easily Create a Test in Taurus

Let’s look at this example, but before you do, take a minute to install Taurus.

 

---

modules:

 blazemeter:

   test: Taurus Demo

 

 

scenarios:

 simple:

   requests:

   - label: HomePage

     url: http://blazedemo.com/

   - label: VacationPage

     url: http://blazedemo.com/vacation.html

 

services:

- module: passfail

 criteria:

 - avg-rt of HomePage>750ms for 10s, continue as failed

 

execution:

 scenario: simple

 hold-for: 5m

 concurrency: 250

 ramp-up: 120s

 

  • This script, only 23 lines long, includes two endpoints - HomePage and VacationPage.
  • This test has an automated threshold: if the average response time of the HomePage is more than 750ms for 10 seconds, the test should be marked as failed.
  • The test also includes execution instructions: hold for 5 minutes, for 250 virtual users, with a ramp-up of 120 seconds.

 

Making Changes in the Load Test Script

It’s easy to make changes to this script.

 

1. Change the value on Taurus. In this case, we changed the ramp-up to 90 seconds.

 

---

modules:

 blazemeter:

   test: Taurus Demo

 

 

scenarios:

 simple:

   requests:

   - label: HomePage

     url: http://blazedemo.com/

   - label: VacationPage

     url: http://blazedemo.com/vacation.html

 

services:

- module: passfail

 criteria:

 - avg-rt of HomePage>750ms for 10s, continue as failed

 

execution:

 scenario: simple

 hold-for: 5m

 concurrency: 250

 ramp-up: 90s

 

To run this YAML script with Taurus, simply run bzt example.yml from the command line. Click here to learn more about working with Taurus.

 

2. Go to the file in the GitHub repository and commit the change.Description: creen Shot 2016-09-25 at 4.02.13 PM.png

Testing in Jenkins

3. Go to Jenkins. GitHub triggered a test in Jenkins, and you can see the test is kicked off. For more information about the GitHub Jenkins plugin see here.

GitHub Jenkins Plugin

Description: creen Shot 2016-09-25 at 4.02.46 PM.png

 

The change is easily made, without having to use a heavy GUI product. This works for app and code changes as well.

 

You can see if the test failed by clicking on the test itself. The reason is shown in the test name. In this case, average response time was greater than 750ms.

Jenkins Tests

Viewing Load Test Reports on BlazeMeter


The data from Taurus is automatically fed into BlazeMeter. BlazeMeter reports show multiple KPIs and correlations.

 

Type –report to open BlazeMeter.

Load Test Reports with BlazeMeter

 

BlazeMeter and Taurus enable quality automation. Not only are the load tests automated, but users can get feedback in real-time and analyze bottlenecks and issues, enabling them to make the necessary fixes ahead of time.

 

We recommend you also add functional tests to Jenkins and use tools like Sauce Labs to test browsers and operating systems.

 

Congratulations! You can now easily automate performance tests in Jenkins. Click here to go to Taurus and learn more.

 

Interested in writing for our Blog? Send us a pitch!