How to Include Load Testing in your CI/CD Pipeline
Jenkins is one of the most popular CI/CD open source tools in the market at the moment.
To get a better understand why is it useful to use Jenkins or a CI/CD tool, let’s dive in a brief description to better understand what is Continuous Integration/Continuous Delivery (CI/CD).
What is Continuous Integration (CI)?
Continuous integration (CI) is a software process which helps developers and tech people better manage code changes in their repositories, dealing with multiple branches and features and merging all these code changes back to a shared branch, master.
Pros of Continuous Integration (CI)
- Continuous integration (CI) makes it easier to find and fix bugs quickly.
- Continuous integration (CI) helps discover and resolve conflicts at an earlier stage of the development process.
- Continuous integration (CI) handles automation of builds, running automated tests, Unit Testing, Component Testing, Functional Testing, Load Testing, Integration Testing.
- Continuous integration (CI) helps with frequent integration and validation of code changes.
What is Continuous Delivery (CD)?
Continuous Delivery (CD), on the other hand, is the process which handles the release of the validate code changes (in the CI step) to different environments (testing, staging or production).
Continuous Delivery (CD) continues the process where CI ends.
It is very common that a product may have multiple teams of engineers, working on different features, trying to improve the same overall product.
Continuous Delivery (CD) helps all these engineers deploy, test and release all these changes in an automated and uninterrupted way.
Going back to our load testing CI/CD Jenkins plugin, this plugin will enhance the CI/CD parts of your software delivery process, but making sure no degradation was introduced along with new code changes or features.
Allowing your load tests to run automatically, and failing the Jenkins jobs if some criteria is not met, it’s a best practice in catching performance issues before releasing new code changes in front of customers.
You can run load tests as part of the Post-build Actions part of your Jenkins job, and set specific criteria to mark your job PASSED, UNSTABLE or FAILED.
Integrate Load Testing Jenkins CI/CD plugin:
1. Create your LoadFocus account on https://loadfocus.com
2. Copy your LoadFocus.com API key from https://loadfocus.com/account
3. In Jenkins go to Manage Jenkins > Manage Plugins > Available
4. Locate and install LoadFocus Load Test plugin
5. Go to Manage Jenkins > Manage Credentials and add your LoadFocus.com API key to the stored credentials
How to use LoadFocus Load Testing Plugin:
- Click on the Configure option for your Jenkins job.
- In the Post build portion, look for the Load Testing by LoadFocus.com option and select the checkbox. See the screen shot below:
- Choose a load test, enter both the Error % and Response Time thresholds and click Save.
View Load Test Results in CI console
View the Console output and monitor the progress of your running load tests during job’s Post build actions.
Print PDF Load Test Report
You can view all the results of your load test with charts and full metrics for a better understanding on how your application behaved on the whole duration of the test.
Multiple performance metrics are displayed, Latency, Connect Time, Hits/s, Errors per second, Response Codes, Min/Max Response Times, Response Time Percentile 90%, 95% and 99% etc.
Customize and white-label load test reports
Easily drag and drop to reorder items in your white-label load test reports in edit mode.
Show or hide items and charts in the test report, everything at a click of a button.
See here the load testing Jenkins CI/CD plugin.
Written by Bogdan Vazzolla.
LoadFocus is a cloud performance, load and stress testing tool which provides the infrastructure to run tests with thousands of concurrent users, from multiple cloud locations, in less than a few minutes, keep history of the results, compare different runs to inspect performance improvements or performance degradation. It also supports running JMeter load tests from the cloud.