aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/bisector.py
diff options
context:
space:
mode:
authorGravatar Oliver Chang <oliverchang@users.noreply.github.com>2020-04-21 08:05:45 +1000
committerGravatar GitHub <noreply@github.com>2020-04-21 08:05:45 +1000
commitd5ad37e6921938d83a368c09d86f48f3b6dec6b6 (patch)
tree58d9c45eddf94546fe9cd6dc2e528b4f00caa0d2 /infra/bisector.py
parent3999d17791e8742bd6fb2d9aa134e634bb130b66 (diff)
Return main repo URL in bisector result. (#3672)
Diffstat (limited to 'infra/bisector.py')
-rw-r--r--infra/bisector.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/infra/bisector.py b/infra/bisector.py
index e12e5322..1b06997d 100644
--- a/infra/bisector.py
+++ b/infra/bisector.py
@@ -31,6 +31,7 @@ This is done with the following steps:
"""
import argparse
+import collections
import logging
import os
import tempfile
@@ -40,6 +41,8 @@ import helper
import repo_manager
import utils
+Result = collections.namedtuple('Result', ['repo_url', 'commit'])
+
def main():
"""Finds the commit SHA where an error was initally introduced."""
@@ -103,7 +106,7 @@ def bisect(old_commit, new_commit, test_case_path, fuzz_target, build_data): #
build_data: a class holding all of the input parameters for bisection.
Returns:
- The commit SHA that introduced the error or None.
+ A Result.
Raises:
ValueError: when a repo url can't be determine from the project.
@@ -145,7 +148,7 @@ def bisect(old_commit, new_commit, test_case_path, fuzz_target, build_data): #
if expected_error_code == helper.reproduce_impl(build_data.project_name,
fuzz_target, False, [],
[], test_case_path):
- return commit_list[old_idx]
+ return Result(repo_url, commit_list[old_idx])
while old_idx - new_idx > 1:
curr_idx = (old_idx + new_idx) // 2
@@ -160,7 +163,7 @@ def bisect(old_commit, new_commit, test_case_path, fuzz_target, build_data): #
new_idx = curr_idx
else:
old_idx = curr_idx
- return commit_list[new_idx]
+ return Result(repo_url, commit_list[new_idx])
if __name__ == '__main__':