Parvez
Parvez

Reputation: 439

How to run jmeter test through remote servers via jenkins

I am having a linux machine (say m1) [an openStack machine] to run my jmeter test. My typical process was to put latest jmx file on this machine and trigger below command: nohup /path/to/jmeter/bin/jmeter -n -t /path/to/script/test.jmx -l /path/to/resultsFolder/results.jtl

Now, I want to trigger same test via jenkins job which should actually do the same activity as above.

I perform two activities (one is to manually trigger jmeter-server on m1 and other to run jenkins job to run test via m1)

  1. To start jmeter server Ran following command manually on m1 ( SERVER_PORT=1099 nohup /path/to/jmeter/bin/jmeter-server)

  2. Jenkins Job

I have created a jenkins pipeline job: Stage1: checks out jmeter in jenkins master stage2: checks out latest script in jenkins master stage3: Runs jmeter remote test -
command used : sh ''' chmod u+x jmeter/bin/jmeter.sh jmeter/bin/jmeter.sh -n -t path/where/jenkins/checked/latest/test/test.jmx -R 10.X.X.X -l results.jtl'''

And it keep showing processing ......... unless I trigger manual shutdown.

So, I'm looking for two things

. Any ideas appreciated. Thank you in advance!

Upvotes: 0

Views: 2764

Answers (1)

Dmitri T
Dmitri T

Reputation: 168002

You can launch jmeter server on remote slaves in at least 2 ways:

  1. From Jenkins using Jenkins SSH Plugin
  2. From JMeter itself using OS Process Sampler or SSH Command plugin (in this case you will have 2 scripts, one which will set everything up and another will be the main test in distributed mode.

Upvotes: 2

Related Questions