Saturday, December 19, 2009

Hudson's Jmeter plugin 0.3.0 released

I'm pleased to announce release 0.3.0 of Hudson's Jmeter plugin. It includes some fixes, and very cool features. For instance, the plugin is now able to handle multiple tests in the same job and it can be configured using threshold parameters to mark a build as unstable or failed.

The simpler way to use it is with ant, follow these simple steps to create a new job:
  • Install jMeter an run it in graphic mode.
  • Create as many jmeter tests as services you want to check, and add to each test the assertions which would make it fail.
  • Put all these tests together in the folder 'test/jmeter'
  • Create a build.xml specifying the path to jmeter:
<project default="all">
  <property name="jmeter-home" location="/usr/local/jmeter"/>
  <path id="ant.jmeter.classpath">
    <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="clean">
    <delete dir="results"/>
    <delete file="jmeter.log"/>
    <mkdir dir="results/jtl"/>
    <mkdir dir="results/html"/>
  </target>
  <target name="test" depends="clean">
    <jmeter
       jmeterhome="${jmeter-home}"
       resultlogdir="results/jtl">
      <testplans dir="test/jmeter" includes="*.jmx"/>
    </jmeter>
  </target>
  <target name="report" depends="test">
    <xslt
       basedir="results/jtl"
       destdir="results/html"
       includes="*.jtl"
       style="${jmeter-home}/extras/jmeter-results-detail-report_21.xsl"/>
  </target>
  <target name="all" depends="report"/>
</project>
  • In Hudson, create a new free-style software project and configure it: