Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 342441

Summary: 'Properties >>' page for test results is empty
Product: [Eclipse Project] Platform Reporter: Dani Megert <daniel_megert>
Component: RelengAssignee: David Williams <david_williams>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: kim.moir, markus.kell.r, satyam.kandula
Version: 3.7   
Target Milestone: 3.8.1   
Hardware: All   
OS: All   
See Also: https://issues.apache.org/bugzilla/show_bug.cgi?id=51049
Whiteboard:
Attachments:
Description Flags
Possible fix
none
junit-noframes.xsl from ant1.8.3 none

Description Dani Megert CLA 2011-04-11 09:47:20 EDT
Broken since at least since 3.7 M6.

1. Open the JUnit results of a test suite
2. Click the 'Properties >>' link at the bottom right
==> page opens but is empty.
Comment 1 Markus Keller CLA 2011-04-11 11:02:15 EDT
This is a bug in Ant 1.8.2, see
https://issues.apache.org/bugzilla/show_bug.cgi?id=51049
Comment 2 Kim Moir CLA 2011-04-11 11:30:42 EDT
We don't be able to update to a new version of Ant until the next release, so I'll defer this bug to 3.8.
Comment 3 Dani Megert CLA 2011-04-11 11:33:19 EDT
Is there a way to get the properties? This is often important when tracking down issues.
Comment 4 Markus Keller CLA 2011-04-11 12:53:58 EDT
The properties are there in the source file as inlined Javascript. Workaround is to look at the source (Ctrl+U in Firefox) and scroll down about 1 page.
Comment 5 Markus Keller CLA 2012-01-29 13:13:19 EST
The Ant issue has been fixed. Ant 1.8.3 is in the works, but has not yet been released, see http://ant.1045680.n5.nabble.com/1-8-3-td5147837.html#a5433462 .

