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

Unified Diff: appengine/findit/handlers/test/build_failure_test.py

Issue 1895693002: [Findit] Add a new UI page for compile failures. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 8 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/handlers/test/build_failure_test.py
diff --git a/appengine/findit/handlers/test/build_failure_test.py b/appengine/findit/handlers/test/build_failure_test.py
index 1830989d93ead9fbd74fd2d7e2def6a618f70e88..265779800e38d96a404797225b0fb2eaf9731125 100644
--- a/appengine/findit/handlers/test/build_failure_test.py
+++ b/appengine/findit/handlers/test/build_failure_test.py
@@ -14,6 +14,7 @@ from handlers import build_failure
from handlers import handlers_util
from handlers import result_status
from model.wf_analysis import WfAnalysis
+from model.wf_try_job import WfTryJob
from model import analysis_status
from model.wf_analysis import WfAnalysis
from waterfall import buildbot
@@ -616,3 +617,78 @@ class BuildFailureTest(wf_testcase.WaterfallTestCase):
}
}
self.assertEqual(expected_result, result)
+
+ def testPrepareTryJobDataForCompileFailure(self):
+ analysis = WfAnalysis.Create('m', 'b', 123)
+ analysis.result = {
+ 'failures': [
+ {
+ 'step_name': 'compile',
+ 'first_failure': 122,
+ 'last_pass': 121,
+ 'suspected_cls': [],
+ },
+ {
+ 'step_name': 'steps',
+ },
+ ]
+ }
+ analysis.failure_result_map = {
+ 'compile': 'm/b/122',
+ }
+
+ try_job = WfTryJob.Create('m', 'b', 122)
+ try_job.status = analysis_status.COMPLETED
+ try_job.compile_results = [
+ {
+ 'url': 'build/url',
+ 'culprit': {
+ 'compile': {
+ 'revision': 'rev',
+ }
+ }
+ }
+ ]
+ try_job.put()
+
+ expected_try_job_data = {
+ 'status': 'completed',
+ 'url': 'build/url',
+ 'completed': True,
+ 'failed': False,
+ 'culprit': {
+ 'revision': 'rev',
+ }
+ }
+
+ try_job_data = (
+ build_failure.BuildFailure._PrepareTryJobDataForCompileFailure(
+ analysis))
+
+ self.assertEqual(expected_try_job_data, try_job_data)
+
+ def testPopulateHeuristicDataForCompileFailure(self):
+ analysis = WfAnalysis.Create('m', 'b', 123)
+ analysis.result = {
+ 'failures': [
+ {
+ 'step_name': 'compile',
+ 'first_failure': 122,
+ 'last_pass': 121,
+ 'suspected_cls': [],
+ },
+ {
+ 'step_name': 'steps',
+ },
+ ]
+ }
+ expected_data = {
+ 'first_failure': 122,
+ 'last_pass': 121,
+ 'suspected_cls_by_heuristic': [],
+ }
+
+ data = {}
+ build_failure.BuildFailure._PopulateHeuristicDataForCompileFailure(
+ analysis, data)
+ self.assertEqual(expected_data, data)
« no previous file with comments | « appengine/findit/handlers/build_failure.py ('k') | appengine/findit/templates/waterfall/compile_failure.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698