TestNG results not picked up by hudson

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

TestNG results not picked up by hudson

Mikael Carneholm-3
Hi all,

I'm having problems with getting hudson to pick up the TestNG results created by the Ant build script. The TestNG report is created without problems (using the testng task in Ant), but hudson doesn't seem to be able to "dig out" the test results from the testng-results.xml file. Below are the contents of the junitResult.xml file stored in the JOBNAME/lastSuccessful directory:

[hudson@oserver05 lastSuccessful]$ less junitResult.xml
<?xml version='1.0' encoding='UTF-8'?>
<result>
  <suites>
    <suite>
      <name>(testng-results.xml)</name>
      <cases/>
    </suite>
  </suites>
</result>

(As you can see, hudson at least managed to identify the name of the testng report file)

Here are the contents of the xml report generated by TestNG (testng-results.xml) :

<testng-results>
  <reporter-output>
  </reporter-output>
  <suite name="TestSuite1">
    <groups>
    </groups>
    <test name="RegressionTests">
      <class name="test.ReceiverTest">
        <test-method status="PASS" signature="receiveData()" name="receiveData" duration-ms="74" started-at="2007-10-31T15:08:25Z" finished-at="2007-10-31T15:08:25Z">
        </test-method>
      </class>
    </test>
  </suite>
</testng-results>

The report is generated with this Ant task:

<testng
    classpathref="test.run.class.path "
    outputDir="${test.report.dir}"
    haltOnfailure="false">                  
  <sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile }" />                 
  <xmlfileset dir="${testsrc.dir}" includes="testng.xml" />    
</testng>

Hudson is version 1.150 ( "Hudson ver. 1.150-SNAPSHOT (private-10/30/2007 03:20-hudson)" )

System properties:

