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

Unified Diff: appengine/findit/util_scripts/crash_queries/delta_test/run-predator.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
« no previous file with comments | « appengine/findit/util_scripts/crash_queries/delta_test/run-delta-test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/util_scripts/crash_queries/delta_test/run-predator.py
diff --git a/appengine/findit/util_scripts/crash_queries/delta_test/run-predator.py b/appengine/findit/util_scripts/crash_queries/delta_test/run-predator.py
new file mode 100644
index 0000000000000000000000000000000000000000..aaa62d88489f2acbd0de2239238719beac34bf37
--- /dev/null
+++ b/appengine/findit/util_scripts/crash_queries/delta_test/run-predator.py
@@ -0,0 +1,60 @@
+# 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 json
+import logging
+import os
+import sys
+
+_SCRIPT_DIR = os.path.join(os.path.dirname(__file__), os.path.pardir,
+ os.path.pardir)
+sys.path.insert(1, _SCRIPT_DIR)
+
+import script_util
+script_util.SetUpSystemPaths()
+
+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.
+def GetCulprits(crashes):
+ culprits = {}
+ for crash in crashes:
+ culprit = Culprit('proj', 'comp', [], ['rev1', 'rev2'])
+ culprits[crash['id']] = culprit
+
+ return culprits
+
+
+def RunPredator():
+ """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)
+
+ delta_util.FlushResult(culprits, args.result_path)
+
+
+if __name__ == '__main__':
+ logging.basicConfig(level=logging.DEBUG)
+ RunPredator()
« no previous file with comments | « appengine/findit/util_scripts/crash_queries/delta_test/run-delta-test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698