Repository: hbase
Updated Branches:
  refs/heads/branch-2 4bae818fb -> 621a43e70
  refs/heads/branch-2.0 8435f2bc7 -> dda1dd86e
  refs/heads/branch-2.1 0d51d5472 -> de1d36f93
  refs/heads/master e705cf144 -> 346dd3218


HBASE-20979 Flaky test reporting should specify what JSON it needs and handle 
HTTP errors

Signed-off-by: Michael Stack <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/346dd321
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/346dd321
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/346dd321

Branch: refs/heads/master
Commit: 346dd3218513d678c7e119d57e1081949b6972ff
Parents: e705cf1
Author: Sean Busbey <[email protected]>
Authored: Mon Jul 30 12:36:54 2018 -0500
Committer: Sean Busbey <[email protected]>
Committed: Tue Aug 14 13:13:51 2018 -0500

----------------------------------------------------------------------
 dev-support/report-flakies.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/346dd321/dev-support/report-flakies.py
----------------------------------------------------------------------
diff --git a/dev-support/report-flakies.py b/dev-support/report-flakies.py
index 201980d..1b3161a 100755
--- a/dev-support/report-flakies.py
+++ b/dev-support/report-flakies.py
@@ -76,7 +76,10 @@ def get_bad_tests(build_url, is_yetus):
     Returns None if can't get maven output from the build or if there is any 
other error.
     """
     logger.info("Analyzing %s", build_url)
-    response = requests.get(build_url + "/api/json").json()
+    needed_fields="_class,building"
+    if is_yetus:
+        needed_fields+=",artifacts[fileName,relativePath]"
+    response = requests.get(build_url + "/api/json?tree=" + 
needed_fields).json()
     if response["building"]:
         logger.info("Skipping this build since it is in progress.")
         return {}
@@ -125,7 +128,11 @@ def expand_multi_config_projects(cli_args):
         excluded_builds = []
         if excluded_builds_arg is not None and excluded_builds_arg[i] != 
"None":
             excluded_builds = [int(x) for x in 
excluded_builds_arg[i].split(",")]
-        response = requests.get(job_url + "/api/json").json()
+        request = requests.get(job_url + 
"/api/json?tree=_class,activeConfigurations%5Burl%5D")
+        if request.status_code != 200:
+            raise Exception("Failed to get job information from jenkins for 
url '" + job_url +
+                            "'. Jenkins returned HTTP status " + 
str(request.status_code))
+        response = request.json()
         if response.has_key("activeConfigurations"):
             for config in response["activeConfigurations"]:
                 final_expanded_urls.append({'url':config["url"], 'max_builds': 
max_builds,
@@ -152,7 +159,7 @@ expanded_urls = expand_multi_config_projects(args)
 for url_max_build in expanded_urls:
     url = url_max_build["url"]
     excludes = url_max_build["excludes"]
-    json_response = requests.get(url + "/api/json").json()
+    json_response = requests.get(url + 
"/api/json?tree=id,builds%5Bnumber,url%5D").json()
     if json_response.has_key("builds"):
         builds = json_response["builds"]
         logger.info("Analyzing job: %s", url)

Reply via email to