Skip to content

Commit

Permalink
Added summary.jelly to FlowTestResults that should have corrent links…
Browse files Browse the repository at this point in the history
… to broken tests. Fixes zeroturnaround#13
  • Loading branch information
Tõnis Pool committed Aug 30, 2015
1 parent 89ee700 commit 4c0cc0c
Showing 1 changed file with 80 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<!--
The MIT License
Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi,
Daniel Dyer, Red Hat, Inc., Seiji Sogabe, id:cactusman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->

<?jelly escape-by-default='true'?>
<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:i="jelly:fmt">

<script type="text/javascript">
function showFailures() {

var elms = document.getElementsByClassName("hidden");
for(var i = 0; i &lt; elms.length; i++) {
elms[i].style.display = "";
}
elm = document.getElementById("showLink");
elm.style.display = "none";
}
</script>

<!-- summary -->
<t:summary icon="clipboard.png">
<a href="${it.urlName}/">${it.displayName}</a>
<st:nbsp/>
<t:test-result />

<j:set var="failedTests" value="${it.failedTests}" />
<j:if test="${failedTests != null}">
<j:set var="failedIterator" value="${failedTests.iterator()}" />
<j:set var="displayedCount" value="${1}" />
<ul style="list-style-type: none; margin: 0;">
<j:while test="${failedIterator.hasNext()}">
<j:set var="testObject" value="${failedIterator.next()}" />
<!-- CaseResult -->
<j:set var="elementClass" value="hidden" />
<j:set var="elementStyle" value="display:none" />

<!-- Show max 10 failures from this build -->
<j:if test="${((testObject.age == 1) &amp;&amp; (displayedCount &lt;= 10))}">
<j:set var="displayedCount" value="${displayedCount + 1}" />
<j:set var="elementClass" value="shown" />
<j:set var="elementStyle" value="" />
</j:if>

<li class="${elementClass}" style="${elementStyle}">
<!-- child test results are referenced from their parent builds -->
<j:set var="build" value="${testObject.owner}" />
<a href="${rootURL}/${testObject.owner.url}${it.getTestResultPath(testObject)}">
<st:out value="${testObject.fullName}" />
</a>
</li>
</j:while>
</ul>

<!-- Show failures link -->
<j:if test="${displayedCount &lt; failedTests.size() }">
<a id="showLink" name="editFailuresLink"
href="#showFailuresLink"
onclick="javascript:showFailures()">${%Show all failed tests} ${">>>"}</a>
</j:if>
</j:if>

</t:summary>
</j:jelly>

0 comments on commit 4c0cc0c

Please sign in to comment.