Chromium Code Reviews| Index: appengine/findit/waterfall/test/try_job_util_test.py |
| diff --git a/appengine/findit/waterfall/test/try_job_util_test.py b/appengine/findit/waterfall/test/try_job_util_test.py |
| index fece1d173992e0755749b9159553478681bc0bf7..ed8d992e4e197cfe8038aed17a6aa38c803a39db 100644 |
| --- a/appengine/findit/waterfall/test/try_job_util_test.py |
| +++ b/appengine/findit/waterfall/test/try_job_util_test.py |
| @@ -401,7 +401,53 @@ class TryJobUtilTest(wf_testcase.WaterfallTestCase): |
| self.assertEqual( |
| [master_name, builder_name, build_number], analysis_2.failure_group_key) |
| - def testGroupCompilesWithRelatedFailures(self): |
| + def testGroupCompilesWithRelatedFailuresWithHeuristicResult(self): |
| + master_name = 'm1' |
| + builder_name = 'b' |
| + build_number = 1 |
| + master_name_2 = 'm2' |
| + |
| + blame_list = ['a'] |
| + |
| + signals = { |
| + 'compile': { |
| + 'failed_output_nodes': [ |
| + 'abc.obj' |
| + ] |
| + } |
| + } |
| + |
| + heuristic_result = { |
| + 'failures': [ |
| + { |
| + 'step_name': 'step1', |
| + 'suspected_cls': [ |
| + { |
| + 'revision': 'rev1', |
| + } |
| + ], |
| + } |
| + ] |
| + } |
| + |
| + WfAnalysis.Create(master_name, builder_name, build_number).put() |
| + # Run pipeline with signals that have certain failed output nodes. |
| + # Observe new group creation. |
| + self.assertTrue(try_job_util._IsBuildFailureUniqueAcrossPlatforms( |
| + master_name, builder_name, build_number, failure_type.COMPILE, |
| + blame_list, None, signals, heuristic_result)) |
| + self.assertTrue(WfFailureGroup.Get(master_name, builder_name, build_number)) |
|
lijeffrey
2016/07/27 22:49:36
WfFailureGroup isn't a bool, it's an entity. Inste
josiahk
2016/07/30 00:21:10
Thanks!
|
| + |
| + WfAnalysis.Create(master_name_2, builder_name, build_number).put() |
| + # Run pipeline with signals that have the same failed output nodes. |
| + # Observe no new group creation. |
| + self.assertFalse(try_job_util._IsBuildFailureUniqueAcrossPlatforms( |
| + master_name_2, builder_name, build_number, failure_type.COMPILE, |
| + blame_list, None, signals, heuristic_result)) |
| + self.assertIsNone( |
| + WfFailureGroup.Get(master_name_2, builder_name, build_number)) |
| + |
| + def testGroupCompilesWithRelatedFailuresWithoutHeuristicResult(self): |
| master_name = 'm1' |
| builder_name = 'b' |
| build_number = 1 |
| @@ -504,7 +550,7 @@ class TryJobUtilTest(wf_testcase.WaterfallTestCase): |
| 'step_name': 'step1', |
| 'suspected_cls': [ |
| { |
| - 'revision': 'rev1', |
| + 'revision': 'rev2', |
| } |
| ], |
| } |
| @@ -589,7 +635,53 @@ class TryJobUtilTest(wf_testcase.WaterfallTestCase): |
| self.assertIsNone( |
| WfFailureGroup.Get(master_name, builder_name, build_number)) |
| - def testGroupTestsWithRelatedSteps(self): |
| + def testGroupTestsWithRelatedStepsWithHeuristicResult(self): |
| + master_name = 'm1' |
| + builder_name = 'b' |
| + build_number = 1 |
| + master_name_2 = 'm2' |
| + |
| + blame_list = ['a'] |
| + |
| + failed_steps = { |
| + 'step_a': { |
| + 'current_failure': 3, |
| + 'first_failure': 2, |
| + 'last_pass': 1 |
| + } |
| + } |
| + |
| + heuristic_result = { |
| + 'failures': [ |
| + { |
| + 'step_name': 'step1', |
| + 'suspected_cls': [ |
| + { |
| + 'revision': 'rev1', |
| + } |
| + ], |
| + } |
| + ] |
| + } |
| + |
| + WfAnalysis.Create(master_name, builder_name, build_number).put() |
| + # Run pipeline with signals that have certain failed steps. |
| + # Observe new group creation. |
| + self.assertTrue(try_job_util._IsBuildFailureUniqueAcrossPlatforms( |
| + master_name, builder_name, build_number, failure_type.TEST, blame_list, |
| + failed_steps, None, heuristic_result)) |
| + self.assertTrue(WfFailureGroup.Get(master_name, builder_name, build_number)) |
| + |
| + WfAnalysis.Create(master_name_2, builder_name, build_number).put() |
| + # Run pipeline with signals that have the same failed steps. |
| + # Observe no new group creation. |
| + self.assertFalse(try_job_util._IsBuildFailureUniqueAcrossPlatforms( |
| + master_name_2, builder_name, build_number, failure_type.TEST, |
| + blame_list, failed_steps, None, heuristic_result)) |
| + self.assertIsNone( |
| + WfFailureGroup.Get(master_name_2, builder_name, build_number)) |
| + |
| + def testGroupTestsWithRelatedStepsWithoutHeuristicResult(self): |
| master_name = 'm1' |
| builder_name = 'b' |
| build_number = 1 |
| @@ -690,7 +782,7 @@ class TryJobUtilTest(wf_testcase.WaterfallTestCase): |
| 'step_name': 'step1', |
| 'suspected_cls': [ |
| { |
| - 'revision': 'rev1', |
| + 'revision': 'rev2', |
| } |
| ], |
| } |