HUDSON_HOME    /home/hudson
catalina.base    /opt/jakarta-tomcat-5.0.28
catalina.home    /opt/jakarta-tomcat-5.0.28
catalina.useNaming    true
common.loader    ${catalina.home }/common/classes,${catalina.home}/common/endorsed/*.jar,${catalina.home}/common/lib/*.jar
file.encoding    UTF-8
file.encoding.pkg    sun.io
file.separator    /
java.awt.graphicsenv     sun.awt.X11GraphicsEnvironment
java.awt.printerjob    sun.print.PSPrinterJob
java.class.path    /usr/java/default/lib/tools.jar:/opt/jakarta-tomcat-5.0.28/bin/bootstrap.jar:/opt/jakarta-tomcat-5.0.28/bin/commons- logging-api.jar
java.class.version    50.0
java.endorsed.dirs    /opt/jakarta-tomcat-5.0.28/common/endorsed
java.ext.dirs    /usr/java/jdk1.6.0_01/jre/lib/ext:/usr/java/packages/lib/ext
java.home    /usr/java/jdk1.6.0_01/jre
java.io.tmpdir    /opt/jakarta-tomcat-5.0.28/temp
java.library.path    /usr/java/jdk1.6.0_01/jre/lib/i386/client:/usr/java/jdk1.6.0_01/jre/lib/i386:/usr/java/jdk1.6.0_01/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
java.naming.factory.initial    org.apache.naming.java.javaURLContextFactory
java.naming.factory.url.pkgs    org.apache.naming
java.runtime.name    Java(TM) SE Runtime Environment
java.runtime.version    1.6.0_01-b06
java.specification.name    Java Platform API Specification
java.specification.vendor    Sun Microsystems Inc.
java.specification.version     1.6
java.vendor    Sun Microsystems Inc.
java.vendor.url    http://java.sun.com/
java.vendor.url.bug    http://java.sun.com/cgi-bin/bugreport.cgi
java.version    1.6.0_01
java.vm.info    mixed mode
java.vm.name    Java HotSpot(TM) Client VM
java.vm.specification.name    Java Virtual Machine Specification
java.vm.specification.vendor    Sun Microsystems Inc.
java.vm.specification.version    1.0
java.vm.vendor    Sun Microsystems Inc.
java.vm.version     1.6.0_01-b06
javax.xml.transform.TransformerFactory    com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
line.separator    
os.arch    i386
os.name    Linux
os.version    2.6.9-42.ELsmp
package.access    sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans.
package.definition    sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat .,org.apache.jasper.
path.separator    :
server.loader    ${catalina.home}/server/classes,${catalina.home}/server/lib/*.jar
shared.loader    ${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar
sun.arch.data.model     32
sun.boot.class.path    /opt/jakarta-tomcat-5.0.28/common/endorsed/xercesImpl.jar:/opt/jakarta-tomcat-5.0.28/common/endorsed/xml-apis.jar:/usr/java/jdk1.6.0_01/jre/lib/resources.jar:/usr/java/jdk1.6.0_01/jre/lib/rt.jar:/usr/java/jdk1.6.0_01/jre/lib/sunrsasign.jar:/usr/java/jdk1.6.0_01/jre/lib/jsse.jar:/usr/java/jdk1.6.0_01/jre/lib/jce.jar:/usr/java/jdk1.6.0_01/jre/lib/charsets.jar:/usr/java/jdk1.6.0_01/jre/classes
sun.boot.library.path    /usr/java/jdk1.6.0_01/jre/lib/i386
sun.cpu.endian    little
sun.cpu.isalist    
sun.io.unicode.encoding    UnicodeLittle
sun.java.launcher    SUN_STANDARD
sun.jnu.encoding    UTF-8
sun.management.compiler    HotSpot Client Compiler
sun.net.client.defaultConnectTimeout    60000
sun.net.client.defaultReadTimeout    60000
sun.os.patch.level    unknown
svnkit.symlinks    false
user.country     US
user.dir    /opt/jakarta-tomcat-5.0.28/webapps
user.home    /home/hudson
user.language    en
user.name    hudson
user.timezone    Europe/Rome

Environment variables:

CATALINA_HOME    /opt/jakarta-tomcat-5.0.28
CATALINA_OPTS    -DHUDSON_HOME=/home/hudson -Xmx512m
DERBY_HOME    /opt/db-derby-10.2.2.0
GTS_HOME    /opt/OpenGTS-1.5.0
G_BROKEN_FILENAMES    1
HISTSIZE    1000
HOME    /home/hudson
HOSTNAME    oserver05
INPUTRC    /etc/inputrc
JAVA_HOME    /usr/java/default
KDEDIR    /usr
LANG    en_US.UTF-8
LD_LIBRARY_PATH    /usr/java/jdk1.6.0_01/jre/lib/i386/client:/usr/java/jdk1.6.0_01/jre/lib/i386:/usr/java/jdk1.6.0_01/jre/../lib/i386
LESSOPEN    |/usr/bin/lesspipe.sh %s
LOCPATH    /opt/CollabNet_Subversion_Early_Adopter/share/locale:
LOGNAME    hudson
LS_COLORS    no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
MAIL    /var/spool/mail/hudson
MANPATH    /opt/CollabNet_Subversion_Early_Adopter/share/man:
NLSPATH    /usr/dt/lib/nls/msg/%L/%N.cat
PATH    /home/hudson/bin:/opt/CollabNet_Subversion_Early_Adopter/bin:/opt/tomcat/bin:/usr/kerberos/bin:/opt/db- derby-10.2.2.0/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
PWD    /opt/jakarta-tomcat-5.0.28/webapps
QTDIR    /usr/lib/qt-3.3
SHELL    /bin/bash
SHLVL    2
SSH_ASKPASS    /usr/libexec/openssh/gnome-ssh-askpass
TERM    vt100
USER    hudson
XFILESEARCHPATH    /usr/dt/app-defaults/%L/Dt
_    /usr/java/default/bin/java



Should I upgrade/downgrade the hudson version? Or is there some obvious error that I've made that I just need to correct?

Regards,
Mikael
Reply | Threaded
Open this post in threaded view
|

RE: TestNG results not picked up by hudson

Marziou, Gael
Hi Mikael,
 
It works for me but I had to specify a JUnit reporter like this:
 

<testng
    classpathref="test.run.class.path "
    outputDir="${test.report.dir}"
    haltOnfailure="false"
   reporter="org.testng.reporters.JUnitXMLReporter"
>                  
  <sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile }" />                 
  <xmlfileset dir="${testsrc.dir}" includes="testng.xml" />    
</testng>

Hope this helps,

Gael