Sarah Gardiner is a Customer Success Engineer for BlazeRunner. Her background is in teaching (chemistry and biology) and quality assurance (web and mobile applications). She loves being able to combine her past experience to help others learn and succeed in the testing world. In her free time, she loves gardening, traveling, and working with animal rescues.

Become a JMeter and Continuous Testing Pro

Start Learning
Slack

Test Your Website Performance NOW! |

arrowPlease enter a URL with http(s)
Dec 20 2021

The New BlazeMeter Drone.io Plugin: Performance Testing in the Drone Pipeline

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.io CI pipeline. 

 

By using the new BlazeMeter Drone.io 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.

 

How Does The BlazeMeter Drone.io 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

 

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.io Pipeline to Execute a BlazeMeter test?

Prerequisites

Before beginning, you must complete the following:

  1. Go to www.github.com and log in
    1. You must have at least one public github repository
      1. Your repository must be public for drone.io to recognize it
  2. Go to a.blazemeter.com and log in
    1. Generate your API key and API secret
      1. Reference this BlazeMeter Guide article for instructions on how to generate these
  3. Go to www.drone.io and log in using your github credentials
    1. All public repositories will display on the dashboard
  4. Click on your desired repository
    1. Click Activate Repository

 

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

 

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

 

Running an Existing BlazeMeter Test

To run an existing test:

  1. Go to www.github.com 
  2. Go to your desired repository
    1. Upload any required script files and dependencies
  3. Add a .drone.yml file manually
  1. Include all input parameters for your specific test like the screenshot below
  2. Be sure to include your BlazeMeter test ID. This is the number after ‘/tests/’ in your BlazeMeter test URL.

 

kind: pipeline
name: default


workspace:
  path: /drone/src
  
steps:
- name: run-test
  image: blazerunner/blazemeter
  environment:   
    apikey:
      from_secret: apiKey
    apisecret:
      from_secret: apiSecret
    createtest: false   
    testid: {testid}
    continuepipeline: false
 
  1. Go back to www.drone.io
  2. Within your desired repository, click the ‘+ NEW BUILD’ button in the top right corner
    1. Specify the branch you wish to run 
    2. Specify any additional parameters (optional)
    3. Click ‘Create’

 

  1. 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:

  1. Go to www.github.com 
  2. Go to your desired repository
    1. Upload new test files and any other required script files and dependencies
    2. Specify the path correctly for the start file and dependencies
  3. 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: pipeline
name: default


workspace:
  path: /drone/src
  
steps:
- name: create-test
  image: blazerunner/blazemeter
  environment:   
    apikey:
      from_secret: apiKey
    apisecret:
      from_secret: apiSecret
    testname: {testName} 
    projectid: {projectID} 
    createtest: true
    inputstartfile: DemoTest.jmx
    inputallfiles: /drone/src/{DependenciesFolderName}    
    uploadfilechk: true
    totalusers: {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:

 

  1. Go to www.github.com 
  2. Go to your desired repository
    1. Upload new test files and any other required script files and dependencies
  3. Add a .drone.yml file manually
    1. Include all input parameters for your new test like the screenshot below
    2. Load configuration like location, users, ramp up and failure criteria can be defined in the taurus file
  4. Set the taurus file as the start file for test
  5. Put the JMX file under the dependencies folder
  6. Refer to this Sample Yaml File

 

kind: pipeline
name: default


workspace:
  path: /drone/src
  
steps:
- name: create-test
  image: blazerunner/blazemeter
  environment:   
    apikey:
      from_secret: apiKey
    apisecret:
      from_secret: apiSecret
    testname: {testName} 
    projectid: {projectID} 
    createtest: true
    inputstartfile: SampleYamlFile.yml
    inputallfiles: /drone/src/{DependenciesFolderName}   
    uploadfilechk: true
    continuepipeline: true

 

  1. 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.io plugin. To get started with BlazeMeter for free, click here.

If you run into any issues running your test using drone.io, please reach out to support@blazemeter.com and share the log files. 

   
arrowPlease enter a URL with http(s)

Interested in writing for our Blog?Send us a pitch!