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

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

Issue 1870103003: [Findit] Adding Try Job suspected CLs and result status to analysis (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Addressing comments 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/waterfall/test/swarming_tasks_to_try_job_pipeline_test.py
diff --git a/appengine/findit/waterfall/test/swarming_tasks_to_try_job_pipeline_test.py b/appengine/findit/waterfall/test/swarming_tasks_to_try_job_pipeline_test.py
index 64e4654cc22a3ba269607ab6047744dc35b59453..6c1b6b9f84e3f9f8e22ab28889d0a721c58344c9 100644
--- a/appengine/findit/waterfall/test/swarming_tasks_to_try_job_pipeline_test.py
+++ b/appengine/findit/waterfall/test/swarming_tasks_to_try_job_pipeline_test.py
@@ -7,6 +7,8 @@ import json
from common.git_repository import GitRepository
from common.pipeline_wrapper import pipeline_handlers
from common.waterfall import buildbucket_client
+from model import result_status
+from model.wf_analysis import WfAnalysis
from model.wf_try_job import WfTryJob
from waterfall import swarming_util
from waterfall import trigger_swarming_task_pipeline
@@ -201,6 +203,8 @@ class SwarmingTasksToTryJobPipelineTest(wf_testcase.WaterfallTestCase):
self._MockGetChangeLog('rev2')
WfTryJob.Create(master_name, builder_name, build_number).put()
+ analysis = WfAnalysis.Create(master_name, builder_name, build_number)
+ analysis.put()
root_pipeline = SwarmingTasksToTryJobPipeline(
master_name, builder_name, build_number, 'rev1', 'rev2', ['rev2'],
@@ -210,6 +214,13 @@ class SwarmingTasksToTryJobPipelineTest(wf_testcase.WaterfallTestCase):
try_job = WfTryJob.Get(master_name, builder_name, build_number)
+ expected_suspected_cl = {
+ 'revision': 'rev2',
+ 'commit_position': '2',
+ 'review_url': 'url_2',
+ 'repo_name': 'chromium'
+ }
+
expected_try_job_results = [
{
'report': {
@@ -224,15 +235,16 @@ class SwarmingTasksToTryJobPipelineTest(wf_testcase.WaterfallTestCase):
'url': 'url',
'try_job_id': '1',
'culprit': {
- 'compile': {
- 'revision': 'rev2',
- 'commit_position': '2',
- 'review_url': 'url_2'
- }
+ 'compile': expected_suspected_cl
}
}
]
+
self.assertEqual(expected_try_job_results, try_job.compile_results)
+ self.assertEqual(analysis.result_status,
+ result_status.FOUND_UNTRIAGED)
+ self.assertEqual(analysis.suspected_cls,
+ [expected_suspected_cl])
def testSuccessfullyScheduleNewTryJobForTest(self):
master_name = 'm'
@@ -326,6 +338,8 @@ class SwarmingTasksToTryJobPipelineTest(wf_testcase.WaterfallTestCase):
self._MockGetChangeLog('rev1')
WfTryJob.Create(master_name, builder_name, build_number).put()
+ analysis = WfAnalysis.Create(master_name, builder_name, build_number)
+ analysis.put()
root_pipeline = SwarmingTasksToTryJobPipeline(
master_name, builder_name, build_number, 'rev0', 'rev1', ['rev1'],
@@ -335,6 +349,13 @@ class SwarmingTasksToTryJobPipelineTest(wf_testcase.WaterfallTestCase):
try_job = WfTryJob.Get(master_name, builder_name, build_number)
+ expected_suspected_cl = {
+ 'revision': 'rev1',
+ 'commit_position': '1',
+ 'review_url': 'url_1',
+ 'repo_name': 'chromium'
+ }
+
expected_try_job_results = [
{
'report': {
@@ -361,11 +382,7 @@ class SwarmingTasksToTryJobPipelineTest(wf_testcase.WaterfallTestCase):
'culprit': {
'a_test': {
'tests': {
- 'TestSuite1.test3': {
- 'revision': 'rev1',
- 'commit_position': '1',
- 'review_url': 'url_1'
- }
+ 'TestSuite1.test3': expected_suspected_cl
}
}
}
@@ -373,3 +390,6 @@ class SwarmingTasksToTryJobPipelineTest(wf_testcase.WaterfallTestCase):
]
self.assertEqual(expected_try_job_results, try_job.test_results)
+ self.assertEqual(analysis.result_status,
+ result_status.FOUND_UNTRIAGED)
+ self.assertEqual(analysis.suspected_cls, [expected_suspected_cl])

Powered by Google App Engine
This is Rietveld 408576698