From 1f7c30eff4e1bc207e000b37fb680594af8165ca Mon Sep 17 00:00:00 2001 From: jhaverhals Date: Wed, 18 May 2016 10:58:54 +0200 Subject: [PATCH 01/16] Update avatar URL for a user + refactoring Add domainname to avatar URL + refactoring so that the URL is now defined on a single location. --- app/model/user/User.java | 14 ++++++++++++++ public/partials/task/task.item.dashboard.html | 2 +- public/partials/task/task.item.panel.html | 2 +- public/partials/user/detail.html | 2 +- public/partials/user/list.html | 2 +- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/model/user/User.java b/app/model/user/User.java index da6fc4e..77ddb98 100644 --- a/app/model/user/User.java +++ b/app/model/user/User.java @@ -20,6 +20,8 @@ public class User extends EntityBase private String fullName; private String emailAddress; + + private String avatarURL; @Override protected void setId(final Long id) @@ -41,6 +43,7 @@ public String getUserName() public void setUserName(String userName) { this.userName = userName; + setAvatarURL(userName); } public String getFullName() @@ -62,4 +65,15 @@ public void setEmailAddress(String emailAddress) { this.emailAddress = emailAddress; } + + public String getAvatarURL() + { + return avatarURL; + } + + public String setAvatarURL(String userName) + { + /* Below URL is of the Crucible ( codereview ) server */ + this.avatarURL = "http://srv-ind-scrat.vanenburg.com:8060/avatar/" + userName; + } } diff --git a/public/partials/task/task.item.dashboard.html b/public/partials/task/task.item.dashboard.html index b94e158..94ac915 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..59d954d 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..c8c4c0b 100644 --- a/public/partials/user/detail.html +++ b/public/partials/user/detail.html @@ -4,7 +4,7 @@
Edit user {{user.userName}}
- +
diff --git a/public/partials/user/list.html b/public/partials/user/list.html index 7e1aa07..0a4bbc0 100644 --- a/public/partials/user/list.html +++ b/public/partials/user/list.html @@ -19,7 +19,7 @@ {{user.userName}} {{user.fullName}} {{user.emailAddress}} - + From 26ff9ad4c0dbc0eec7438a0b20c6dfaa3fb3f9e8 Mon Sep 17 00:00:00 2001 From: jhaverhals Date: Mon, 5 Sep 2016 11:16:30 +0200 Subject: [PATCH 02/16] Added JSON ouput filter for TestReport JSONOutputFilter is added because 'stdout' in /job/junitTestJob/1/testReport/api/json ( 'suites[cases[stdout]]]' ) can blow up returned JSON response above 1GB but it is never used --- app/jsonhandling/RunParser.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/jsonhandling/RunParser.java b/app/jsonhandling/RunParser.java index b79260c..a569cec 100644 --- a/app/jsonhandling/RunParser.java +++ b/app/jsonhandling/RunParser.java @@ -93,6 +93,8 @@ public TestReportParser loadTestReport(final JsonReader reader) { throw new IllegalStateException("There is not testReport available"); } - return new TestReportParser(reader.getJSonResult(getUrl() + "testReport")); + // Below JSONOutputFilter is added because 'stdout' in 'suites[cases[stdout]]]' can blow up returned JSON response above 1GB but it is never used + String JSONOutputFilter = "/api/json?pretty=true&tree=duration,empty,failCount,passCount,skipCount,suites[cases[age,className,duration,errorDetails,errorStackTrace,failedSince,name,skipped,status],duration,id,name,timestamp]"; + return new TestReportParser(reader.getJSonResult(getUrl() + "testReport" + JSONOutputFilter)); } } From 95329dbbf74381b05453a092772ba55f15e4722a Mon Sep 17 00:00:00 2001 From: jhaverhals Date: Mon, 5 Sep 2016 11:39:12 +0200 Subject: [PATCH 03/16] Fix missing return statement in setAvatarUrl --- app/model/user/User.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/model/user/User.java b/app/model/user/User.java index 77ddb98..e3b1f8b 100644 --- a/app/model/user/User.java +++ b/app/model/user/User.java @@ -40,7 +40,7 @@ public String getUserName() return userName; } - public void setUserName(String userName) + public void setUserName(final String userName) { this.userName = userName; setAvatarURL(userName); @@ -51,7 +51,7 @@ public String getFullName() return fullName; } - public void setFullName(String fullName) + public void setFullName(final String fullName) { this.fullName = fullName; } @@ -61,7 +61,7 @@ public String getEmailAddress() return emailAddress; } - public void setEmailAddress(String emailAddress) + public void setEmailAddress(final String emailAddress) { this.emailAddress = emailAddress; } @@ -71,9 +71,9 @@ public String getAvatarURL() return avatarURL; } - public String setAvatarURL(String userName) + public String setAvatarURL(final String userName) { /* Below URL is of the Crucible ( codereview ) server */ - this.avatarURL = "http://srv-ind-scrat.vanenburg.com:8060/avatar/" + userName; + return this.avatarURL = "http://srv-ind-scrat.vanenburg.com:8060/avatar/" + userName; } } From 7de4b52b10a0382c38f0d7b7f784c7de214b6b03 Mon Sep 17 00:00:00 2001 From: jhaverhals Date: Mon, 5 Sep 2016 11:42:28 +0200 Subject: [PATCH 04/16] Enhanced JSONOutputFilter for TestReport --- app/jsonhandling/RunParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jsonhandling/RunParser.java b/app/jsonhandling/RunParser.java index a569cec..36c1ff6 100644 --- a/app/jsonhandling/RunParser.java +++ b/app/jsonhandling/RunParser.java @@ -94,7 +94,7 @@ public TestReportParser loadTestReport(final JsonReader reader) throw new IllegalStateException("There is not testReport available"); } // Below JSONOutputFilter is added because 'stdout' in 'suites[cases[stdout]]]' can blow up returned JSON response above 1GB but it is never used - String JSONOutputFilter = "/api/json?pretty=true&tree=duration,empty,failCount,passCount,skipCount,suites[cases[age,className,duration,errorDetails,errorStackTrace,failedSince,name,skipped,status],duration,id,name,timestamp]"; + String JSONOutputFilter = "/api/json?tree=duration,empty,failCount,passCount,skipCount,suites[cases[age,className,duration,errorDetails,errorStackTrace,failedSince,name,skipped,status],duration,id,name,timestamp]"; return new TestReportParser(reader.getJSonResult(getUrl() + "testReport" + JSONOutputFilter)); } } From 5180ae43b8cbdcac470085fa99409de882052103 Mon Sep 17 00:00:00 2001 From: jhaverhals Date: Mon, 5 Sep 2016 11:52:49 +0200 Subject: [PATCH 05/16] URL encoding of JSON output filter of TestReport --- app/jsonhandling/RunParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jsonhandling/RunParser.java b/app/jsonhandling/RunParser.java index 36c1ff6..a71c982 100644 --- a/app/jsonhandling/RunParser.java +++ b/app/jsonhandling/RunParser.java @@ -94,7 +94,7 @@ public TestReportParser loadTestReport(final JsonReader reader) throw new IllegalStateException("There is not testReport available"); } // Below JSONOutputFilter is added because 'stdout' in 'suites[cases[stdout]]]' can blow up returned JSON response above 1GB but it is never used - String JSONOutputFilter = "/api/json?tree=duration,empty,failCount,passCount,skipCount,suites[cases[age,className,duration,errorDetails,errorStackTrace,failedSince,name,skipped,status],duration,id,name,timestamp]"; + String JSONOutputFilter = "/api/json?tree=duration%2Cempty%2CfailCount%2CpassCount%2CskipCount%2Csuites%5Bcases%5Bage%2CclassName%2Cduration%2CerrorDetails%2CerrorStackTrace%2CfailedSince%2Cname%2Cskipped%2Cstatus%5D%2Cduration%2Cid%2Cname%2Ctimestamp%5D"; return new TestReportParser(reader.getJSonResult(getUrl() + "testReport" + JSONOutputFilter)); } } From 973b9c977b48aa579a9b9e1ab51ff5ea3f5de302 Mon Sep 17 00:00:00 2001 From: jhaverhals Date: Mon, 5 Sep 2016 15:30:38 +0200 Subject: [PATCH 06/16] Correct return type of setAvatarURL --- app/model/user/User.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/model/user/User.java b/app/model/user/User.java index e3b1f8b..21e7f63 100644 --- a/app/model/user/User.java +++ b/app/model/user/User.java @@ -71,9 +71,9 @@ public String getAvatarURL() return avatarURL; } - public String setAvatarURL(final String userName) + public void setAvatarURL(final String userName) { /* Below URL is of the Crucible ( codereview ) server */ - return this.avatarURL = "http://srv-ind-scrat.vanenburg.com:8060/avatar/" + userName; + this.avatarURL = "http://srv-ind-scrat.vanenburg.com:8060/avatar/" + userName; } } From 16c5db4f0663d6b0367b805169fbf745eb3edca5 Mon Sep 17 00:00:00 2001 From: jhaverhals Date: Mon, 5 Sep 2016 16:04:30 +0200 Subject: [PATCH 07/16] Revert avatarURL from User + updated hardcoded URL --- app/model/user/User.java | 14 -------------- public/partials/task/task.item.dashboard.html | 2 +- public/partials/task/task.item.panel.html | 2 +- public/partials/user/detail.html | 2 +- public/partials/user/list.html | 2 +- 5 files changed, 4 insertions(+), 18 deletions(-) diff --git a/app/model/user/User.java b/app/model/user/User.java index 21e7f63..ed81f12 100644 --- a/app/model/user/User.java +++ b/app/model/user/User.java @@ -20,8 +20,6 @@ public class User extends EntityBase private String fullName; private String emailAddress; - - private String avatarURL; @Override protected void setId(final Long id) @@ -43,7 +41,6 @@ public String getUserName() public void setUserName(final String userName) { this.userName = userName; - setAvatarURL(userName); } public String getFullName() @@ -65,15 +62,4 @@ public void setEmailAddress(final String emailAddress) { this.emailAddress = emailAddress; } - - public String getAvatarURL() - { - return avatarURL; - } - - public void setAvatarURL(final String userName) - { - /* Below URL is of the Crucible ( codereview ) server */ - this.avatarURL = "http://srv-ind-scrat.vanenburg.com:8060/avatar/" + userName; - } } diff --git a/public/partials/task/task.item.dashboard.html b/public/partials/task/task.item.dashboard.html index 94ac915..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 59d954d..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 c8c4c0b..be0bdbf 100644 --- a/public/partials/user/detail.html +++ b/public/partials/user/detail.html @@ -4,7 +4,7 @@
Edit user {{user.userName}}
- +
diff --git a/public/partials/user/list.html b/public/partials/user/list.html index 0a4bbc0..24bbbc2 100644 --- a/public/partials/user/list.html +++ b/public/partials/user/list.html @@ -19,7 +19,7 @@ {{user.userName}} {{user.fullName}} {{user.emailAddress}} - + From d733e467d11eebc3e6a16ed8a9b097e78dbc4aae Mon Sep 17 00:00:00 2001 From: jhaverhals Date: Mon, 5 Sep 2016 17:21:52 +0200 Subject: [PATCH 08/16] lowerCased first character variable + url encoding --- app/jsonhandling/RunParser.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/jsonhandling/RunParser.java b/app/jsonhandling/RunParser.java index a71c982..47bc99c 100644 --- a/app/jsonhandling/RunParser.java +++ b/app/jsonhandling/RunParser.java @@ -1,5 +1,7 @@ package jsonhandling; +import java.io.UnsupportedEncodingException; + import com.fasterxml.jackson.databind.JsonNode; public class RunParser extends BaseParser @@ -87,14 +89,14 @@ public long getFailedTestCount() return testActionNode.path("failCount").asLong(); } - public TestReportParser loadTestReport(final JsonReader reader) + public TestReportParser loadTestReport(final JsonReader reader) throws UnsupportedEncodingException { if (!hasTestResults()) { throw new IllegalStateException("There is not testReport available"); } // Below JSONOutputFilter is added because 'stdout' in 'suites[cases[stdout]]]' can blow up returned JSON response above 1GB but it is never used - String JSONOutputFilter = "/api/json?tree=duration%2Cempty%2CfailCount%2CpassCount%2CskipCount%2Csuites%5Bcases%5Bage%2CclassName%2Cduration%2CerrorDetails%2CerrorStackTrace%2CfailedSince%2Cname%2Cskipped%2Cstatus%5D%2Cduration%2Cid%2Cname%2Ctimestamp%5D"; - return new TestReportParser(reader.getJSonResult(getUrl() + "testReport" + JSONOutputFilter)); + String filterForJSONOutput = "/api/json?tree="+java.net.URLEncoder.encode("duration,empty,failCount,passCount,skipCount,suites[cases[age,className,duration,errorDetails,errorStackTrace,failedSince,name,skipped,status],duration,id,name,timestamp]","UTF-8"); + return new TestReportParser(reader.getJSonResult(getUrl() + "testReport" + filterForJSONOutput)); } } From 69dd6bd09656b7efd5aa7a1ca419becf5b02958d Mon Sep 17 00:00:00 2001 From: jhaverhals Date: Mon, 5 Sep 2016 17:24:34 +0200 Subject: [PATCH 09/16] Changed error handling in RunParser --- app/jsonhandling/RunParser.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/jsonhandling/RunParser.java b/app/jsonhandling/RunParser.java index 47bc99c..b459252 100644 --- a/app/jsonhandling/RunParser.java +++ b/app/jsonhandling/RunParser.java @@ -89,14 +89,19 @@ public long getFailedTestCount() return testActionNode.path("failCount").asLong(); } - public TestReportParser loadTestReport(final JsonReader reader) throws UnsupportedEncodingException + public TestReportParser loadTestReport(final JsonReader reader) { if (!hasTestResults()) { throw new IllegalStateException("There is not testReport available"); } // Below JSONOutputFilter is added because 'stdout' in 'suites[cases[stdout]]]' can blow up returned JSON response above 1GB but it is never used - String filterForJSONOutput = "/api/json?tree="+java.net.URLEncoder.encode("duration,empty,failCount,passCount,skipCount,suites[cases[age,className,duration,errorDetails,errorStackTrace,failedSince,name,skipped,status],duration,id,name,timestamp]","UTF-8"); + String filterForJSONOutput = ""; + try { + filterForJSONOutput = "/api/json?tree="+java.net.URLEncoder.encode("duration,empty,failCount,passCount,skipCount,suites[cases[age,className,duration,errorDetails,errorStackTrace,failedSince,name,skipped,status],duration,id,name,timestamp]","UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } return new TestReportParser(reader.getJSonResult(getUrl() + "testReport" + filterForJSONOutput)); } } From 08cdba7eb7436bc55e5d1578ff4b44645ad5e3d4 Mon Sep 17 00:00:00 2001 From: jhaverhals Date: Tue, 6 Sep 2016 12:02:05 +0200 Subject: [PATCH 10/16] Refined Jenkins JSON output filter for TestReports --- .gitignore | 1 + app/jsonhandling/RunParser.java | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) 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/jsonhandling/RunParser.java b/app/jsonhandling/RunParser.java index b459252..3f7a193 100644 --- a/app/jsonhandling/RunParser.java +++ b/app/jsonhandling/RunParser.java @@ -95,10 +95,11 @@ public TestReportParser loadTestReport(final JsonReader reader) { throw new IllegalStateException("There is not testReport available"); } - // Below JSONOutputFilter is added because 'stdout' in 'suites[cases[stdout]]]' can blow up returned JSON response above 1GB but it is never used - String filterForJSONOutput = ""; + // 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 filterForJSONOutput = "/api/json?tree=*,childReports[child[number,url],result[*,"+suitesSelector+"]],"+suitesSelector; try { - filterForJSONOutput = "/api/json?tree="+java.net.URLEncoder.encode("duration,empty,failCount,passCount,skipCount,suites[cases[age,className,duration,errorDetails,errorStackTrace,failedSince,name,skipped,status],duration,id,name,timestamp]","UTF-8"); + filterForJSONOutput = java.net.URLEncoder.encode(filterForJSONOutput,"UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } From 88b50c62568f50191d1549c2055063fd1ba705da Mon Sep 17 00:00:00 2001 From: jhaverhals Date: Wed, 7 Sep 2016 08:16:10 +0200 Subject: [PATCH 11/16] Skip part of URL for encoding --- app/jsonhandling/RunParser.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/jsonhandling/RunParser.java b/app/jsonhandling/RunParser.java index 3f7a193..1d45939 100644 --- a/app/jsonhandling/RunParser.java +++ b/app/jsonhandling/RunParser.java @@ -97,9 +97,10 @@ public TestReportParser loadTestReport(final JsonReader reader) } // 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 filterForJSONOutput = "/api/json?tree=*,childReports[child[number,url],result[*,"+suitesSelector+"]],"+suitesSelector; + String testReportSelector = "*,childReports[child[number,url],result[*,"+suitesSelector+"]],"+suitesSelector; + String filterForJSONOutput = "/api/json?tree="; try { - filterForJSONOutput = java.net.URLEncoder.encode(filterForJSONOutput,"UTF-8"); + filterForJSONOutput.concat(java.net.URLEncoder.encode(testReportSelector,"UTF-8")); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } From c8934bef7853c351cf1e7a58bb5f7e422c581d95 Mon Sep 17 00:00:00 2001 From: jhaverhals Date: Wed, 7 Sep 2016 08:26:01 +0200 Subject: [PATCH 12/16] filterForJSONOutput is now "" when URLencode fails --- app/jsonhandling/RunParser.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/jsonhandling/RunParser.java b/app/jsonhandling/RunParser.java index 1d45939..bda0d4d 100644 --- a/app/jsonhandling/RunParser.java +++ b/app/jsonhandling/RunParser.java @@ -98,9 +98,9 @@ public TestReportParser loadTestReport(final JsonReader reader) // 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; - String filterForJSONOutput = "/api/json?tree="; + String filterForJSONOutput = ""; try { - filterForJSONOutput.concat(java.net.URLEncoder.encode(testReportSelector,"UTF-8")); + filterForJSONOutput = "/api/json?tree=" + java.net.URLEncoder.encode(testReportSelector,"UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } From 627ee88d0cada943f72489a10614575a148c604f Mon Sep 17 00:00:00 2001 From: jhaverhals Date: Mon, 3 Oct 2016 11:27:16 +0200 Subject: [PATCH 13/16] Disable additional JSON output filter for Jenkins --- app/jsonhandling/RunParser.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/jsonhandling/RunParser.java b/app/jsonhandling/RunParser.java index bda0d4d..a545511 100644 --- a/app/jsonhandling/RunParser.java +++ b/app/jsonhandling/RunParser.java @@ -1,7 +1,5 @@ package jsonhandling; -import java.io.UnsupportedEncodingException; - import com.fasterxml.jackson.databind.JsonNode; public class RunParser extends BaseParser @@ -95,15 +93,18 @@ public TestReportParser loadTestReport(final JsonReader reader) { throw new IllegalStateException("There is not testReport available"); } + 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; - String filterForJSONOutput = ""; + 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)); } } From f8c5fe356beeab041de0c90ff1d5f2086bc7ef15 Mon Sep 17 00:00:00 2001 From: jhaverhals Date: Tue, 11 Oct 2016 10:21:19 +0200 Subject: [PATCH 14/16] Now also parsing the duration of a job --- app/analysis/analyzers/RunAnalyzer.java | 2 +- app/jsonhandling/RunParser.java | 5 +++++ app/model/jenkins/Build.java | 14 +++++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) 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 a545511..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() { 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; } From f03348fdbe171fc6e96ea3f79f1002fa0cf746d7 Mon Sep 17 00:00:00 2001 From: jhaverhals Date: Wed, 16 Nov 2016 10:07:35 +0100 Subject: [PATCH 15/16] Remove commented-out part of JSON output filter --- app/jsonhandling/RunParser.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/jsonhandling/RunParser.java b/app/jsonhandling/RunParser.java index ff27ec4..2023127 100644 --- a/app/jsonhandling/RunParser.java +++ b/app/jsonhandling/RunParser.java @@ -1,5 +1,7 @@ package jsonhandling; +import java.io.UnsupportedEncodingException; + import com.fasterxml.jackson.databind.JsonNode; public class RunParser extends BaseParser @@ -100,7 +102,7 @@ public TestReportParser loadTestReport(final JsonReader reader) } 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; @@ -109,7 +111,7 @@ public TestReportParser loadTestReport(final JsonReader reader) filterForJSONOutput = "/api/json?tree=" + java.net.URLEncoder.encode(testReportSelector,"UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); - }*/ + } return new TestReportParser(reader.getJSonResult(getUrl() + "testReport" + filterForJSONOutput)); } } From 43a41ef4f19053bfd5428c53c4bd22024c8b91f6 Mon Sep 17 00:00:00 2001 From: jhaverhals Date: Thu, 17 Nov 2016 12:02:32 +0100 Subject: [PATCH 16/16] Revert "Remove commented-out part of JSON output filter" This reverts commit f03348fdbe171fc6e96ea3f79f1002fa0cf746d7. --- app/jsonhandling/RunParser.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/jsonhandling/RunParser.java b/app/jsonhandling/RunParser.java index 2023127..ff27ec4 100644 --- a/app/jsonhandling/RunParser.java +++ b/app/jsonhandling/RunParser.java @@ -1,7 +1,5 @@ package jsonhandling; -import java.io.UnsupportedEncodingException; - import com.fasterxml.jackson.databind.JsonNode; public class RunParser extends BaseParser @@ -102,7 +100,7 @@ public TestReportParser loadTestReport(final JsonReader reader) } 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; @@ -111,7 +109,7 @@ public TestReportParser loadTestReport(final JsonReader reader) filterForJSONOutput = "/api/json?tree=" + java.net.URLEncoder.encode(testReportSelector,"UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); - } + }*/ return new TestReportParser(reader.getJSonResult(getUrl() + "testReport" + filterForJSONOutput)); } }