
The New BlazeMeter Drone.io CI/CD Plugin
We have recently released a new BlazeMeter plugin - the BlazeMeter Drone.io plugin. With this plugin, BlazeMeter performance tests can now be created and executed in your Drone CI CD pipeline.
By using the new BlazeMeter Drone CI CI plugin, you can:
- Automatically test your application after publishing files and artifacts to GitHub Release.
- Trigger your BlazeMeter test after changing source code files in the source code management system, by committing the drone yaml file
- Continue the CI pipeline without waiting for the completion of your BlazeMeter test.
Table of Contents:
- How Does The BlazeMeter Drone.io Plugin Work?
- How Do I Use the Drone.io Pipeline to Execute a BlazeMeter test?
- Running an Existing BlazeMeter Test
- Running a New BlazeMeter Test
- Running a New BlazeMeter Test with Taurus
How Does The BlazeMeter Drone CI CD Plugin Work?
The core functionality of creating, launching, and executing performance tests within BlazeMeter is packaged inside a Docker image that is developed and maintained by BlazeRunner.
Image Name: blazerunner/blazemeter:drone
Test execution within the drone pipeline involves importing this Docker image and providing the necessary input parameters.
Below is an overview of the input options available. The input parameters listed here will be used in your .drone.yaml file, as you will see later in this article.
- apikey: BlazeMeter API Key (mandatory) - Generate from your BlazeMeter account
- apisecret: BlazeMeter API Secret (mandatory) - Generate from your BlazeMeter account
- testid: ID of the test (mandatory for existing test) - This is the number after ‘/tests/’ in your BlazeMeter test URL
- createtest: When set to true, it creates a new test (mandatory for new test)
- testname: Specify a name if you want to create a new test
- projectid: Creates the test under this Project ID
- inputstartfile: Path to the test start file (mandatory for new test)
- inputallfiles: Path to the folder where dependencies exist (jar files, csv files, etc)
- uploadfilechk: Set this flag in case you want to upload dependencies
- totalusers: Specify load criteria (default is 20)
- duration: Specify test duration in minutes (default is 20)
- rampup: Specify ramp-up time in minutes (default is 1)
- continuepipeline: Do you want to continue the pipeline while the test is running in the background? (default is true- continuepipeline: true - drone.io will display ‘success’ upon test kick off (does not wait for test completion), continuepipeline: false - drone.io will display ‘running’ upon test kick off, will wait for test completion to say ‘success’ or ‘failure’
How Do I Use the Drone CI CD Pipeline to Execute a BlazeMeter test?
Prerequisites
Before beginning, you must complete the following:
- Go to www.github.com and log in
- You must have at least one public github repository
- Your repository must be public for drone.io to recognize it
- You must have at least one public github repository
- Go to a.blazemeter.com and log in
- Generate your API key and API secret
- Reference this BlazeMeter Guide article for instructions on how to generate these
- Generate your API key and API secret
- Go to www.drone.io and log in using your github credentials
- All public repositories will display on the dashboard
- Click on your desired repository
- All public repositories will display on the dashboard
- Click Activate Repository

- You can change a project’s visibility in drone.io (optional)

- Click on Secrets
- Add your apiKey and apiSecret you created in BlazeMeter, here:

Running an Existing BlazeMeter Test
To run an existing test:
- Go to www.github.com
- Go to your desired repository
- Upload any required script files and dependencies
- Add a .drone.yml file manually
- Include all input parameters for your specific test like the screenshot below
- Be sure to include your BlazeMeter test ID. This is the number after ‘/tests/’ in your BlazeMeter test URL.
kind:pipelinename:defaultworkspace:path:/drone/srcsteps:-name:run-testimage:blazerunner/blazemeter:droneenvironment:apikey:from_secret:apiKeyapisecret:from_secret:apiSecretcreatetest:falsetestid:{testid}continuepipeline:false
- Go back to www.drone.io
- Within your desired repository, click the ‘+ NEW BUILD’ button in the top right corner
- Specify the branch you wish to run
- Specify any additional parameters (optional)
- Click ‘Create’

- While it is running, you can monitor it on www.drone.io and on a.blazemeter.com and see the status of your test.

Running a New BlazeMeter Test
To create a new test from the pipeline:
- Go to www.github.com
- Go to your desired repository
- Upload new test files and any other required script files and dependencies
- Specify the path correctly for the start file and dependencies
- Add a .drone.yml file manually
a. Include all input parameters for your new test like the screenshot below
b. Load configuration is optional
kind:pipelinename:defaultworkspace:path:/drone/srcsteps:-name:create-testimage:blazerunner/blazemeter:droneenvironment:apikey:from_secret:apiKeyapisecret:from_secret:apiSecrettestname:{testName}projectid:{projectID}createtest:trueinputstartfile:DemoTest.jmxinputallfiles:/drone/src/{DependenciesFolderName}uploadfilechk:truetotalusers:{Users}duration:{Duration}rampup:{RampUp}continuepipeline:true
4. Go back to www.drone.io and follow the build steps listed in the first example
Running a New BlazeMeter Test with Taurus
To create a new test from the pipeline with a Taurus based YAML:
- Go to www.github.com
- Go to your desired repository
- Upload new test files and any other required script files and dependencies
- Add a .drone.yml file manually
- Include all input parameters for your new test like the screenshot below
- Load configuration like location, users, ramp up and failure criteria can be defined in the taurus file
- Set the taurus file as the start file for test
- Put the JMX file under the dependencies folder
- Refer to this Sample Yaml File
kind:pipelinename:defaultworkspace:path:/drone/srcsteps:-name:create-testimage:blazerunner/blazemeter:droneenvironment:apikey:from_secret:apiKeyapisecret:from_secret:apiSecrettestname:{testName}projectid:{projectID}createtest:trueinputstartfile:SampleYamlFile.ymlinputallfiles:/drone/src/{DependenciesFolderName}uploadfilechk:truecontinuepipeline:true
- Go back to www.drone.io and follow the build steps listed in the first example
After your test runs:
If your test passed, the status will say ‘Success’

If your test failed, the status will say ‘Failure’

You can click on a bar in the chart or a specific test execution to see more information about the test

- You can also download log files to analyze the results


That’s it! Now you know all the necessary information about how to use the Drone CI CD plugin.