| OLD | NEW |
| (Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import argparse |
| 6 import json |
| 7 import logging |
| 8 import os |
| 9 import sys |
| 10 |
| 11 _SCRIPT_DIR = os.path.join(os.path.dirname(__file__), os.path.pardir, |
| 12 os.path.pardir) |
| 13 sys.path.insert(1, _SCRIPT_DIR) |
| 14 |
| 15 import script_util |
| 16 script_util.SetUpSystemPaths() |
| 17 |
| 18 from crash.findit_for_chromecrash import Culprit |
| 19 from crash_queries.delta_test import delta_util |
| 20 |
| 21 |
| 22 # TODO(katesonia): Replace the current testing function with real find culprit |
| 23 # function. |
| 24 def GetCulprits(crashes): |
| 25 culprits = {} |
| 26 for crash in crashes: |
| 27 culprit = Culprit('proj', 'comp', [], ['rev1', 'rev2']) |
| 28 culprits[crash['id']] = culprit |
| 29 |
| 30 return culprits |
| 31 |
| 32 |
| 33 def RunPredator(): |
| 34 """Runs delta testing between 2 different Findit versions.""" |
| 35 argparser = argparse.ArgumentParser( |
| 36 description='Run azalea on a batch of crashes.') |
| 37 argparser.add_argument('result_path', help='Path to store results') |
| 38 argparser.add_argument( |
| 39 '--verbose', |
| 40 '-v', |
| 41 action='store_true', |
| 42 default=False, |
| 43 help='Print findit results.') |
| 44 argparser.add_argument( |
| 45 '--client', |
| 46 '-c', |
| 47 default='fracas', |
| 48 help=('Possible values are: fracas, cracas, clusterfuzz. Right now, only ' |
| 49 'fracas is supported.')) |
| 50 args = argparser.parse_args() |
| 51 |
| 52 crashes = json.loads(raw_input()) |
| 53 culprits = GetCulprits(crashes) |
| 54 |
| 55 delta_util.FlushResult(culprits, args.result_path) |
| 56 |
| 57 |
| 58 if __name__ == '__main__': |
| 59 logging.basicConfig(level=logging.DEBUG) |
| 60 RunPredator() |
| OLD | NEW |