Maybe we should file a CQ for Ant 1.8.3 already now, to reserve an IP review slot for Juno?
Comment 6 Dani Megert CLA 2012-01-30 05:38:12 EST
(In reply to comment #5)
> The Ant issue has been fixed. Ant 1.8.3 is in the works, but has not yet been
> released, see http://ant.1045680.n5.nabble.com/1-8-3-td5147837.html#a5433462 .
> 
> Maybe we should file a CQ for Ant 1.8.3 already now, to reserve an IP review
> slot for Juno?

Satyam is looking into this.
Comment 7 Kim Moir CLA 2012-01-30 09:03:29 EST
Yes, please open a CQ I believe the deadline is early February.
Comment 8 Markus Keller CLA 2012-05-30 06:10:48 EDT
It's too late now to fiddle with the build machine, but for 4.3, it would be good the update the Ant version in the org.eclipse.releng.basebuilder to 1.8.3.
Comment 9 David Williams CLA 2012-07-25 10:53:14 EDT
So ... base builder ant has been upgraded to 1.8.3, but was there something else to do to make "properties >>" work? 

The results haven't been published to downloads yet, but looking at them on "build.eclipse.org" makes it appear that simply moving to 1.8.3 is not enough? 

Such as, 
https://hudson.eclipse.org/hudson/view/Eclipse%20and%20Equinox/job/eclipse-JUnit-Linux2/ws/workarea/N20120725-0200/eclipse-testing/results/html/org.eclipse.jdt.core.tests.compiler_linux.gtk.x86_6.0.html

It might be different once on "download.eclipse.org", but I'd find that odd.
Comment 10 Markus Keller CLA 2012-07-25 12:52:51 EDT
Created attachment 219176 [details]
Possible fix

(The link above gives me "Access Denied, mkeller is missing the Workspace permission").

Ant 1.8.3 should be enough. But I guess the problem is that we use an outdated copy of the /org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-noframes.xsl that's shipped in the ant-junit.jar. That's where the actual fix in Ant was applied.

I think the <xslt> task and the JUNIT.XSL file are not necessary any more and we should just use the <report> element of the <junitreport> task. Again, I don't know how to test this, so I'm just attaching my untested proposal here.

If that doesn't work, then you could also try updating the content of JUNIT.XSL.
Comment 11 David Williams CLA 2012-07-26 02:57:26 EDT
(In reply to comment #10)
> Created attachment 219176 [details]
> Possible fix
> 
> (The link above gives me "Access Denied, mkeller is missing the Workspace
> permission"). 

Remind me sometime to fix the permissions on those jobs. I think everyone should be able to read them. 

> Ant 1.8.3 should be enough. But I guess the problem is that we use an outdated
> copy of the
> /org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-noframes.xsl that's
> shipped in the ant-junit.jar. That's where the actual fix in Ant was applied.

You mean we use ant-junit.jar somewhere besides ant 1.8.3? If not, then we would be up to date I don't see it anywhere else (with what I happen to have loaded in my workspace). 


> I think the <xslt> task and the JUNIT.XSL file are not necessary any more and
> we should just use the <report> element of the <junitreport> task. Again, I
> don't know how to test this, so I'm just attaching my untested proposal here.
> 
> If that doesn't work, then you could also try updating the content of
> JUNIT.XSL.

It'd be cool to get rid of JUNIT.XSL ... is that something "we" created? Or modified from some starting point? 

After the M builds on Thursday, I know how to try a few changes and just run a test or two, to see how it goes. 

Thanks for the detailed explanation. Very helpful. Just how do you keep up with all this stuff! :)
Comment 12 Markus Keller CLA 2012-07-26 05:39:49 EDT
> Remind me sometime to fix the permissions on those jobs. I think everyone
> should be able to read them.

How about doing it right now? ;-)

> You mean we use ant-junit.jar somewhere besides ant 1.8.3?

Nope, JUNIT.XSL looks pretty much like an old copy of junit-noframes.xsl. I checked its history, and it just came out of nowhere in 2002. I don't know whether we copied Ant's or Ant copied ours (and it doesn't really matter).

The patch should be all it needs to get rid of JUNIT.XSL and use the fixed stylesheet from Ant 1.8.3.

> Just how do you keep up with all this stuff! :)

A few years ago, I looked at this in-depth when I wrote the XML importer for the JUnit view. And I filed the Ant bug for the "Properties >>" link. That's why I knew where to search, so I thought it's more efficient if I have a look.
Comment 13 David Williams CLA 2012-08-08 19:02:14 EDT
Given the timing, I'm doing this a bit backwards, but I've applied the patch to the R3_8_maintenance and R4_2_maintenance with commit 
5568a37b83cb4a09838b5bb06e6e7862e762c013

http://git.eclipse.org/c/platform/eclipse.platform.releng.git/commit/?h=R4_2_maintenance&id=23dcb940a9b113db2e169ba53413070ef8890f89

That is, it is too late to experiment for Kepler M1, but these maintenance branches will build on Thursday 8/9 and if causes any problems, can back out the change easily before final RC1 maintenance build on 8/15. 

If it goes well in maintenance builds, will carry over to master for Kepler M2.
Comment 14 Markus Keller CLA 2012-08-09 07:16:48 EDT
Created attachment 219709 [details]
junit-noframes.xsl from ant1.8.3

I felt a bit uneasy about screwing this week's M-builds, so I had another look at the patch -- and I'm pretty sure the patch won't work:

I think the reference to JUNIT.XSL in library.xml was in fact a no-op because the includes="${classname}.result.xml" refers to files that are never generated. So the new <report> element will generate an HTML report where previously only a an XML file was generated.

On the other hand, I found another reference to JUNIT.XSL in /org.eclipse.releng/configuration/eclipseBuilderOverlays/eclipse/buildConfigs/sdk.tests/testScripts/test.xml in task "genResults". That one seems to be in use and responsible for transforming the xml/*.xml result files into html/*.html.

I think you should revert the patch for now and we'll continue with this in N-builds after 4.3 M1.

The fix will likely be to replace the contents of JUNIT.XML with the attached file. However, I would not do that right now, since this stylesheet only works for me with JDK 5, but it fails with JDK 6 or 7.
Comment 15 David Williams CLA 2012-08-09 08:47:13 EDT
Thanks for taking a closer look. 

I've reverted the original fix for now, and agree, we'll try in N builds after M1.
Comment 16 Markus Keller CLA 2012-08-09 14:58:39 EDT
(In reply to comment #14)
> The fix will likely be to replace the contents of JUNIT.XML with the
> attached file. However, I would not do that right now, since this stylesheet
> only works for me with JDK 5, but it fails with JDK 6 or 7.

Very nasty! The xslt task fails with recent Oracle JDKs when Ant is launched from Eclipse using an Ant Build, see bug 384757.

But it works fine with jdk6_31 and jdk7_02 if Ant is launched from the command line. AFAICS, the build process currently uses jdk7_02 and launches from the command line, so that should work for now. I'm investigating the cited bug.
Comment 17 Markus Keller CLA 2012-08-10 10:41:55 EDT
(In reply to comment #16) That should have read:

It works fine when Ant is run ...
- from Eclipse: up to (including) jdk6_31 and jdk7_03
- from the command line (without a SecurityManager): with all JDKs
Comment 18 Markus Keller CLA 2012-08-15 13:19:45 EDT
(In reply to comment #14)
> Created attachment 219709 [details]
> junit-noframes.xsl from ant1.8.3

OK to release this into master of org.eclipse.test/JUNIT.XSL at any time.
Comment 19 David Williams CLA 2012-08-16 16:14:40 EDT
Comment on attachment 219176 [details]
Possible fix

Assuming this attachment is now obsolete. Let me know if I have misunderstood.
Comment 20 David Williams CLA 2012-08-16 16:18:17 EDT
I've pushed the attachment as the new JUNIT.XSL to master. If "nightly" looks ok, we can push to maintenance branches as well. (And, there is no 'integration').
Comment 21 Markus Keller CLA 2012-08-17 06:54:57 EDT
Looks good in https://hudson.eclipse.org/hudson/view/Eclipse%20and%20Equinox/job/eclipse-JUnit-Linux2/ws/workarea/N20120816-2100/eclipse-testing/results/html/org.eclipse.ui.workbench.texteditor.tests_linux.gtk.x86_6.0.html

To make it easier to update this file in the future, it would be good if you could add this in a comment in the file (e.g. append to the comment
 <!--  Sample stylesheet to be used with Ant JUnitReport output. ... -->):

NOTE: This file was copied from ant-junit.jar 1.8.3 /org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
Comment 22 Markus Keller CLA 2012-08-17 07:00:22 EDT
(In reply to comment #14)
To avoid confusion in the future, you may also want to remove line 149 of /org.eclipse.test/library.xml:
<xslt style="${junit-stylesheet}" basedir="${junit-report-output}" includes="${classname}.result.xml" destdir="${junit-report-output}" />

I'm pretty sure this is a no-op, but it should first be tested in an N-build.
Comment 23 David Williams CLA 2012-08-17 18:01:19 EDT
I've pushed to commits for suggestions in comment 21 and comment 22. 

If next nightly goes ok, I'll integrate (all) these changes into maintenance branches too. 

Very cool feature. Will hopefully help debug some of our odd unit test failures.
Comment 24 David Williams CLA 2012-08-19 23:39:34 EDT
The N builds seemed to go fine with all these changes, so have also put the changes in the R3_8_maintenance branch and R3_2_maintenance branch.
Comment 25 Dani Megert CLA 2012-08-23 03:33:32 EDT
Verified for 3.8.1, 4.2.1 and 4.3 builds.
Comment 26 David Williams CLA 2012-09-06 13:55:54 EDT
(In reply to comment #21)
> Looks good in
> https://hudson.eclipse.org/hudson/view/Eclipse%20and%20Equinox/job/eclipse-
> JUnit-Linux2/ws/workarea/N20120816-2100/eclipse-testing/results/html/org.
> eclipse.ui.workbench.texteditor.tests_linux.gtk.x86_6.0.html
> 
> To make it easier to update this file in the future, it would be good if you
> could add this in a comment in the file (e.g. append to the comment
>  <!--  Sample stylesheet to be used with Ant JUnitReport output. ... -->):
> 
> NOTE: This file was copied from ant-junit.jar 1.8.3
> /org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl

To make small correction, this should have said "junit-noframes.xsl". I'll correct the comment in org.eclipse.test. I found this out while confirming that there is no change in this file in Ant 1.8.4.
Comment 27 Markus Keller CLA 2012-09-06 16:38:54 EDT
(In reply to comment #26)
Sorry about that, and thanks for keeping the house clean.