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

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: Addressing comments 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
« no previous file with comments | « appengine/findit/waterfall/monitor_try_job_pipeline.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bd754d056d7196f8c185502c0a6a0ccd9f2d031c 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({
« no previous file with comments | « appengine/findit/waterfall/monitor_try_job_pipeline.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698