Site icon Vinsguru

JMeter – Continuous Performance Testing – JMeter + ANT + Jenkins Integration – Part 2

Goal:

To create a Continuous Delivery Pipeline which includes Performance Testing process to detect any performance related issues as early as possible.

Usually the full scale Performance Test will be done in the Staging/Pre-Production environment which could be identical to your Production environment. Code push to Staging happens after thorough QA functional/regression verification is done. So even if QA certifies the build, there is a chance that code might not work as expected at certain load which could be found only in Staging environment. This performance issue requires code change -> build -> QA verification once again which could postpone your Production push!

So, Can we fit the performance testing into the existing continuous development & testing process to detect the performance issues as early as possible?

Yes! We absolutely can! The idea here is to run the performance test in the lower environments [Dev/QA] (we might have to adjust the load accordingly) & to compare the results against some baseline metrics. Note that this is NOT going to replace the full scale performance test which we will do in the Staging environment.

Note: If you have not read this post – I would advise you to read the Part 1 of this post which talks about JMeter + Ant integration.

 

Jenkins Install:

Please check this link for the detailed steps on installing Jenkins on various OS.

 

Create Jenkins Job:

[We will use Default Ant assuming the slave machine has Ant installed already. if not, Let jenkins install ANT automatically.]

Note: Jenkins will look for the files under the workspace. So set the path relative to the workspace.

 

Invoke JMeter Test from Jenkins:

 

 

Jenkins-Performance Plugin:

Jenkins has a plugin for JMeter to parse the result files, create an aggregate report, create charts and to compare the current result with previous results etc.

You can find more details on the plugin here. 

[Note that: This plugin parses the result file only if the results are stored in the XML format. If you prefer to use CSV format, It will not work]

Once the plugin is installed, for the Jenkins Job, we can find ‘Publish Performance test result report‘ under Post build actions.  In the Report files section, give the relative path (to the workspace) of the output jtl file. 

EMailing the Results:

Jenkins has a nice plugin for Emailing the results. Please check this link for more details.

Once the plugin is installed, You can find a post build action ‘Editable Email Notification

 

 

Summary:

We did a nice job by integrating JMeter with Ant and Jenkins. Thus Continuous Performance Testing process setup is implemented.   We are also able to run the test as and when we want by a simple click in Jenkins. While you are concentrating on other tasks, Jenkins takes care of running the test, creating the results and sending out the results for you!! It also reduces the dependency on Performance Testers. YES..!! Anyone can run the test now. You have to just the share the link for the Jenkins job you have created.

We can also make this job integrated with ‘development deployments’ jobs of Jenkins – That is…whenever a code is pushed to the given test environment,  this job gets executed automatically without any manual intervention. Any functional test and performance test can be done as early as possible to detect any issues upfront!!

 

Grafana Implementation for Real Time results:

The JMeter-Jenkins integration, emailing the results are great!! But If you had noticed, to get the results, we need to wait for the test to finish. Would it not be awesome to see the results while Jenkins is running the test!!??

If you have a long running test like mine and you are curious of seeing the current results while Jenkins is running the test – please see one of my favorite posts on getting real time results.

 

Happy Testing & Subscribe 🙂

 

Share This:

Exit mobile version