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 Video Library
Refcards
Trend Reports

Events

View Events Video Library

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
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

How are you handling the data revolution? We want your take on what's real, what's hype, and what's next in the world of data engineering.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

SBOMs are essential to circumventing software supply chain attacks, and they provide visibility into various software components.

Related

  • Recipe To Implement the Jenkins Pipeline For MuleSoft Application [Videos]
  • Mastering Shift-Left: The Ultimate Guide to Input Validation in Jenkins Pipelines
  • Integrating Jenkins With Playwright TypeScript: A Complete Guide
  • Jenkins Pipelines With Centralized Error Codes and Fail-Fast

Trending

  • Real-Time Market Data Processing: Designing Systems for Low Latency and High Throughput
  • How Predictive Analytics Became a Key Enabler for the Future of QA
  • CRITICAL_PROCESS_DIED: How to Fix This Windows Blue Screen Error
  • Deploy Serverless Lambdas Confidently Using Canary
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. DevOps and CI/CD
  4. How to Run a Taurus Test Through Jenkins Pipelines

How to Run a Taurus Test Through Jenkins Pipelines

Using Jenkins to run your YAML test — which runs open-source load testing through Taurus — doesn't have to be difficult.

By 
Guy Salton user avatar
Guy Salton
·
Mar. 20, 17 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
9.1K Views

Join the DZone community and get the full member experience.

Join For Free

Continuous Integration shortens time to release and ensures easy test configuration maintenance — but testing can be complicated. This blog post will go over how to run a load test through Taurus and any open-source tool and how to run those tests through Jenkins pipelines. This blog post is based on a webinar I co-presented with CloudBees and DevOps.com, which you can view here.

Taurus is an easy-to-use open source testing framework that works as a command line tool. Taurus simplifies load testing of 9 open-source load and functional testing tools: JMeter, Selenium, Gatling, The Grinder, Locust, Tsung, Siege, Apache Bench, and PBench. However, you don’t need to learn any of these tools’ complicated syntax. Rather, you can use Taurus’ intuitive YAML syntax instead. 

Taurus doesn’t support LoadRunner because LoadRunner isn’t an open-source tool. To learn more about converting your scripts from LoadRunner to open-source, see here. 

Creating a Taurus Script

First, install Taurus.

Then, create your script in YAML. Let’s look at this simple script:

---
execution:
- concurrency: 10
  hold-for: 5m
  ramp-up: 60s
  scenario: Thread Group
scenarios:
  Thread Group:
    requests:
    - label: blazedemo
      method: GET
      url: http://blazedemo.com/
    - body:
        fromPort: Paris
        toPort: Buenos Aires
      label: reserve
      method: POST
      url: http://blazedemo.com/reserve.php

As you can see, it’s pretty easy to understand. This script runs 10 concurrent users and holds the load for five minutes. The ramp-up is 20 seconds and the thread group runs two requests: a GET request to blazedemo.com and a POST request to blazedemo.com/reserve.php.

Unless you specify an executor by adding a line that says executor: Gatling (for example), Taurus will use JMeter as the default executor. In the back, Taurus will create an artifact directory with a JMX file (or a Scala file if you run Gatling, a Python file if you run Selenium, etc.). If you have pre-configured scripts for your open-source tools, that’s OK. Just add a path to them in the script and add the test configurations within the YAML. 

You can also add pass/fail criteria. For example:

---
services:
- module: passfail
  criteria:
  - avg-rt>10ms for 7s, stop as failed
  - hits of reserve >10 for 13s, continue as failed

In this case, if the average response time is more than 10ms for seven seconds, the test will stop as failed — or, if the number of hits is more than 10 for 13 seconds, the test will continue as failed. I created these parameters on purpose so the test will fail.

Now run the test by typing:

bzt <file_name>.yml <pass_fail_file_name>.bzt 

Viewing Taurus Results

You can quickly and easily see the test results on the Taurus dashboard. Note the failure alerts on the top right. 

taurus dashboard failure alerts

Viewing Taurus Results on BlazeMeter 

You can also view the test results on BlazeMeter. To do that, run:

bzt <file_name>.yml -report 

BlazeMeter will open up and you will be able to conduct a deeper analysis based on rich and colorful reports. BlazeMeter is a SAAS platform and you can also configure different geo-locations and higher concurrencies.

Here, for example, I configured engines to run from AWS Virginia and North California with 500 virtual users. 

blazemeter dashboard showing taurus test results

BlazeMeter offers different reports, which you can learn more about here.

Integrating Taurus With Jenkins

Taurus also integrates with Jenkins, and you can run the complete Taurus test from the Jenkins UI through Jenkins pipelines. 

After opening Jenkins, create a pipeline script. Here, I am pulling the YAML scripts from my GitHub repository and running the same command that I ran locally to run your Taurus test.

taurus test in jenkins pipelines

taurus test in github repository

To run the test in the cloud, modify the location parameters in the YAML script. You can also easily modify other configs, like concurrency or ramp-up. 

Jenkins can run these tests automatically. You can configure how the test runs in the build section. Here, for example, the test runs each time a change is pushed in GitHub; every time I change the concurrency, for example, the test will run again.

automating jenkins testing

You can see the results in Jenkins: 

viewing test results in jenkins

Or open the BlazeMeter link and see the results in BlazeMeter in real-time: 

viewing jenkins taurus test results in blazemeter

BlazeMeter also supports APM tools like New Relic, CloudWatch, and CA APM. You can configure them through BlazeMeter and they will run on your Taurus test. You will get the metrics in the BlazeMeter report.

blazemeter supports apm tools for the taurus test

pass failure criteria on blazemeter for taurus

That’s it! You now know how to use Jenkins to run your YAML test, which runs open-source load testing through Taurus. 

Testing Jenkins (software) Open source Pipeline (software)

Published at DZone with permission of Guy Salton, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Recipe To Implement the Jenkins Pipeline For MuleSoft Application [Videos]
  • Mastering Shift-Left: The Ultimate Guide to Input Validation in Jenkins Pipelines
  • Integrating Jenkins With Playwright TypeScript: A Complete Guide
  • Jenkins Pipelines With Centralized Error Codes and Fail-Fast

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • [email protected]

Let's be friends: