You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Tim Ellison <t....@gmail.com> on 2006/11/15 22:58:31 UTC

[classlib][testing] Showing test failures (Re: [drlvm] New regression: java.lang.ClassGenericsTest4)

Rana Dasgupta wrote:
> I think that a problem with the junit tests is that some failures spit out
> to the console, but show up in the test run results as passed. I find this
> very confusing. So unless you are watching all the time, you can miss them.

Hmm, this doesn't sound right.  I've not seen classlib tests fail but be
reported in the html report as passed.  Is that what you meant? (I
realize your mail subject was [drlvm] but just checking.)

One confusing aspect is that the classlib ant build fails if you run the
tests 'globally', but passes if you run the tests in a single module.

We could fix that by making the current test sequence an internal target
(for the 'global' test), and checking for failures after a 'modular' test.

e.g.

Index: build.xml
===================================================================
--- build.xml	(revision 474801)
+++ build.xml	(working copy)
@@ -41,8 +41,19 @@

     <target name="build" depends="compile-java, copy-resources,
build-jar" />

-    <target name="test" depends="build, compile-tests, run-tests" />
+    <target name="test" depends="-test">
+        <fail message="Some tests failed">
+            <condition>
+                <or>
+                    <isset property="test.failures" />
+                    <isset property="test.errors" />
+                </or>
+            </condition>
+        </fail>
+    </target>

+    <target name="-test" depends="build, compile-tests, run-tests" />
+
     <target name="clean">
         <delete file="${hy.jdk}/jre/lib/boot/beans.jar" />
         <delete file="${hy.jdk}/jre/lib/boot/beans-src.jar" />


That would be more intuitive to me, so unless anyone objects I'll do it.

Regards,
Tim

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

Re: [classlib][testing] Showing test failures

Posted by Tim Ellison <t....@gmail.com>.
Alexey Varlamov wrote:
> 2006/11/16, Tim Ellison <t....@gmail.com>:
>> One confusing aspect is that the classlib ant build fails if you run the
>> tests 'globally', but passes if you run the tests in a single module.
> 
> Yes, this was a nasty surprise for me when I saw exactly this
> sutiation few days ago; I just had no time to speak up. We definitely
> should fix this.

I fixed it in r475714.

Now whether you are running a single module's tests or the 'global'
classlib test target there will be a build failure shown if any JUnit
tests failed.

Regards,
Tim

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

Re: [classlib][testing] Showing test failures (Re: [drlvm] New regression: java.lang.ClassGenericsTest4)

Posted by Alexey Varlamov <al...@gmail.com>.
2006/11/16, Tim Ellison <t....@gmail.com>:
> Rana Dasgupta wrote:
> > I think that a problem with the junit tests is that some failures spit out
> > to the console, but show up in the test run results as passed. I find this
> > very confusing. So unless you are watching all the time, you can miss them.
>
> Hmm, this doesn't sound right.  I've not seen classlib tests fail but be
> reported in the html report as passed.  Is that what you meant? (I
> realize your mail subject was [drlvm] but just checking.)
>
> One confusing aspect is that the classlib ant build fails if you run the
> tests 'globally', but passes if you run the tests in a single module.

Yes, this was a nasty surprise for me when I saw exactly this
sutiation few days ago; I just had no time to speak up. We definitely
should fix this.

>
> We could fix that by making the current test sequence an internal target
> (for the 'global' test), and checking for failures after a 'modular' test.
>
> e.g.
>
> Index: build.xml
> ===================================================================
> --- build.xml   (revision 474801)
> +++ build.xml   (working copy)
> @@ -41,8 +41,19 @@
>
>     <target name="build" depends="compile-java, copy-resources,
> build-jar" />
>
> -    <target name="test" depends="build, compile-tests, run-tests" />
> +    <target name="test" depends="-test">
> +        <fail message="Some tests failed">
> +            <condition>
> +                <or>
> +                    <isset property="test.failures" />
> +                    <isset property="test.errors" />
> +                </or>
> +            </condition>
> +        </fail>
> +    </target>
>
> +    <target name="-test" depends="build, compile-tests, run-tests" />
> +
>     <target name="clean">
>         <delete file="${hy.jdk}/jre/lib/boot/beans.jar" />
>         <delete file="${hy.jdk}/jre/lib/boot/beans-src.jar" />
>
>
> That would be more intuitive to me, so unless anyone objects I'll do it.

Absolutely reasonable solution, please do. Thank you so much!

--
Alexey

>
> Regards,
> Tim
>
> --
>
> Tim Ellison (t.p.ellison@gmail.com)
> IBM Java technology centre, UK.
>