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

Unified Diff: appengine/findit/waterfall/test/monitor_try_job_pipeline_test.py

Issue 1948093003: [Findit] Adding more try job error detection (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebase 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/waterfall/test/monitor_try_job_pipeline_test.py
diff --git a/appengine/findit/waterfall/test/monitor_try_job_pipeline_test.py b/appengine/findit/waterfall/test/monitor_try_job_pipeline_test.py
index 80f771887d332de55e046dfc584ac32650e473ec..ba836c3dc74b8696e457e0aeab793e78b7fe5bcc 100644
--- a/appengine/findit/waterfall/test/monitor_try_job_pipeline_test.py
+++ b/appengine/findit/waterfall/test/monitor_try_job_pipeline_test.py
@@ -387,6 +387,8 @@ class MonitorTryJobPipelineTest(wf_testcase.WaterfallTestCase):
def testGetErrorInfraFailure(self):
build_response = {
+ 'result': 'FAILED',
+ 'failure_reason': 'INFRA_FAILURE',
'result_details_json': json.dumps({
'properties': {
'report': {
@@ -407,6 +409,50 @@ class MonitorTryJobPipelineTest(wf_testcase.WaterfallTestCase):
MonitorTryJobPipeline._GetError(build_response, None, False),
(expected_error_dict, try_job_error.INFRA_FAILURE))
+ def testGetErrorUnexpectedBuildFailure(self):
+ build_response = {
+ 'result': 'FAILED',
+ 'failure_reason': 'BUILD_FAILURE',
+ 'result_details_json': json.dumps({
+ 'properties': {
+ 'report': {
+ 'metadata': {
+ 'infra_failure': True
+ }
+ }
+ }
+ })
+ }
+
+ expected_error_dict = {
+ 'message': 'Compile failed unexpectedly.',
+ 'reason': MonitorTryJobPipeline.UNKNOWN
+ }
+
+ self.assertEqual(
+ MonitorTryJobPipeline._GetError(build_response, None, False),
+ (expected_error_dict, try_job_error.INFRA_FAILURE))
+
+ def testGetErrorUnknownBuildbucketFailure(self):
+ build_response = {
+ 'result': 'FAILED',
+ 'failure_reason': 'SOME_FAILURE',
+ 'result_details_json': json.dumps({
+ 'properties': {
+ 'report': {}
+ }
+ })
+ }
+
+ expected_error_dict = {
+ 'message': 'SOME_FAILURE',
+ 'reason': MonitorTryJobPipeline.UNKNOWN
+ }
+
+ self.assertEqual(
+ MonitorTryJobPipeline._GetError(build_response, None, False),
+ (expected_error_dict, try_job_error.UNKNOWN))
+
def testGetErrorReportMissing(self):
build_response = {
'result_details_json': json.dumps({
@@ -422,3 +468,5 @@ class MonitorTryJobPipelineTest(wf_testcase.WaterfallTestCase):
self.assertEqual(
MonitorTryJobPipeline._GetError(build_response, None, False),
(expected_error_dict, try_job_error.UNKNOWN))
+
+
chanli 2016/05/06 23:17:46 nit: empty lines
lijeffrey 2016/05/07 00:12:45 Done.

Powered by Google App Engine
This is Rietveld 408576698