BreadcrumbHomeResourcesBlog The New BlazeMeter Drone.io CI/CD Plugin December 20, 2021 The New BlazeMeter Drone.io CI/CD PluginPerformance TestingBy Sarah GardinerWe 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 fileContinue 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 TestRunning a New BlazeMeter TestRunning a New BlazeMeter Test with TaurusHow 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:droneTest 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 URLcreatetest: When set to true, it creates a new test (mandatory for new test)testname: Specify a name if you want to create a new testprojectid: Creates the test under this Project IDinputstartfile: 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 dependenciestotalusers: 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?PrerequisitesBefore beginning, you must complete the following:Go to www.github.com and log inYou must have at least one public github repositoryYour repository must be public for drone.io to recognize itGo to a.blazemeter.com and log inGenerate your API key and API secretReference this BlazeMeter Guide article for instructions on how to generate theseGo to www.drone.io and log in using your github credentialsAll public repositories will display on the dashboardClick on your desired repositoryClick Activate RepositoryYou can change a project’s visibility in drone.io (optional)Click on SecretsAdd your apiKey and apiSecret you created in BlazeMeter, here:Running an Existing BlazeMeter TestTo run an existing test:Go to www.github.com Go to your desired repositoryUpload any required script files and dependenciesAdd a .drone.yml file manuallyInclude all input parameters for your specific test like the screenshot belowBe 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.ioWithin your desired repository, click the ‘+ NEW BUILD’ button in the top right cornerSpecify 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 TestTo create a new test from the pipeline:Go to www.github.com Go to your desired repositoryUpload new test files and any other required script files and dependenciesSpecify the path correctly for the start file and dependenciesAdd a .drone.yml file manuallya. Include all input parameters for your new test like the screenshot belowb. Load configuration is optionalkind: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 TaurusTo create a new test from the pipeline with a Taurus based YAML:Go to www.github.com Go to your desired repositoryUpload new test files and any other required script files and dependenciesAdd a .drone.yml file manuallyInclude all input parameters for your new test like the screenshot belowLoad configuration like location, users, ramp up and failure criteria can be defined in the taurus fileSet the taurus file as the start file for testPut the JMX file under the dependencies folderRefer to this Sample Yaml Filekind: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:trueGo 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 testYou can also download log files to analyze the resultsThat’s it! Now you know all the necessary information about how to use the Drone CI CD plugin.START TESTING NOW
Sarah Gardiner Customer Success Engineer, BlazeRunner 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.