How to Run a Taurus Test through Jenkins Pipelines
Continuous integration shortens time to release and ensures easy test configuration maintenance. But testing can be complicated. With open-source automation testing tool Taurus and its integration with CI tools like Jenkins, continuous testing is made easy. 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, which 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. But, 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. If you are a LoadRunner user, here’s why you should give JMeter a chance.
Creating a Taurus Script
First, install Taurus.
Then, create your script in YAML. Let’s look at this simple script:
As you can see, it’s pretty easy to understand. This script runs 10 concurrent users, holds the load for 5 minutes, the ramp-up is 60 seconds and the thread group runs two requests: One, a GET request to blazedemo.com. Two, 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 are running 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:
In this case, if the avg response time is more than 10ms for 7 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
Viewing Taurus Results
You can quickly and easily see the test results on the Taurus dashboard. Note the failure alerts on the top right.
Viewing Taurus Results on BlazeMeter
You can also view the test results on BlazeMeter. To do that, run
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 offers different reports, which you can learn more about from here.
Integrating Taurus with Jenkins
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.
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, i.e every time I change the concurrency, for example, the test will run again.
You can see the results in Jenkins:
Or open the BlazeMeter link and see the results in BlazeMeter, in real-time:
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.
That’s it! You now know how to use Jenkins to run your YAML test, which runs open-source load testing through Taurus.
Start testing for free - put your URL or JMX file in the box at the top of this page and your test will start in minutes.