Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changed ant example, and references to release 0.3

hudson

Wiki Markup
{hudson-plugin-info:pluginId=jmeter}

Excerpt

This plugin allows you to capture report from JMeter. Hudson will generate graphic charts with the trend report of performance and robustness.

Release 0.3.0 includes the feature of setting the final build status as good, unstable or failed, based on the reported jmeter error percentage.

...

1. You can use ant and jmeter task for ant to launch tests on your web application
2. Your ant file may be similar to something like that:
 
 

Code Block
<project>
...
    	<project default="all">
  <!-- Define an environment variable pointing to JMETER folder or change this -->
  <property name="jmeter-home" location="${env.JMETER_DIR}" />

  <!-- ant-jmeter.jar comes with jmeter, be sure this is the release you have -->
  <path id="ant.jmeter.classpath">
    	<taskdef
		    <pathelement
       location="${jmeter-home}/extras/ant-jmeter-1.0.9.jar" />
  </path>

  <taskdef
    name="jmeter"
		    classname="org.programmerplanet.ant.taskdefs.jmeter.JMeterTask"
		    classpathref="ant.jmeter.classpath"   />

	  <target name="jmeter.initclean">
		<echo message="jmeter init..." /> 		<mkdir<delete  dir="${basedir}/loadtests/results/"/>
		    <delete includeemptydirsfile="truejmeter.log"/>
			<fileset     <mkdir dir="${basedir}/loadtests/results/jtl" includes/>
    <mkdir dir="**results/*html" />
		</delete> 	 </target>

	  <target name="jmeter.teststest" depends="jmeter.initclean">
description="launch jmeter load tests">
		<echo message="Starting jmeter tests..." />
		<jmeter
			 <jmeter
       jmeterhome="${jmeter-home}"
			resultlog="${basedir}/loadtests/results/LoadTestResults.       resultlogdir="results/jtl">
			      <testplans dir="${basedir}/loadteststest/jmeter" includes="*.jmx"/>
		    </jmeter>
	  </target>

  <!-- This is not needed for the plugin, but it produces a nice html report
       which can be saved usin hudson's archive artifact feature -->
  <target name="report" depends="test">
    <xslt
       basedir="results/jtl"
       destdir="results/html"
       includes="*...
</project>
jtl"
       style="${jmeter-home}/extras/jmeter-results-detail-report_21.xsl"/>
  </target>

  <target name="all" depends="test, report"/>

</project>

Hudson Configuration

In Hudson, configure the files or the repository containing the files to be parsed by JMeter plugin.

If you have are using version 0.3.0, you can configure the error percentage thresholds which would make the project unstable or failed.

...

Code Block
$ svn checkout https://svn.dev.java.net/svn/hudson/trunk/hudson/plugins/jmeter jmeter (username is 'guest' and password 'guest'
$ cd jmeter
$ mvn package
$ cp target/jmeter.hpi <path_to_hudson>/data/plugins

Changelog

 v0.3.0

  • Added the possibility of using more than one jmeter-report file. In order to keep the last version behaviour, the trend graphs will appear on the front page of the Hudson job if only one report file is present, when several report files are present the graphs will appear only when you click on “Jmeter trend”.
  • Added a configuration page for the graphs, accessible form the “Jmeter trend” page. It permits to show only the n last builds or the builds within a range of dates, the configuration is saved in a cookie.
  • Added threshold parameters in order to report the build process as unstable or failed based on the error percentage.
  • Fixed some bugs related with the parsing of previous-builds not configured for jmeter tasks.
  • Improvement of the plugin's performance when generating the graphs.
  • Added support for non-http XML report files.

...

- The last released version (0.2) of the Hudson JMeter plugin only handles one JMeter test:
  * When the build finishes the JMeter result file myJmeterTest-yyMMdd.xml is copied to the root of the build directory and renamed to "jmeter.xml".

- But version 0.3.0 introduces the possibility to handle several JMeter tests :
  * When the build finishes the JMeter result files myJmeterTest-yyMMdd.xml and myOtherJmeterTest-yyMMdd.xml are copied to the build/jmeter-reports directory and renamed to "myJmeterTest.xml" and "myOtherJmeterTest.xml"
  * The result file name is used to keep track of each test when building the trend graphs, we cannot use anymore the hardcoded file name "jmeter.xml"
  * Unless the unique JMeter test file is called jmeter.jmx, there is no way to make the 2 versions of the plugin compatible.

...