Sync JMeter Samplers With Jenkins Job

Once JMeter and Jenkins integrated, we may notice Jenkins job get passed even though Jmeter samplers fail. This happens because Jenkins job does not check whether Jmeter samplers are passed or failed, however Jenkins job checks only the Job build commands executed or not. Jenkins job never bothers whether samplers are executed or not until we do not configure Jenkins job.

The question is, how to do the setup so that if any sampler fails in Jmeter then Jenkins job should get failed.

We can do the setup by using Performance Plugin which will pick the data from Jmeter test result and will make the Jenkins job pass or fail.

Change the values same as shown below. Provide the csv path where you are saving Jmeter test result.

Click on Apply and Save button.

Run Jenkins Job and Verify Test result

Execute the Jenkins build to confirm setup is working fine. On successful execution you will see the test result on Jenkins project page.

To make sure Jenkins build is synced successfully please change the Jmeter script so that Jmeter script should fail. Once Jmeter script fails the same should reflect in Jenkins Job and Jenkins Job should get failed.