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.
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 five 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.
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.
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.
Viewing Load Test Reports on BlazeMeter
Type –report to open 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 that 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.