JavaTest plugin enhancements and fixes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

JavaTest plugin enhancements and fixes

Vladimir Ralev-2
Hello,

We needed a javatest plugin to run various TCKs and tried to use the one
from the hudson repository. After some initial testing we found a few
problems:
1. Skipped tests are counted as failing and the links in the report are
broken (the jtr files do not exist)
2. The reports page can get very big with more complex TCKs
3. No distincion between FAIL and ERROR
4. Sometimes COF xml validation fails because of some disconnected URL

So, attached is a patch with the following modifications:
1. Skipped tests are ignored in the results. This is because with larger
TCKs sometimes you want to run only parts at a time of the TCK and the
cof report generator will create many skipped tests slowing down the
analysis (some TCKs have 20K+ tests while I am only interested in
10-100, see screenshot).
2. There is a separate page where you can still see the skipped tests
(no links because there is nothig to point them to) to keep the first
page managable.
3. Added a status column.
4. Skip validation of the cof xmls - depending on the cof generator used
this causes troubles sometimes.

Another change I can suggest is to add a jrt plaintext MIME type mapping
in the hudson war's web.xml, which we are doing manually for now.
The plugin was tested with several TCKs and works fine for us. Let me
know what you think.

Vladimir Ralev, JBoss / Red Hat



### Eclipse Workspace Patch 1.0
#P hudson
Index: hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/TestObject.java
===================================================================
RCS file: /cvs/hudson/hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/TestObject.java,v
retrieving revision 1.3
diff -u -r1.3 TestObject.java
--- hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/TestObject.java 5 Feb 2007 01:10:11 -0000 1.3
+++ hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/TestObject.java 15 Aug 2007 19:50:35 -0000
@@ -176,6 +176,9 @@
         if(status.equalsIgnoreCase("did_not_run"))
             this.status = Status.SKIP;
         else
+        if(status.equalsIgnoreCase("error"))
+            this.status = Status.ERROR;
+        else
             this.status = Status.FAIL;
     }
 
@@ -193,4 +196,5 @@
 
     public abstract int getTotalCount();
     public abstract int getFailCount();
+    public abstract int getSkippedCount();
 }
Index: hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/TestCollection.java
===================================================================
RCS file: /cvs/hudson/hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/TestCollection.java,v
retrieving revision 1.2
diff -u -r1.2 TestCollection.java
--- hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/TestCollection.java 10 Nov 2006 07:47:06 -0000 1.2
+++ hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/TestCollection.java 15 Aug 2007 19:50:35 -0000
@@ -17,6 +17,7 @@
  *
  * @author Kohsuke Kawaguchi
  * @author Rama Pulavarthi
+ * @author Vladimir Ralev
  */
 public abstract class TestCollection<
     S extends TestCollection<S,C>,
@@ -30,8 +31,11 @@
      * All Failed Tests keyed by their ID.
      */
     private final Map<String,C> failedTests = new TreeMap<String,C>();
+    private final Map<String,C> skippedTests = new TreeMap<String,C>();
+    
     private int totalCount;
     private int failCount;
+    private int skippedCount;
 
     public Collection<C> getChildren() {
         return tests.values();
@@ -40,6 +44,10 @@
     public Collection<C> getFailedTests() {
         return failedTests.values();
     }
+    
+    public Collection<C> getSkippedTests() {
+        return skippedTests.values();
+    }
 
     public int getTotalCount() {
         return totalCount;
@@ -48,7 +56,10 @@
     public int getFailCount() {
         return failCount;
     }
-
+    
+    public int getSkippedCount() {
+        return skippedCount;
+    }
     /**
      * Returns the caption of the children. Used in the view.
      */
@@ -68,10 +79,14 @@
      */
     public void add(C t) {
         tests.put(t.getId(),t);
-        if(t.getStatus() != Status.PASS)
-            failedTests.put(t.getId(),t);
-        totalCount += t.getTotalCount();
+        if(t.getStatus() == Status.SKIP)
+            skippedTests.put(t.getId(),t);
+        else if(t.getStatus() != Status.PASS)
+           failedTests.put(t.getId(),t);
+        if(t.getStatus() != Status.SKIP)
+           totalCount += t.getTotalCount();
         failCount += t.getFailCount();
+        skippedCount += t.getSkippedCount();
         t.parent = this;
     }
 
Index: hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/Test.java
===================================================================
RCS file: /cvs/hudson/hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/Test.java,v
retrieving revision 1.1
diff -u -r1.1 Test.java
--- hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/Test.java 5 Nov 2006 22:26:16 -0000 1.1
+++ hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/Test.java 15 Aug 2007 19:50:35 -0000
@@ -43,6 +43,13 @@
         if(super.getTotalCount() != 0)
             return super.getFailCount();
         else
-            return (getStatus()==Status.PASS ? 0 : 1);
+            return ((getStatus()==Status.PASS || getStatus()==Status.SKIP) ? 0 : 1);
     }
+    
+    public int getSkippedCount() {
+       if(super.getTotalCount() != 0)
+           return super.getSkippedCount();
+       else
+           return (getStatus()==Status.SKIP ? 1 : 0);
+   }
 }
