Failures in @Before are not detected

2 views
Skip to first unread message

Matthew...@diamond.ac.uk

unread,
Jul 22, 2011, 9:58:01 AM7/22/11
to jenkins...@googlegroups.com
We're running some very standard Java JUnit4 tests, and using the "Publish JUnit test result report" option. I only just noticed we have failing tests that are never reported in the build results.

The problem is with some tests that have a @Before method, which gets an exception. The JUnit runner writes an XML report file in the expected place, with the error information, but it appears that Jenkins does not do anything useful with it. The XML file looks like:

<?xml version="1.0" encoding="UTF-8" ?>
<testsuite errors="1" failures="0" hostname="whatever" name="gda.device.detector.XHDetectorTest" tests="1" time="0.0" timestamp="2011-07-22T13:12:19">
<properties>
<property name="sun.arch.data.model" value="32" />
Etc etc
</properties>
<error message="gda/device/detector/DAServer" type="java.lang.NoClassDefFoundError">java.lang.NoClassDefFoundError: gda/device/detector/DAServer
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
Caused by: java.lang.ClassNotFoundException: gda.device.detector.DAServer
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
</error>
<system-out><![CDATA[]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>

I presume that the absence of any <testcase classname="blah" name="blah" time="1.249" /> means that the report file is simply ignored.

Is this a bug in Jenkins, or a mis-configuration on my part? How do other sites handle this? I'm somewhat concerned that we have had tests failing for some time, with no indication.

Thanks


--
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom

Christoph Kutzinski

unread,
Jul 22, 2011, 10:38:41 AM7/22/11
to jenkins...@googlegroups.com
IMHO this is a Jenkins bug.
There are similar bugs already reported:

https://issues.jenkins-ci.org/browse/JENKINS-6700
https://issues.jenkins-ci.org/browse/JENKINS-9770

-------- Original-Nachricht --------
> Datum: Fri, 22 Jul 2011 13:58:01 +0000
> Von: Matthew...@Diamond.ac.uk
> An: jenkins...@googlegroups.com
> Betreff: Failures in @Before are not detected

Matthew...@diamond.ac.uk

unread,
Jul 22, 2011, 11:00:47 AM7/22/11
to jenkins...@googlegroups.com
Thanks for finding those. https://issues.jenkins-ci.org/browse/JENKINS-6700 is clearly my situation. The original bug report described the problem in terms of Maven, but in fact it's not Maven-specific, so I have added a comment, and updated the problem summary.

Christoph Kutzinski

unread,
Jul 22, 2011, 1:03:59 PM7/22/11
to jenkins...@googlegroups.com
JENKINS-6700 wasn't so hard to find as I had reported it myself :)
Reply all
Reply to author
Forward
0 new messages