Need Step by Step Guide to execute the Jmeter Scripts in Jenkins (with Hudson build) over Ubuntu

半腔热情 提交于 2019-11-30 19:01:51

问题


I am new to jenkins (Hudson Build) . I don't have any Idea how to integrate the Jmeter script with jenkins installed over Ubuntu . I reseached a lot , but could find only the GUI based steps for jenkins . Can any one please help me with Command line steps to integrate Jmeter with jenkins. I need to integrate the Jmeter as a sepearte task . I am usind EC2 instance through Putty and Winscp .

Thanks in advance .


回答1:


JMeter has at least 3 options on how non-GUI execution, all of them are supported by Jenkins:

  1. JMeter Ant Task
  2. JMeter Maven Plugin
  3. Command line non-GUI launch option

Feel free to choose the one, you're most comfortable with.

The last one is bundled and doesn't require any 3rd party software or extra configuration.

Just execute JMeter as follows:

./jmeter.sh -n -t ${path to your .jmx script} -l ${path to your results file}

Just in case - full command line options:

    -h, --help
            print usage information and exit
    -v, --version
            print the version information and exit
    -p, --propfile <argument>
            the jmeter property file to use
    -q, --addprop <argument>
            additional JMeter property file(s)
    -t, --testfile <argument>
            the jmeter test(.jmx) file to run
    -l, --logfile <argument>
            the file to log samples to
    -j, --jmeterlogfile <argument>
            jmeter run log file (jmeter.log)
    -n, --nongui
            run JMeter in nongui mode
    -s, --server
            run the JMeter server
    -H, --proxyHost <argument>
            Set a proxy server for JMeter to use
    -P, --proxyPort <argument>
            Set proxy server port for JMeter to use
    -N, --nonProxyHosts <argument>
            Set nonproxy host list (e.g. *.apache.org|localhost)
    -u, --username <argument>
            Set username for proxy server that JMeter is to use
    -a, --password <argument>
            Set password for proxy server that JMeter is to use
    -J, --jmeterproperty <argument>=<value>
            Define additional JMeter properties
    -G, --globalproperty <argument>=<value>
            Define Global properties (sent to servers)
            e.g. -Gport=123                                                                                                                                             
             or -Gglobal.properties                                                                                                                                     
    -D, --systemproperty <argument>=<value>                                                                                                                             
            Define additional system properties                                                                                                                         
    -S, --systemPropertyFile <argument>
            additional system property file(s)
    -L, --loglevel <argument>=<value>
            [category=]level e.g. jorphan=INFO or jmeter.util=DEBUG
    -r, --runremote
            Start remote servers (as defined in remote_hosts)
    -R, --remotestart <argument>
            Start these remote servers (overrides remote_hosts)
    -d, --homedir <argument>
            the jmeter home directory to use
    -X, --remoteexit
            Exit the remote servers at end of test (non-GUI)



回答2:


Depended on what you want to test. If you want to have a stress test, there is a jenkins plugin for JMeter If you make functional test, just run JMeter script in CLI mode.



来源:https://stackoverflow.com/questions/20738055/need-step-by-step-guide-to-execute-the-jmeter-scripts-in-jenkins-with-hudson-bu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!