| 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..b7612a694edb5bf9ffbad8c40668e6a6a22b46d2
|
| --- /dev/null
|
| +++ b/appengine/findit/util_scripts/crash_queries/delta_test/run-azalea.py
|
| @@ -0,0 +1,50 @@
|
| +# 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 'verbose' (unused-argument) - pylint: disable=W
|
| +def GetCulprits(crashes, verbose=False):
|
| + culprits = {}
|
| + for crash in crashes:
|
| + culprit = Culprit('proj', '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.')
|
| +
|
| + args = argparser.parse_args()
|
| +
|
| + crashes = json.loads(raw_input())
|
| + culprits = GetCulprits(crashes, args.verbose)
|
| +
|
| + delta_util.FlushResult(culprits, args.result_path)
|
| +
|
| +
|
| +if __name__ == '__main__':
|
| + logging.basicConfig(level=logging.DEBUG)
|
| + RunAzalea()
|
|
|