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

Unified Diff: appengine/findit/crash/test/fracas_test.py

Issue 1950123003: [Findit] Fetch DEPS from buildspec/ instead of trunk for chrome official builds. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Update doc string. Created 4 years, 7 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/crash/test/fracas_test.py
diff --git a/appengine/findit/crash/test/fracas_test.py b/appengine/findit/crash/test/fracas_test.py
new file mode 100644
index 0000000000000000000000000000000000000000..8836af4b72cc3c7b26845dad934d6f9cb0a50e5b
--- /dev/null
+++ b/appengine/findit/crash/test/fracas_test.py
@@ -0,0 +1,66 @@
+# 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.
+
+from common import chromium_deps
+from crash import detect_regression_range
+from crash import fracas
+from crash import fracas_parser
+from crash import findit_for_crash
+from crash.stacktrace import Stacktrace
+from crash.test.crash_testcase import CrashTestCase
+
+
+class FracasTest(CrashTestCase):
+
+ def testFindCulpritForChromeCrash(self):
+ def _MockGetChromeDependency(*_):
+ return {}
+
+ def _MockParse(*_):
+ return Stacktrace()
+
+ def _MockDetectRegressionRange(historic):
+ if historic:
+ return '50.0.1233.0', '50.0.1234.0'
+
+ return None
+
+ def _MockGetDEPSRollsDict(*_):
+ return {}
+
+ def _MockFindItForCrash(*_):
+ return []
+
+ self.mock(chromium_deps, 'GetChromeDependency', _MockGetChromeDependency)
+ self.mock(fracas_parser.FracasParser, 'Parse', _MockParse)
+ self.mock(detect_regression_range, 'DetectRegressionRange',
+ _MockDetectRegressionRange)
+ self.mock(chromium_deps, 'GetDEPSRollsDict', _MockGetDEPSRollsDict)
+ self.mock(findit_for_crash, 'FindItForCrash', _MockFindItForCrash)
+
+ expected_results = {
+ 'found': False,
+ 'suspected_project': '',
+ 'suspected_components': [],
+ 'culprits': [],
+ }
+
+ expected_tag = {
+ 'found_suspects': False,
+ 'has_regression_range': True,
+ 'solution': 'core_algorithm',
+ }
+
+ results, tag = fracas.FindCulpritForChromeCrash(
+ 'signature', 'win', 'frame1\nframe2', '50.0.1234.0',
+ [{'chrome_version': '50.0.1234.0', 'cpm': 0.6}])
+
+ self.assertEqual(expected_results, results)
+ self.assertEqual(expected_tag, tag)
+
+ results, tag = fracas.FindCulpritForChromeCrash(
+ 'signature', 'win', 'frame1\nframe2', '50.0.1234.0', [])
+
+ expected_tag['has_regression_range'] = False
+ self.assertEqual(expected_tag, tag)
« no previous file with comments | « appengine/findit/crash/test/fracas_crash_pipeline_test.py ('k') | appengine/findit/crash/test/results_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698