Permalink
Browse files

splitting out the failure count into it's own variable

  • Loading branch information...
1 parent 3d5b6fd commit 0040b66a9dbf89f352c8bdcd36b576ddc6c22ddf @JoelJ committed Jun 1, 2012
@@ -11,31 +11,37 @@
public static Column EMPTY = new Column();
private final String name;
+ private final int failureCount;
private final String url;
private final String buildStatusUrl;
private final boolean isEmpty;
private final boolean isPassed;
- private Column(String name, String url, String buildStatusUrl, boolean isEmpty) {
+ private Column(String name, int failureCount, String url, String buildStatusUrl, boolean isEmpty) {
this.name = name;
+ this.failureCount = failureCount;
this.url = url;
this.buildStatusUrl = buildStatusUrl;
this.isEmpty = isEmpty;
this.isPassed = this.buildStatusUrl.contains("blue.png");
}
- public Column(String name, String url, String buildStatusUrl) {
- this(name, url, buildStatusUrl, false);
+ public Column(String name, int failureCount, String url, String buildStatusUrl) {
+ this(name, failureCount, url, buildStatusUrl, false);
}
private Column() {
- this("", "", "", true);
+ this("", -1, "", "", true);
}
public String getName() {
return name;
}
+ public int getFailureCount() {
+ return failureCount;
+ }
+
public String getUrl() {
return url;
}
@@ -186,22 +186,18 @@ public int compare(Row row1, Row row2) {
if(showBuildName && build.getDisplayName() != null) {
rowDisplayName = build.getDisplayName();
}
-
- if(showFailureCount) {
- String testResult = "";
+
+ //Only show the count if it's Successful or Unstable
+ // (Successful because of the Status override plugin.)
+ int failureCount = -1;
+ if(showFailureCount && (build.getResult() == Result.SUCCESS || build.getResult() == Result.UNSTABLE)) {
AbstractTestResultAction testResultAction = build.getAction(AbstractTestResultAction.class);
if(testResultAction != null) {
- int failures = testResultAction.getFailCount();
-// testResult += failures;
- testResult = "(" + failures + " failures" + ")";
- }
- if(!rowDisplayName.isEmpty()) {
- rowDisplayName += " ";
+ failureCount = testResultAction.getFailCount();
}
- rowDisplayName += testResult;
}
- columns.add(new Column(rowDisplayName, build.getUrl(), rootUrl + "/static/832a5f9d/images/" + ORB_SIZE + "/" + build.getBuildStatusUrl()));
+ columns.add(new Column(rowDisplayName, failureCount, build.getUrl(), rootUrl + "/static/832a5f9d/images/" + ORB_SIZE + "/" + build.getBuildStatusUrl()));
//noinspection StringEquality
if(displayName == rowName && build.getDescription() != null && !build.getDescription().trim().isEmpty()) { // I really do want to do reference equals and not value equals.
@@ -47,6 +47,14 @@
width: 16px;
height: 16px;
}
+
+ .build .name {
+ padding-right: 2px;
+ }
+
+ .build .failureCount {
+ padding-left: 2px;
+ }
<!--
.build a {
text-decoration: none;
@@ -119,10 +127,17 @@
<j:forEach items="${row.getColumns()}" var="column">
<td class="build" url="${column.getUrl()}">
<j:if test="${!column.isEmpty()}">
- <a href="${column.getUrl()}testReport">
+ <a class="status" href="${column.getUrl()}console">
<img src="${column.getBuildStatusUrl()}"/>
- <span>${column.getName()}</span>
</a>
+ <span>
+ <j:if test="${column.getName().length() > -1}">
+ <a class="name" href="${column.getUrl()}">${column.getName()}</a>
+ </j:if>
+ <j:if test="${column.getFailureCount() > -1}">
+ <a class="failureCount" href="${column.getUrl()}testReport">(${column.getFailureCount()} failures)</a>
+ </j:if>
+ </span>
</j:if>
<j:if test="${column.isEmpty()}">
<span>?</span>

0 comments on commit 0040b66

Please sign in to comment.