diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2016-11-28 13:29:10 -0800 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2016-11-28 13:29:10 -0800 |
commit | c0c65ea63797405f2fee48c58284933ae2c9b347 (patch) | |
tree | 98e17c8a4a937dc0a2651029528e33690c2dfec8 /python/servo/testing_commands.py | |
parent | 4f021d3c532f1fd5c3cb3ae25cd6e5d58852c3c0 (diff) | |
download | servo-c0c65ea63797405f2fee48c58284933ae2c9b347.tar.gz servo-c0c65ea63797405f2fee48c58284933ae2c9b347.zip |
Use jdm's tracker
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r-- | python/servo/testing_commands.py | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index 1db3b4fb1bf..6b48158137c 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -488,7 +488,9 @@ class MachCommands(CommandBase): help='Print filtered log to file') @CommandArgument('--auth', default=None, help='File containing basic authorization credentials for Github API (format `username:password`)') - def filter_intermittents(self, summary, output, auth): + @CommandArgument('--use-tracker', default=False, action='store_true', + help='Use https://www.joshmatthews.net/intermittent-tracker') + def filter_intermittents(self, summary, output, auth, use_tracker): encoded_auth = None if auth: with open(auth, "r") as file: @@ -501,16 +503,24 @@ class MachCommands(CommandBase): failures += [line_json] actual_failures = [] for failure in failures: - qstr = "repo:servo/servo+label:I-intermittent+type:issue+state:open+%s" % failure['test'] - # we want `/` to get quoted, but not `+` (github's API doesn't like that), so we set `safe` to `+` - query = urllib2.quote(qstr, safe='+') - request = urllib2.Request("https://api.github.com/search/issues?q=%s" % query) - if encoded_auth: - request.add_header("Authorization", "Basic %s" % encoded_auth) - search = urllib2.urlopen(request) - data = json.load(search) - if data['total_count'] == 0: - actual_failures += [failure] + if use_tracker: + query = urllib2.quote(failure['test'], safe='') + request = urllib2.Request("https://www.joshmatthews.net/intermittent-tracker/query.py?name=%s" % query) + search = urllib2.urlopen(request) + data = json.load(search) + if len(data) == 0: + actual_failures += [failure] + else: + qstr = "repo:servo/servo+label:I-intermittent+type:issue+state:open+%s" % failure['test'] + # we want `/` to get quoted, but not `+` (github's API doesn't like that), so we set `safe` to `+` + query = urllib2.quote(qstr, safe='+') + request = urllib2.Request("https://api.github.com/search/issues?q=%s" % query) + if encoded_auth: + request.add_header("Authorization", "Basic %s" % encoded_auth) + search = urllib2.urlopen(request) + data = json.load(search) + if data['total_count'] == 0: + actual_failures += [failure] if len(actual_failures) == 0: return 0 |