Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1916)

Unified Diff: appengine/findit/util_scripts/crash_queries/delta_test/run-azalea.py

Issue 2400283003: [Findit] Add skeleton code for delta test script. (Closed)
Patch Set: Rebase. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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()

Powered by Google App Engine
This is Rietveld 408576698