Jenkins – JMeter Integration

Jenkins – JMeter Integration

After the project is cloned from GitHub, we compiled it, opened on port 8989 and processed the performance tests, we need to make the performance plugin display result in a user-friendly way.

We can do that by adding a dedicated Post-build Actions. We need to provide the results source file and configure the action:

Jenkins - JMeter Integration

We choose the Standard Mode with the subsequent configs:

Jenkins - JMeter Integration

Let’s hit Save, on the left menu of Jenkins dashboard click on the button Build Now and wait for it to finish the set of operations we configured up there.

After it’s finished, we’ll see on the console all outputs of our project. At the end we’ll get either Finished: SUCCESS or Finished: FAILURE:

Jenkins - JMeter Integration

Let’s go to the Performance Report area accessible via the left side menu.

Here we’ll have the report of all past builds including the current one to see the difference in term of performance:

Jenkins - JMeter Integration

Let’s click on the indication just up of the table to have only the result of the last build we just made:

Jenkins - JMeter Integration

From the dashboard of our project we can get the Performance Trend, which are other graphs showing the last builds results:

Jenkins - JMeter Integration

Note: Applying the same thing to a Pipeline project is also simple as:

  1. Create another project (item) from the dashboard and name it JMeter-pipeline for example (General info Tab)
  2. Select Pipeline as project type
  3. On the Pipeline Tab, on the definition select Pipeline script and check Use Groovy Sandbox
  4. In the script area just fill the following lines:

This script starts by cloning the project, goes in the target module, compile and run it to make sure the app is accessible at http://localhost:8989

Next, we run JMeter tests located in the resource folder, save the results as the build output, and finally, the application is closed.

Pages: 1 2