BlazeMeter provides a plugin which you can connect to Jenkins in order to perform automatic script executions.
This plugin allows you to load test your site with BlazeMeter and the ability to view the report in Jenkins. It also allows you to set the final build status as good, unstable or failed, based on the reported error percentage, and response times.
What is Jenkins?
Jenkins is an open source continuous integration tool written in Java. Builds can be started in various ways. For example: they can be triggered by a commit in a version control system, scheduled via a cron-like mechanism, built when other builds have completed, and by the request of a specific build URL.
How do I install BlazeMeter’s plugin for Jenkins?
- Login to Jenkins and go to the dashboard, Select ‘Manage Jenkins’, then ‘Manage Plugins’ and then, from the top tabs, select ‘Available’. (You can also download BlazeMeter's Plugin to Jenkins)
- Hit 'Control F' in your browser and search for BlazeMeter. Then mark the BlazeMeter check box.
- Scroll down and click ‘Download now and install after restart’.
- After the download starts, click to restart Jenkins.
How do I configure BlazeMeter's plugin for Jenkins?
- Once restarted, click Manage Jenkins and then click Configure System.
- Scroll down to the BlazeMeter Cloud section and enter  https://a.blazemeter.com/
- Click Save
- Next, click Manage Jenkins again
- Click Manage Credentials
- Click the Add Credentials button and choose BlazeMeter API Key (You can find it here)
- Add a nickname for your key in the Description field and enter the key in the API Key field and click the Test BlazeMeter User Key button
How do I configure a job using BlazeMeter's Jenkins plugin?
- Click on an existing job or create a new one, then press configure.
- Scroll down to the ‘Build’ steps. Click 'Add Build Step' and choose 'BlazeMeter'.
Setting up the Build's Test
- If your keys were pre-configured correctly in the global settings, you will now see all your tests in the drop down menu 'Blazemeter Test'.
- Select a test to run (you can also choose to create a new JSON configuration test - see below).
- Enter the threshold criteria for the error percentage and response times to specify when a build becomes unstable or fails.
- If you wish, you can also determine the test duration and to select a data folder to upload along with a .jmx file in order to override the test with new parameters.
- Save your settings.
- Press the “Build Now” link and you're ready to run.
Running a BlazeMeter Test in Jenkins Without a Plugin
Jenkins, like any other CI tool for that matter, enable to execute shell commands. By shell commands one can execute API calls or Simple scripts that initiate JSON tests.
If you'd like to know more about how to run a test via Jenkins without the use of a plugin, please refer to this article.
How do I build a job with BlazeMeter's Jenkins plugin?
- Once inside the job, click 'Build Now'.
- Click the build being run.
- Click console output to see the build progress. You’ll see the test parameters and an update every few seconds.
- When the test finishes, you'll see a summary of the test results and their impact on the build.
You can now click on ‘BlazeMeter Report’ to see a report of the test, the same way you would see them on the site.
You can also edit, run and compare test results to previous runs.
All reports, logs and data generated during test runs are stored in an archive - which you can access directly from your BlazeMeter account.
Furthermore, There are reports being generated by Jenkins, which are:
Store Your JSON in GitHub and Have a Jenkins’ job pull it for you when required.
Jenkins’ Reports provide great Out of the Box intelligence and visualization.
Performance Trend Report
The Trend Report presents trends and robustness of the successful and failed test results over time. This report is generated by fetching the JUnit.xml report when a test comes to an end. This capability is inherent to Jenkins and is provided by the common Performance Jenkins plugin.
The Performance report
The Performance report provides a basic KPI/Transactions report that visualize a JTL that is an artifact of the test run. This report is build by fetching the JTL file when a test comes to an end.
Comprehensive Reporting Dashboard
A far more comprehensive reporting dashboard is available, during the test and after the test has ended. By pressing the BlazeMeter link, the BlazeMeter reports are visible providing a deep dive into the performance KPIs, allowing one to look and find performance bottlenecks.