Supporting New Load Testing Tool with Taurus
So you want to support a new testing tool with Taurus. For that you'll have to write a new test executor.
Test executor has two main tasks:
Overview of steps:
There is good example of minimal custom executor code here: examples/custom.
Also, feel free to ask your questions at Taurus support channel or to open a pull request at GitHub.
Step 1 - Creating a Runner
Each executor has 5 phase methods:
Note that prepare()-post_process() and startup()-shutdown() are mirrored phases. It means that if executor's prepare() was called - the engine will always call executor's post_process().
This makes prepare() phase a right place to open any resources and post_process() — a right place to close them. Just like that, startup() is a good place to launch subprocess, while taking it down in shutdown().
Step 2 - Reading Test Results
If executor wants Taurus to pick up test results from load testing tool — it should declare a results reader class. This class should inherit from bzt.modules.aggregator.ResultsReader, implementing _read() generator method.
Reader is expected to be able to extract the following nonaggregated data about each HTTP request from the load testing tool:
Then, at the prepare stage, executor should instantiate reader class and add it as an underling to Taurus's aggregator.
For a working example you can take a look at bzt/modules/ab.py, which implements Taurus executor for ab tool from Apache's HTTP tool set.
Additionally, there's a checklist we use when adding new executors to ensure that everything is considered.
On this page: