diff --git a/.gitignore b/.gitignore index d0d4738..1123396 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ dist /RUNNING_PID /bin /.project +.settings/org.eclipse.jdt.core.prefs diff --git a/app/analysis/analyzers/RunAnalyzer.java b/app/analysis/analyzers/RunAnalyzer.java index 6107201..8276db3 100644 --- a/app/analysis/analyzers/RunAnalyzer.java +++ b/app/analysis/analyzers/RunAnalyzer.java @@ -36,9 +36,9 @@ public Build analyze() { Build build = new Build(); build.setBuildNumber(m_buildParser.getBuildNumber()); - build.setStatus(m_buildParser.getStatus()); build.setTimestamp(m_buildParser.getTimestamp()); + build.setDuration(m_buildParser.getDuration()); build.setJob(m_job); build.setUrl(m_buildParser.getUrl()); setDisplayName(build); diff --git a/app/jsonhandling/RunParser.java b/app/jsonhandling/RunParser.java index b79260c..ff27ec4 100644 --- a/app/jsonhandling/RunParser.java +++ b/app/jsonhandling/RunParser.java @@ -44,6 +44,11 @@ public long getTimestamp() { return path("timestamp").asLong(); } + + public long getDuration() + { + return path("duration").asLong(); + } public long getEstimatedDuration() { @@ -93,6 +98,18 @@ public TestReportParser loadTestReport(final JsonReader reader) { throw new IllegalStateException("There is not testReport available"); } - return new TestReportParser(reader.getJSonResult(getUrl() + "testReport")); + String filterForJSONOutput = ""; + // Commented out below lines because not all test-failure related data is retrieved using below filter + /* + // Below filterForJSONOutput is added because 'stdout' in 'suites[cases[stdout]]]' can blow up returned JSON response above 1GB but it is never used + String suitesSelector = "suites[duration,id,name,timestamp,cases[age,className,duration,errorDetails,errorStackTrace,failedSince,name,skipped,status]]"; + String testReportSelector = "*,childReports[child[number,url],result[*,"+suitesSelector+"]],"+suitesSelector; + + try { + filterForJSONOutput = "/api/json?tree=" + java.net.URLEncoder.encode(testReportSelector,"UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + }*/ + return new TestReportParser(reader.getJSonResult(getUrl() + "testReport" + filterForJSONOutput)); } } diff --git a/app/model/jenkins/Build.java b/app/model/jenkins/Build.java index 1e93b19..42e1904 100644 --- a/app/model/jenkins/Build.java +++ b/app/model/jenkins/Build.java @@ -37,6 +37,8 @@ public class Build extends EntityBase @Required private Long timestamp; + + private Long duration; private String displayName; @@ -99,6 +101,16 @@ public void setTimestamp(final Long timestamp) this.timestamp = timestamp; } + public Long getDuration() + { + return duration; + } + + public void setDuration(final Long duration) + { + this.duration = duration; + } + public void setStatus(final BuildStatus buildStatus) { status = buildStatus.asText(); @@ -183,7 +195,7 @@ public String getUrl() return url; } - public void setUrl(String url) + public void setUrl(final String url) { this.url = url; } diff --git a/app/model/user/User.java b/app/model/user/User.java index da6fc4e..ed81f12 100644 --- a/app/model/user/User.java +++ b/app/model/user/User.java @@ -38,7 +38,7 @@ public String getUserName() return userName; } - public void setUserName(String userName) + public void setUserName(final String userName) { this.userName = userName; } @@ -48,7 +48,7 @@ public String getFullName() return fullName; } - public void setFullName(String fullName) + public void setFullName(final String fullName) { this.fullName = fullName; } @@ -58,7 +58,7 @@ public String getEmailAddress() return emailAddress; } - public void setEmailAddress(String emailAddress) + public void setEmailAddress(final String emailAddress) { this.emailAddress = emailAddress; } diff --git a/public/partials/task/task.item.dashboard.html b/public/partials/task/task.item.dashboard.html index b94e158..17465b2 100644 --- a/public/partials/task/task.item.dashboard.html +++ b/public/partials/task/task.item.dashboard.html @@ -5,7 +5,7 @@ {{task.summary}} Updated: {{task.updateDate | date:'MM/dd/yy HH:mm'}} - + diff --git a/public/partials/task/task.item.panel.html b/public/partials/task/task.item.panel.html index 832d4c7..a93a02e 100644 --- a/public/partials/task/task.item.panel.html +++ b/public/partials/task/task.item.panel.html @@ -4,7 +4,7 @@ {{task.summary}} {{task.updateDate | date:'MM/dd/yy @ h:mma'}} - + \ No newline at end of file diff --git a/public/partials/user/detail.html b/public/partials/user/detail.html index 7fe2c94..be0bdbf 100644 --- a/public/partials/user/detail.html +++ b/public/partials/user/detail.html @@ -4,7 +4,7 @@ Edit user {{user.userName}} - + Username diff --git a/public/partials/user/list.html b/public/partials/user/list.html index 7e1aa07..24bbbc2 100644 --- a/public/partials/user/list.html +++ b/public/partials/user/list.html @@ -19,7 +19,7 @@ {{user.userName}} {{user.fullName}} {{user.emailAddress}} - +