Index: hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/Report.java
===================================================================
RCS file: /cvs/hudson/hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/Report.java,v
retrieving revision 1.3
diff -u -r1.3 Report.java
--- hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/Report.java 3 Aug 2007 05:06:52 -0000 1.3
+++ hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/Report.java 15 Aug 2007 19:50:35 -0000
@@ -86,7 +86,9 @@
         digester.addCallParam("*/attribute/name", 0);
         digester.addCallParam("*/attribute/value", 1);
 
+        digester.setValidating(false);
         digester.parse(reportXml);
+
     }
 
     public String getChildTitle() {
Index: hudson/plugins/javatest-report/src/main/resources/hudson/plugins/javatest_report/TestCollection/index.jelly
===================================================================
RCS file: /cvs/hudson/hudson/plugins/javatest-report/src/main/resources/hudson/plugins/javatest_report/TestCollection/index.jelly,v
retrieving revision 1.2
diff -u -r1.2 index.jelly
--- hudson/plugins/javatest-report/src/main/resources/hudson/plugins/javatest_report/TestCollection/index.jelly 10 Nov 2006 07:47:06 -0000 1.2
+++ hudson/plugins/javatest-report/src/main/resources/hudson/plugins/javatest_report/TestCollection/index.jelly 15 Aug 2007 19:50:36 -0000
@@ -11,11 +11,16 @@
       <j:set var="prev" value="${it.previousResult}" />
       <test:bar />
 
+      <j:if test="${it.skippedTests.size()!=0}">
+          <a href="skipped/"><h2>Skipped tests: ${it.skippedTests.size()}</h2></a>
+      </j:if>
+
       <j:if test="${it.failCount!=0}">
           <h2>All Failed Tests</h2>
           <table class="pane sortable">
             <tr>
               <td class="pane-header">Test Name</td>
+              <td class="pane-header" style="width:6em">Status</td>
               <td class="pane-header" style="width:4em">Age</td>
             </tr>
             <j:forEach var="f" items="${it.failedTests}" varStatus="i">
@@ -23,11 +28,12 @@
               <tr>
                 <j:if test="${childCount==0}">
                     <j:set var="foo" value="../../artifact/java-test-work/${f.statusMessage}"/>
-                    <td class="pane"><a href="${foo}">${f.displayName}</a></td>
+   <td class="pane"><a href="${foo}">${f.displayName}</a></td>
                 </j:if>
                 <j:if test="${childCount !=0}">
                     <td class="pane"><a href="${f.id}/">${f.displayName}</a></td>
                 </j:if>
+                <td class="pane">${f.status}</td>
                 <td class="pane" style="text-align:right;">
                   ${f.age}
                 </td>
@@ -35,7 +41,7 @@
             </j:forEach>
           </table>
         </j:if>
-
+        
       <j:if test="${it.totalCount!=0}">
         <h2>All Tests</h2>
         <table class="pane sortable" id="testresult">
@@ -51,6 +57,7 @@
             <j:forEach var="p" items="${it.children}">
               <j:set var="prev" value="${p.previousResult}" />
               <j:set var="childCount" value="${p.children.size()}"/>
+              <j:if test="${!p.status.toString().equals('SKIP')}">
               <tr>
                 <j:if test="${childCount==0}">
                     <j:set var="foo" value="../../artifact/java-test-work/${p.statusMessage}"/>
@@ -71,6 +78,7 @@
                   ${h.getDiffString2(p.totalCount-prev.totalCount)}
                 </td>
               </tr>
+              </j:if>
             </j:forEach>
           </tbody>
         </table>
Index: hudson/plugins/javatest-report/src/main/resources/hudson/plugins/javatest_report/TestCollection/skipped.jelly
===================================================================
RCS file: hudson/plugins/javatest-report/src/main/resources/hudson/plugins/javatest_report/TestCollection/skipped.jelly
diff -N hudson/plugins/javatest-report/src/main/resources/hudson/plugins/javatest_report/TestCollection/skipped.jelly
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ hudson/plugins/javatest-report/src/main/resources/hudson/plugins/javatest_report/TestCollection/skipped.jelly 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,33 @@
+<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:test="/lib/test">
+  <l:layout>
+    <st:include it="${it.owner}" page="sidepanel.jelly" />
+    <l:main-panel>
+      <j:if test="${it.skippedCount!=0}">
+          <h2>Skipped tests count ${it.skippedCount}</h2>
+          <table class="pane sortable">
+            <tr>
+              <td class="pane-header">Test Name</td>
+              <td class="pane-header" style="width:6em">Status</td>
+              <td class="pane-header" style="width:4em">Age</td>
+            </tr>
+            <j:forEach var="f" items="${it.skippedTests}" varStatus="i">
+              <j:set var="childCount" value="${f.children.size()}"/>
+              <tr>
+                <j:if test="${childCount==0}">
+                    <j:set var="foo" value="../../artifact/java-test-work/${f.statusMessage}"/>
+                    <td class="pane"><a><font color="#0033FF">${f.displayName}</font></a></td>
+                </j:if>
+                <td class="pane">${f.status}</td>
+                <j:if test="${childCount !=0}">
+                    <td class="pane"><a href="${f.id}/">${f.displayName}</a></td>
+                </j:if>
+                <td class="pane" style="text-align:right;">
+                  ${f.age}
+                </td>
+              </tr>
+            </j:forEach>
+          </table>
+        </j:if>
+     </l:main-panel>
+  </l:layout>
+</j:jelly>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

javatest-plugin.JPG (223K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JavaTest plugin enhancements and fixes

Kohsuke Kawaguchi
Administrator

Sorry for the delay. My colleague Rama <[hidden email]> wrote
this plugin, so I just sent him a heads up.

I'm going to commit this change in the mean time, but please don't be
surprised if he makes some additional changes.

If you plan to make other changes to this plugin, would you be
interested in getting the commit access (so that you can commit changes
directly without getting blocked for 5 days)?

Vladimir Ralev wrote:

> Hello,
>
> We needed a javatest plugin to run various TCKs and tried to use the one
> from the hudson repository. After some initial testing we found a few
> problems:
> 1. Skipped tests are counted as failing and the links in the report are
> broken (the jtr files do not exist)
> 2. The reports page can get very big with more complex TCKs
> 3. No distincion between FAIL and ERROR
> 4. Sometimes COF xml validation fails because of some disconnected URL
>
> So, attached is a patch with the following modifications:
> 1. Skipped tests are ignored in the results. This is because with larger
> TCKs sometimes you want to run only parts at a time of the TCK and the
> cof report generator will create many skipped tests slowing down the
> analysis (some TCKs have 20K+ tests while I am only interested in
> 10-100, see screenshot).
> 2. There is a separate page where you can still see the skipped tests
> (no links because there is nothig to point them to) to keep the first
> page managable.
> 3. Added a status column.
> 4. Skip validation of the cof xmls - depending on the cof generator used
> this causes troubles sometimes.
>
> Another change I can suggest is to add a jrt plaintext MIME type mapping
> in the hudson war's web.xml, which we are doing manually for now.
> The plugin was tested with several TCKs and works fine for us. Let me
> know what you think.
>
> Vladimir Ralev, JBoss / Red Hat
>
>
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JavaTest plugin enhancements and fixes

Vladimir Ralev-2
Hi, I'd be interested in getting commit access. In fact we just decided
it makes more sense to do the report view based on packages and when you
click on a package you get a list of the tests only in this package.
Skipped packages are not displayed.  It appears most Sun TCKs only
define one suite and put all tests inside. When breaking it into
packages and separating the skipped tests in another section things seem
more managable. I am also open for other suggestions. Attaching the
patch for review and a screenshot.

Kohsuke Kawaguchi написа:

>
> Sorry for the delay. My colleague Rama <[hidden email]> wrote
> this plugin, so I just sent him a heads up.
>
> I'm going to commit this change in the mean time, but please don't be
> surprised if he makes some additional changes.
>
> If you plan to make other changes to this plugin, would you be
> interested in getting the commit access (so that you can commit
> changes directly without getting blocked for 5 days)?
>
> Vladimir Ralev wrote:
>> Hello,
>>
>> We needed a javatest plugin to run various TCKs and tried to use the
>> one from the hudson repository. After some initial testing we found a
>> few problems:
>> 1. Skipped tests are counted as failing and the links in the report
>> are broken (the jtr files do not exist)
>> 2. The reports page can get very big with more complex TCKs
>> 3. No distincion between FAIL and ERROR
>> 4. Sometimes COF xml validation fails because of some disconnected URL
>>
>> So, attached is a patch with the following modifications:
>> 1. Skipped tests are ignored in the results. This is because with
>> larger TCKs sometimes you want to run only parts at a time of the TCK
>> and the cof report generator will create many skipped tests slowing
>> down the analysis (some TCKs have 20K+ tests while I am only
>> interested in 10-100, see screenshot).
>> 2. There is a separate page where you can still see the skipped tests
>> (no links because there is nothig to point them to) to keep the first
>> page managable.
>> 3. Added a status column.
>> 4. Skip validation of the cof xmls - depending on the cof generator
>> used this causes troubles sometimes.
>>
>> Another change I can suggest is to add a jrt plaintext MIME type
>> mapping in the hudson war's web.xml, which we are doing manually for
>> now.
>> The plugin was tested with several TCKs and works fine for us. Let me
>> know what you think.
>>
>> Vladimir Ralev, JBoss / Red Hat
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>
>

Index: src/main/java/hudson/plugins/javatest_report/TestObject.java
===================================================================
RCS file: /cvs/hudson/hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/TestObject.java,v
retrieving revision 1.4
diff -u -r1.4 TestObject.java
--- src/main/java/hudson/plugins/javatest_report/TestObject.java 21 Aug 2007 01:35:40 -0000 1.4
+++ src/main/java/hudson/plugins/javatest_report/TestObject.java 26 Aug 2007 11:23:59 -0000
@@ -189,7 +189,7 @@
         if(name.equals("logfile"))
             statusMessage = value;
     }
-
+    
     public String getStatusMessage() {
         return statusMessage;
     }
Index: src/main/java/hudson/plugins/javatest_report/TestCollection.java
===================================================================
RCS file: /cvs/hudson/hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/TestCollection.java,v
retrieving revision 1.3
diff -u -r1.3 TestCollection.java
--- src/main/java/hudson/plugins/javatest_report/TestCollection.java 21 Aug 2007 01:35:40 -0000 1.3
+++ src/main/java/hudson/plugins/javatest_report/TestCollection.java 26 Aug 2007 11:23:58 -0000
@@ -5,6 +5,7 @@
 
 import java.util.Collection;
 import java.util.Map;
+import java.util.Set;
 import java.util.TreeMap;
 
 /**
@@ -33,6 +34,8 @@
     private final Map<String,C> failedTests = new TreeMap<String,C>();
     private final Map<String,C> skippedTests = new TreeMap<String,C>();
     
+    private final Map<String,Package> packages = new TreeMap<String,Package>();
+    
     private int totalCount;
     private int failCount;
     private int skippedCount;
@@ -88,6 +91,55 @@
         failCount += t.getFailCount();
         skippedCount += t.getSkippedCount();
         t.parent = this;
+        if( (t.getStatus() == Status.SKIP) ||
+         !(this.getClass().isAssignableFrom(Suite.class))) return;
+        String fqcn = t.getName();
+        int packagePosition = fqcn.lastIndexOf("/");
+        if(packagePosition>0 && packagePosition<fqcn.length())
+        {
+         Test test = new Test();
+         test.setId(t.getId());
+         test.setName(t.getName());
+         test.setStatusString(t.getStatus().toString());
+         test.setDescription(t.getDescription());
+         test.addAttribute("logfile", t.getStatusMessage());
+         String packageName = fqcn.substring(0, packagePosition).replaceAll("/",".");
+        
+         String testName = fqcn.substring(packagePosition + 1, fqcn.length());
+         Package c = (Package) packages.get(packageName);
+         if(c != null)
+         {
+         c.add(test);
+         }
+         else
+         {
+         Package newSuite = new Package();
+         newSuite.setId(packageName);
+         newSuite.setName(packageName);
+         newSuite.add(test);
+         newSuite.parent = this;
+         packages.put(packageName, newSuite);
+         }
+        }
+    }
+    
+    public String[] getPackages()
+    {
+     if(packages == null)
+     {
+     System.out.println("null"+this.getClass()+this.toString());
+     return null;
+     }
+     Set<String> set = packages.keySet();
+     String[] strs = new String[set.size()];
+     strs = set.toArray(strs);
+     return strs;
+    
+    }
+    
+    public Package getPackageTests(String packageName)
+    {
+     return packages.get(packageName);
     }
 
     // method for stapler
Index: src/main/resources/hudson/plugins/javatest_report/TestCollection/skipped.jelly
===================================================================
RCS file: /cvs/hudson/hudson/plugins/javatest-report/src/main/resources/hudson/plugins/javatest_report/TestCollection/skipped.jelly,v
retrieving revision 1.1
diff -u -r1.1 skipped.jelly
--- src/main/resources/hudson/plugins/javatest_report/TestCollection/skipped.jelly 21 Aug 2007 01:35:41 -0000 1.1
+++ src/main/resources/hudson/plugins/javatest_report/TestCollection/skipped.jelly 26 Aug 2007 11:23:59 -0000
@@ -3,7 +3,7 @@
     <st:include it="${it.owner}" page="sidepanel.jelly" />
     <l:main-panel>
       <j:if test="${it.skippedCount!=0}">
-          <h2>Skipped tests count ${it.skippedCount}</h2>
+          <h2>Skipped tests: ${it.skippedCount}</h2>
           <table class="pane sortable">
             <tr>
               <td class="pane-header">Test Name</td>
@@ -30,4 +30,4 @@
         </j:if>
      </l:main-panel>
   </l:layout>
-</j:jelly>
+</j:jelly>
\ No newline at end of file
Index: src/main/resources/hudson/plugins/javatest_report/TestCollection/index.jelly
===================================================================
RCS file: /cvs/hudson/hudson/plugins/javatest-report/src/main/resources/hudson/plugins/javatest_report/TestCollection/index.jelly,v
retrieving revision 1.3
diff -u -r1.3 index.jelly
--- src/main/resources/hudson/plugins/javatest_report/TestCollection/index.jelly 21 Aug 2007 01:35:41 -0000 1.3
+++ src/main/resources/hudson/plugins/javatest_report/TestCollection/index.jelly 26 Aug 2007 11:23:59 -0000
@@ -12,9 +12,45 @@
       <test:bar />
 
       <j:if test="${it.skippedTests.size()!=0}">
-        <a href="skipped/"><h2>Skipped tests: ${it.skippedTests.size()}</h2></a>
+          <a href="skipped/"><h2>Skipped tests: ${it.skippedTests.size()}</h2></a>
       </j:if>
 
+<j:catch var="exception">
+  <j:set var="size" value="${it.packages.size()}" />
+      <j:if test="${it.packages.size()!=0}">
+          <h2>Packages</h2>
+          <table class="pane sortable">
+  <tr>
+            <td class="pane-header">${it.childTitle}</td>
+            <td class="pane-header" style="width:5em">Fail</td>
+            <td class="pane-header" style="width:1em; font-size:smaller; white-space:nowrap;">(diff)</td>
+            <td class="pane-header" style="width:5em">Age</td>
+            <td class="pane-header" style="width:5em">Total</td>
+            <td class="pane-header" style="width:1em; font-size:smaller; white-space:nowrap;">(diff)</td>
+          </tr>
+            <j:forEach var="f" items="${it.getPackages()}" varStatus="i">
+            <j:set var="prev" value="${it.getPackageTests(f).previousResult}" />
+            <j:set var="curr" value="${it.getPackageTests(f)}" />
+                <tr>
+                  <td class="pane"><a href="packageTests/${f}">${f}</a></td>
+                  <td class="pane" style="text-align:right">${curr.failCount}</td>
+                  <td class="pane" style="text-align:right">
+                    ${h.getDiffString2(curr.failCount-prev.failCount)}
+                  </td>
+                  <td class="pane" style="text-align:right;">
+                      ${curr.age}
+                  </td>
+                  <td class="pane" style="text-align:right">${curr.totalCount}</td>
+                  <td class="pane" style="text-align:right">
+                    ${h.getDiffString2(curr.totalCount-prev.totalCount)}
+                  </td>
+                </tr>
+            </j:forEach>
+          </table>
+        </j:if>
+</j:catch>    
+
+<j:if test="${it.packages.size()==0}">
       <j:if test="${it.failCount!=0}">
           <h2>All Failed Tests</h2>
           <table class="pane sortable">
@@ -83,6 +119,8 @@
           </tbody>
         </table>
         </j:if>
+</j:if>
+
     </l:main-panel>
   </l:layout>
 </j:jelly>
Index: hudson/plugins/javatest-report/src/main/resources/hudson/plugins/javatest_report/Package/index.jelly
===================================================================
RCS file: hudson/plugins/javatest-report/src/main/resources/hudson/plugins/javatest_report/Package/index.jelly
diff -N hudson/plugins/javatest-report/src/main/resources/hudson/plugins/javatest_report/Package/index.jelly
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ hudson/plugins/javatest-report/src/main/resources/hudson/plugins/javatest_report/Package/index.jelly 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,83 @@
+<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:test="/lib/test">
+  <l:layout>
+    <st:include it="${it.owner}" page="sidepanel.jelly" />
+    <l:main-panel>
+      <h1>${it.displayName}</h1>
+
+      <div style="margin-top: 1em; margin-bottom: 1em;">
+        ${it.description}
+      </div>
+
+      <j:set var="prev" value="${it.previousResult}" />
+      <test:bar />
+      <j:if test="${it.failCount!=0}">
+          <h2>Failed Tests</h2>
+          <table class="pane sortable">
+            <tr>
+              <td class="pane-header">Test Name</td>
+              <td class="pane-header" style="width:6em">Status</td>
+              <td class="pane-header" style="width:4em">Age</td>
+            </tr>
+            <j:forEach var="f" items="${it.failedTests}" varStatus="i">
+              <j:set var="childCount" value="${f.children.size()}"/>
+              <tr>
+                <j:if test="${childCount==0}">
+                    <j:set var="foo" value="../../../../artifact/java-test-work/${f.statusMessage}"/>
+   <td class="pane"><a href="${foo}">${f.displayName}</a></td>
+                </j:if>
+                <j:if test="${childCount !=0}">
+                    <td class="pane"><a href="${f.id}/">${f.displayName}</a></td>
+                </j:if>
+                <td class="pane">${f.status}</td>
+                <td class="pane" style="text-align:right;">
+                  ${f.age}
+                </td>
+              </tr>
+            </j:forEach>
+          </table>
+        </j:if>
+        
+      <j:if test="${it.totalCount!=0}">
+        <h2>Tests</h2>
+        <table class="pane sortable" id="testresult">
+          <tr>
+            <td class="pane-header">${it.childTitle}</td>
+            <td class="pane-header" style="width:5em">Fail</td>
+            <td class="pane-header" style="width:1em; font-size:smaller; white-space:nowrap;">(diff)</td>
+            <td class="pane-header" style="width:5em">Age</td>
+            <td class="pane-header" style="width:5em">Total</td>
+            <td class="pane-header" style="width:1em; font-size:smaller; white-space:nowrap;">(diff)</td>
+          </tr>
+          <tbody>
+            <j:forEach var="p" items="${it.children}">
+              <j:set var="prev" value="${p.previousResult}" />
+              <j:set var="childCount" value="${p.children.size()}"/>
+              <j:if test="${!p.status.toString().equals('SKIP')}">
+              <tr>
+                <j:if test="${childCount==0}">
+                    <j:set var="foo" value="../../../../artifact/java-test-work/${p.statusMessage}"/>
+                    <td class="pane"><a href="${foo}">${p.displayName}</a></td>
+                </j:if>
+                <j:if test="${childCount !=0}">
+                    <td class="pane"><a href="${p.id}/">${p.displayName}</a></td>
+                </j:if>
+                <td class="pane" style="text-align:right">${p.failCount}</td>
+                <td class="pane" style="text-align:right">
+                  ${h.getDiffString2(p.failCount-prev.failCount)}
+                </td>
+                <td class="pane" style="text-align:right;">
+                    ${p.age}
+                </td>                
+                <td class="pane" style="text-align:right">${p.totalCount}</td>
+                <td class="pane" style="text-align:right">
+                  ${h.getDiffString2(p.totalCount-prev.totalCount)}
+                </td>
+              </tr>
+              </j:if>
+            </j:forEach>
+          </tbody>
+        </table>
+        </j:if>
+    </l:main-panel>
+  </l:layout>
+</j:jelly>
Index: hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/Package.java
===================================================================
RCS file: hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/Package.java
diff -N hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/Package.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ hudson/plugins/javatest-report/src/main/java/hudson/plugins/javatest_report/Package.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,13 @@
+package hudson.plugins.javatest_report;
+
+/**
+ *
+ * @author Vladimir Ralev
+ *
+ */
+public class Package extends TestCollection<Suite,Test> {
+    public String getChildTitle() {
+        return "Package";
+    }
+
+}

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

jt_hudson_packages.JPG (186K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JavaTest plugin enhancements and fixes

Kohsuke Kawaguchi
Administrator

Sorry for the delay in response.

Vladimir Ralev wrote:
> Hi, I'd be interested in getting commit access.

OK. Let me know your java.net ID so that I can add you as a developer.

 > In fact we just decided
> it makes more sense to do the report view based on packages and when you
> click on a package you get a list of the tests only in this package.
> Skipped packages are not displayed.  It appears most Sun TCKs only
> define one suite and put all tests inside. When breaking it into
> packages and separating the skipped tests in another section things seem
> more managable. I am also open for other suggestions. Attaching the
> patch for review and a screenshot.

I'm not hearing back from Rama, so let me commit this patch also. Again,
please don't be surprised if he later wants to make some adjustments
(although I suspect that won't happen.)


> Kohsuke Kawaguchi ъь?ис?:
>>
>> Sorry for the delay. My colleague Rama <[hidden email]> wrote
>> this plugin, so I just sent him a heads up.
>>
>> I'm going to commit this change in the mean time, but please don't be
>> surprised if he makes some additional changes.
>>
>> If you plan to make other changes to this plugin, would you be
>> interested in getting the commit access (so that you can commit
>> changes directly without getting blocked for 5 days)?
>>
>> Vladimir Ralev wrote:
>>> Hello,
>>>
>>> We needed a javatest plugin to run various TCKs and tried to use the
>>> one from the hudson repository. After some initial testing we found a
>>> few problems:
>>> 1. Skipped tests are counted as failing and the links in the report
>>> are broken (the jtr files do not exist)
>>> 2. The reports page can get very big with more complex TCKs
>>> 3. No distincion between FAIL and ERROR
>>> 4. Sometimes COF xml validation fails because of some disconnected URL
>>>
>>> So, attached is a patch with the following modifications:
>>> 1. Skipped tests are ignored in the results. This is because with
>>> larger TCKs sometimes you want to run only parts at a time of the TCK
>>> and the cof report generator will create many skipped tests slowing
>>> down the analysis (some TCKs have 20K+ tests while I am only
>>> interested in 10-100, see screenshot).
>>> 2. There is a separate page where you can still see the skipped tests
>>> (no links because there is nothig to point them to) to keep the first
>>> page managable.
>>> 3. Added a status column.
>>> 4. Skip validation of the cof xmls - depending on the cof generator
>>> used this causes troubles sometimes.
>>>
>>> Another change I can suggest is to add a jrt plaintext MIME type
>>> mapping in the hudson war's web.xml, which we are doing manually for
>>> now.
>>> The plugin was tested with several TCKs and works fine for us. Let me
>>> know what you think.
>>>
>>> Vladimir Ralev, JBoss / Red Hat
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]


smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JavaTest plugin enhancements and fixes

Vladimir Ralev-2
My java.net ID is vralev. Thanks.

Kohsuke Kawaguchi написа:

>
> Sorry for the delay in response.
>
> Vladimir Ralev wrote:
>> Hi, I'd be interested in getting commit access.
>
> OK. Let me know your java.net ID so that I can add you as a developer.
>
> > In fact we just decided
>> it makes more sense to do the report view based on packages and when
>> you click on a package you get a list of the tests only in this
>> package. Skipped packages are not displayed.  It appears most Sun
>> TCKs only define one suite and put all tests inside. When breaking it
>> into packages and separating the skipped tests in another section
>> things seem more managable. I am also open for other suggestions.
>> Attaching the patch for review and a screenshot.
>
> I'm not hearing back from Rama, so let me commit this patch also.
> Again, please don't be surprised if he later wants to make some
> adjustments (although I suspect that won't happen.)
>
>
>> Kohsuke Kawaguchi ъь?ис?:
>>>
>>> Sorry for the delay. My colleague Rama <[hidden email]>
>>> wrote this plugin, so I just sent him a heads up.
>>>
>>> I'm going to commit this change in the mean time, but please don't
>>> be surprised if he makes some additional changes.
>>>
>>> If you plan to make other changes to this plugin, would you be
>>> interested in getting the commit access (so that you can commit
>>> changes directly without getting blocked for 5 days)?
>>>
>>> Vladimir Ralev wrote:
>>>> Hello,
>>>>
>>>> We needed a javatest plugin to run various TCKs and tried to use
>>>> the one from the hudson repository. After some initial testing we
>>>> found a few problems:
>>>> 1. Skipped tests are counted as failing and the links in the report
>>>> are broken (the jtr files do not exist)
>>>> 2. The reports page can get very big with more complex TCKs
>>>> 3. No distincion between FAIL and ERROR
>>>> 4. Sometimes COF xml validation fails because of some disconnected URL
>>>>
>>>> So, attached is a patch with the following modifications:
>>>> 1. Skipped tests are ignored in the results. This is because with
>>>> larger TCKs sometimes you want to run only parts at a time of the
>>>> TCK and the cof report generator will create many skipped tests
>>>> slowing down the analysis (some TCKs have 20K+ tests while I am
>>>> only interested in 10-100, see screenshot).
>>>> 2. There is a separate page where you can still see the skipped
>>>> tests (no links because there is nothig to point them to) to keep
>>>> the first page managable.
>>>> 3. Added a status column.
>>>> 4. Skip validation of the cof xmls - depending on the cof generator
>>>> used this causes troubles sometimes.
>>>>
>>>> Another change I can suggest is to add a jrt plaintext MIME type
>>>> mapping in the hudson war's web.xml, which we are doing manually
>>>> for now.
>>>> The plugin was tested with several TCKs and works fine for us. Let
>>>> me know what you think.
>>>>
>>>> Vladimir Ralev, JBoss / Red Hat
>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: JavaTest plugin enhancements and fixes

Kohsuke Kawaguchi
Administrator
Vladimir Ralev wrote:
> My java.net ID is vralev. Thanks.

OK. Added. Welcome on board.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment