How to set up SmartMeter.io for Continuous Load Testing with Jenkins

We have recently registered a high demand for the ability to run load tests from Jenkins and other CI tools. That’s why we included CI support to the current version of SmartMeter.io. Find out how to set it up.

Update: Read this updated post for more thorough explanation

Jenkins is an open source continuous integration tool written in Java. If you are not familiar with Jenkins we suggest you read more about it first.

In short, the main benefit of Jenkins and continuous integration in general is automation. Jenkins can run tests for you during assembling of a new version of your application or at a scheduled time period.

To continue with the following steps we assume you already have Jenkins up and running. Also, SmartMeter.io 1.1.0 version or higher is required. The set up process is very similar for other CI tools as well.

Step 1 – Configuring SmartMeter

First, turn on the automatic generation of report after test.

Configurator-Welcome-Screen-SmartMeter

  • Navigate to the report tab and check Create report after test property.

Create-Report-After-Test-SmartMeter

Furthermore, set SmartMeter to shutdown automatically after its job is done. This way Jenkins knows when SmartMeter is finished and may continue with following steps.

  • Again, open SmartMeter Configurator.

  • Navigate to controller tab and check Close Controller after test property.

Close-Controller-After-Test-SmartMeter

In case you don't want to use SmartMeter Configurator, you can pass these properties from Jenkins.

Step 2 – Running the test

SmartMeter supports running tests directly from command line. Knowing this, it is very easy to run a test from Jenkins.

First, navigate to SmartMeter home folder and then run the test. On my Linux machine, I would do:

cd /home/vernjan/smart-meter_1.1.0

./SmartMeter.sh runTest myTest.jmx

or

./SmartMeter.sh runTestNonGui myTest.jmx

And that's it, SmartMeter will start the test, generate report and shuts itself down.

Step 3 – Getting results

Test reports are located in the reports folder in SmartMeter home folder. Reports are ordered by timestamp.

Using Jenkins, you can easily copy it locally or remotely, pack it and even email it or do whatever else suits you the best.

In the future release, we plan to introduce tests SLA. This will enable to auto-evaluate test results.

Further reading: