Running multiple JMeter performance tests on Jenkins

Viewed 813

I have a question regarding JMeter integration with Jenkins and I hope you can help me out.

I have n different jmx(JMeter) files. Currently I'm running a single Jenkins job for each of them with a Windows bash that looks roughly like:

cd C:\apache-jmeter-5.1.1\bin\ && jmeter -Jjmeter.save.saveservice.output_format=xml -n -t C:\apache-jmeter-5.1.1\load_tests\testrun.jmx -l C:\apache-jmeter-5.1.1\load_tests\logs\testrun.jtl

Is it best practice to keep adding new Jenkins jobs for each single test case or is it better to run all tests in one job. Will it give problems later in analyzing the files when I do it in 1 job?

1 Answers

The best practice is sticking to DRY principle, to wit instead of having multiple Jenkins jobs you can come up with a single Parameterized Job and pass new .jmx script and .jtl file names as the job parameters. Check out Jenkins parameterized build example with String and Boolean parameters article for detailed information.

Also depending on what you're trying to achieve you can consider switching from batch files to JMeter Maven Plugin or Taurus which can execute multiple JMeter .jmx scripts in sequential and parallel manners.

Related