Chromium Code Reviews| Index: appengine/findit/util_scripts/crash_queries/delta_test/run-azalea.py |
| diff --git a/appengine/findit/util_scripts/crash_queries/delta_test/run-azalea.py b/appengine/findit/util_scripts/crash_queries/delta_test/run-azalea.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8beb86011c64fc53d9491a129227c99cbfeaa4e4 |
| --- /dev/null |
| +++ b/appengine/findit/util_scripts/crash_queries/delta_test/run-azalea.py |
| @@ -0,0 +1,55 @@ |
| +# Copyright 2016 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +import argparse |
| +import logging |
| +import json |
| + |
| +import dev_appserver |
| +dev_appserver.fix_sys_path() |
| + |
| +from crash.findit_for_chromecrash import Culprit |
| +from crash_queries.delta_test import delta_util |
| + |
| + |
| +# TODO(katesonia): Replace the current testing function with real find culprit |
| +# function. |
| +# Unused argument - pylint: disable=W |
| +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.
|
| + culprits = {} |
| + for crash in crashes: |
| + culprit = Culprit('proj1', 'comp', [], ['rev1', 'rev2']) |
| + culprits[crash['id']] = culprit |
| + |
| + return culprits |
| + |
| + |
| +def RunAzalea(): |
| + """Runs delta testing between 2 different Findit versions.""" |
| + argparser = argparse.ArgumentParser( |
| + description='Run azalea on a batch of crashes.') |
| + argparser.add_argument('result_path', help='Path to store results') |
| + argparser.add_argument( |
| + '--verbose', |
| + '-v', |
| + action='store_true', |
| + default=False, |
| + help='Print findit results.') |
| + argparser.add_argument( |
| + '--client', |
| + '-c', |
| + default='fracas', |
| + help=('Possible values are: fracas, cracas, clusterfuzz. Right now, only ' |
| + 'fracas is supported.')) |
| + args = argparser.parse_args() |
| + |
| + crashes = json.loads(raw_input()) |
| + culprits = GetCulprits(crashes, args.client, args.verbose) |
| + |
| + delta_util.FlushResult(culprits, args.result_path) |
| + |
| + |
| +if __name__ == '__main__': |
| + logging.basicConfig(level=logging.DEBUG) |
| + RunAzalea() |