DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Automated Performance Tests in Jenkins CI Environments

Automated Performance Tests in Jenkins CI Environments

Taurus simplifies the automation of performance testing, is built for developers and DevOps, and relies on JMeter, Selenium, Gatling and Grinder as underlying engines.

Noga Cohen user avatar by
Noga Cohen
·
Sep. 11, 16 · Tutorial
Like (10)
Save
Tweet
Share
10.12K Views

Join the DZone community and get the full member experience.

Join For Free

1. Why is Continuous Integration (CI) Important?

Continuous Integration (CI) is important for developers, as they can integrate code into a shared repository and verify each check-in with an automated build, deploy, and test process. This enables them to quickly find and remove bugs, and measure the impact of each code change to application performance.

Users who want to add performance testing should identify their goals together with business analytics. This is important for determining which types of test should be run at each stage of the CI process.

Here are the types of tests you can run:

  • Load Tests are conducted to understand the behavior of the system under a specific expected load.

  • Stress Tests are used to understand the upper limits of capacity within the system.

  • Soak Tests determine if the system can sustain the continuous expected load.

  • Spike Tests determine if the system can sustain a suddenly increasing load generated by a large number of users.

  • Isolation Tests determine if a previously detected system issue has been fixed by repeating a test execution that resulted in a system problem.

So for example, for Continuous Delivery, running soak and spike tests in a pre-production environment helps understand how applications perform with continuous expected loads and spikes, with each production deployment.

To simplify inclusion of load tests into CI we suggest to use the Open Source test automation tool called Taurus. Let’s understand how Taurus works.

2. Using Taurus to Easily Run Load Tests

Taurus simplifies the automation of performance testing, is built for developers and DevOps, and relies on JMeter, Selenium, Gatling and Grinder as underlying engines. It also enables parallel testing, and its configuration format is readable and can be parsed by your version control system. It’s tool-friendly, and tests can be expressed using YAML or JSON. If you don’t have Taurus yet, install it.

Let’s look at this simple configuration in YAML. 

This test ramps-up to 5 users for 30 seconds, then sustains this load for 1 more minute. The number of hits per second (throughput) is 3, and they send requests to the url: http://aws-uut:8000/

execution:

- concurrency: 5
  throughput: 3 
  ramp-up: 30s
  hold-for: 1m
  scenario:
    requests:
    - http://aws-uut:8000/

This is a clear and simple test. The same test in JMeter would be very long, with lots of text that is hard to understand, and any changes made to it would be unclear.

You can also split the file into 2 (or more) config files which will make it easier to maintain the test code with the source code, especially if many developers are working on the same test.

(1)

scenarios:
  my_scenario:
    requests:
      - label: Home
        url: /
        method: GET
        think-time: 500ms

(2)

execution:
- concurrency: 5
  throughput: 3 
  ramp-up: 30s
  hold-for: 1m
  scenario:
    default-address: http://54.210.176.248:8000
    requests:
    - include-scenario: my_scenario

The first config file defines the scenario. The second config file defines the execution parameters.

More complex scenarios can include assertions for validating response data, group requests into transactions and pass-fail criteria.

To run the test, type bzt and the name of the YAML file. In this case: bzt simple-travel.yml scenario-home-page.yml  

Give it a few seconds to run and look at the dashboard. These include response times, percentiles, response codes, and local CPU usage.

This is the dashboard for the test after 83% of the test. All response codes are 200s, CPU is  6% and memory is 70%. The two labels that are being hit are the Home Page and the Reservation page, and it’s successful with no failures.

load test results in Taurus

After the test is finished, the results are shown collectively:

load test results in taurus

Now, let’s understand how Taurus works with BlazeMeter.

3. Viewing Taurus Results On BlazeMeter

By using the -report parameter, we can send the results to BlazeMeter in real-time.

Taurus is working in the background, but we can see all the reports and analyze the results on BlazeMeter in a more sophisticated and attractive fashion.

load test results reports on blazemeter

Finally, let’s see how it all comes together with Jenkins so you can include it in your Continuous Integration process.

4. Using Jenkins With Taurus and BlazeMeter for Load Testing

To use Jenkins for load testing, first install Taurus onto the Jenkins machine.

Now, open Jenkins.

1. Click ‘Configure’ on the left.

jenkins

2. Choose the Jenkins Build Triggers tab on top.

3. Scroll down to the Build section and enter the command for the test.

jenkins execute shell build

In this case: bzt simple-travel.yml -report

If you have a complete CI deployment process, make sure the test is kicked off with it. That’s it.

To see the test details, check out the Console Output.

jenkins console output

Results can also be shown on BlazeMeter.

We can add details easily by changing the test config file in one place on Taurus.

The test will now run on Taurus and on Jenkins. Congratulations! Now you can see the results and analyze load testing as a part of your full development process.

Continuous Integration/Deployment Testing Jenkins (software)

Published at DZone with permission of Noga Cohen, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Multi-Cloud Integration
  • The 5 Books You Absolutely Must Read as an Engineering Manager
  • Required Knowledge To Pass AWS Certified Solutions Architect — Professional Exam
  • 10 Best Ways to Level Up as a Developer

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: