Chromium Code Reviews| 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 logging | |
| 7 import json | |
| 8 | |
| 9 import dev_appserver | |
| 10 dev_appserver.fix_sys_path() | |
| 11 | |
| 12 from crash.findit_for_chromecrash import Culprit | |
| 13 from crash_queries.delta_test import delta_util | |
| 14 | |
| 15 | |
| 16 # TODO(katesonia): Replace the current testing function with real find culprit | |
| 17 # function. | |
| 18 # Unused argument - pylint: disable=W | |
| 19 def GetCulprits(crashes, client, verbose=False): | |
|
stgao
2016/10/20 01:40:20
What's the verbose for? If not used, could we remo
Sharu Jiang
2016/10/20 22:39:07
Done.
| |
| 20 culprits = {} | |
| 21 for crash in crashes: | |
| 22 culprit = Culprit('proj1', 'comp', [], ['rev1', 'rev2']) | |
| 23 culprits[crash['id']] = culprit | |
| 24 | |
| 25 return culprits | |
| 26 | |
| 27 | |
| 28 def RunAzalea(): | |
| 29 """Runs delta testing between 2 different Findit versions.""" | |
| 30 argparser = argparse.ArgumentParser( | |
| 31 description='Run azalea on a batch of crashes.') | |
| 32 argparser.add_argument('result_path', help='Path to store results') | |
| 33 argparser.add_argument( | |
| 34 '--verbose', | |
| 35 '-v', | |
| 36 action='store_true', | |
| 37 default=False, | |
| 38 help='Print findit results.') | |
| 39 argparser.add_argument( | |
| 40 '--client', | |
| 41 '-c', | |
| 42 default='fracas', | |
| 43 help=('Possible values are: fracas, cracas, clusterfuzz. Right now, only ' | |
| 44 'fracas is supported.')) | |
| 45 args = argparser.parse_args() | |
| 46 | |
| 47 crashes = json.loads(raw_input()) | |
| 48 culprits = GetCulprits(crashes, args.client, args.verbose) | |
| 49 | |
| 50 delta_util.FlushResult(culprits, args.result_path) | |
| 51 | |
| 52 | |
| 53 if __name__ == '__main__': | |
| 54 logging.basicConfig(level=logging.DEBUG) | |
| 55 RunAzalea() | |
| OLD | NEW |