Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-19884] Unify test failure presentation
- SurefireAggregatedReport lists all aggregated failures now (its maven counterpart MatrixTestResult does it already) - Failure summary is available wherever applicable
- Loading branch information
1 parent
f98070d
commit 9b1bcb8
Showing
4 changed files
with
136 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
core/src/main/resources/lib/hudson/aggregated-failed-tests.jelly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<!-- | ||
The MIT License | ||
Copyright (c) 20013 Red Hat, Inc. | ||
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"> | ||
<st:documentation> | ||
Display links to failed test from all child reports. | ||
@since TODO | ||
<st:attribute name="it" type="AggregatedTestResultAction"> | ||
Aggregated action. | ||
</st:attribute> | ||
</st:documentation> | ||
|
||
<j:if test="${it.failCount!=0}"> | ||
<br/> | ||
<h2>Failed Tests</h2> | ||
|
||
<j:forEach var="report" items="${it.childReports}"> | ||
<j:if test="${report.result.failCount!=0}"> | ||
|
||
<h3> | ||
<a name="${report.child.project.name}"/> | ||
<a href="../${report.child.project.shortUrl}testReport" class="model-link inside">${report.child.project.name}</a> | ||
</h3> | ||
|
||
<table class="pane sortable"> | ||
<tr> | ||
<td class="pane-header">Test Name</td> | ||
<td class="pane-header" style="width:4em">Duration</td> | ||
<td class="pane-header" style="width:4em">Age</td> | ||
</tr> | ||
<j:forEach var="f" items="${report.result.failedTests}" varStatus="i"> | ||
<tr> | ||
<td class="pane"><t:failed-test result="${f}" url="../${report.child.project.shortUrl}testReport/${f.getRelativePathFrom(report.result)}"/></td> | ||
<td class="pane" style="text-align:right;">${f.duration}</td> | ||
<td class="pane" style="text-align:right;">${f.age}</td> | ||
</tr> | ||
</j:forEach> | ||
</table> | ||
</j:if> | ||
</j:forEach> | ||
</j:if> | ||
</j:jelly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<!-- | ||
The MIT License | ||
Copyright (c) 20013 Red Hat, Inc. | ||
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"> | ||
<st:documentation> | ||
Display link to the failed test. | ||
@since TODO | ||
<st:attribute name="url" type="String"> | ||
Path to the failed test. | ||
</st:attribute> | ||
<st:attribute name="result" type="TestObject"> | ||
Failed test object | ||
</st:attribute> | ||
</st:documentation> | ||
<st:once> | ||
<script type="text/javascript"> | ||
<!-- TODO make sure load doesn't happen every time --> | ||
function showStackTrace(id,query) { | ||
var element = document.getElementById(id) | ||
element.style.display = ""; | ||
document.getElementById(id + "-showlink").style.display = "none"; | ||
document.getElementById(id + "-hidelink").style.display = ""; | ||
|
||
var rqo = new XMLHttpRequest(); | ||
rqo.open('GET', query, true); | ||
rqo.onreadystatechange = function() { element.innerHTML = rqo.responseText; } | ||
rqo.send(null); | ||
} | ||
|
||
function hideStackTrace(id) { | ||
document.getElementById(id).style.display = "none"; | ||
document.getElementById(id + "-showlink").style.display = ""; | ||
document.getElementById(id + "-hidelink").style.display = "none"; | ||
} | ||
</script> | ||
</st:once> | ||
<j:set var="id" value="${h.jsStringEscape(url)}"/> | ||
<j:set var="open" value="javascript:showStackTrace('test-${id}','${url}/summary')"/> | ||
<j:set var="close" value="javascript:hideStackTrace('test-${id}')"/> | ||
<a id="test-${id}-showlink" href="${open}" title="${%Show details}">>>></a> | ||
<a id="test-${id}-hidelink" href="${close}" title="${%Hide details}" style="display:none"><<<</a> | ||
<st:nbsp/> | ||
<a href="${url}" class="model-link inside"><st:out value="${result.fullDisplayName}"/></a> | ||
<j:forEach var="badge" items="${result.testActions}"> | ||
<st:include it="${badge}" page="badge.jelly" optional="true"/> | ||
</j:forEach> | ||
<div id="test-${id}" class="hidden" style="display:none">${%Loading...}</div> | ||
</j:jelly> |