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

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

Issue 2230103002: [Findit] Pipeline change to save suspected cls to data store. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@0808-resubmit-suspected_cl_model
Patch Set: rebase Created 4 years, 2 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/handlers/test/build_failure_test.py ('k') | appengine/findit/model/base_suspected_cl.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/handlers/test/list_analyses_test.py
diff --git a/appengine/findit/handlers/test/list_analyses_test.py b/appengine/findit/handlers/test/list_analyses_test.py
index 63dc2b7d2a792c36beb99f348859f7b8298da6e4..19a96d3f1322165c8e0388b8ca021d177fa5dc09 100644
--- a/appengine/findit/handlers/test/list_analyses_test.py
+++ b/appengine/findit/handlers/test/list_analyses_test.py
@@ -33,6 +33,24 @@ class ListAnalysesTest(testing.AppengineTestCase):
analysis.put()
return analysis
+ def _GetSuspectedCLs(self, analysis_result):
+ """Returns the suspected CLs we found in analysis."""
+ suspected_cls = []
+ if not analysis_result or not analysis_result['failures']:
+ return suspected_cls
+
+ for failure in analysis_result['failures']:
+ for suspected_cl in failure['suspected_cls']:
+ cl_info = {
+ 'repo_name': suspected_cl['repo_name'],
+ 'revision': suspected_cl['revision'],
+ 'commit_position': suspected_cl['commit_position'],
+ 'url': suspected_cl['url']
+ }
+ if cl_info not in suspected_cls:
+ suspected_cls.append(cl_info)
+ return suspected_cls
+
def _AddAnalysisResults(self):
"""Create and store dummy data."""
analyses = []
@@ -245,8 +263,7 @@ class ListAnalysesTest(testing.AppengineTestCase):
}
for analysis in analyses:
- analysis.suspected_cls = identify_culprit_pipeline._GetSuspectedCLs(
- analysis.result)
+ analysis.suspected_cls = self._GetSuspectedCLs(analysis.result)
analysis.result_status = (identify_culprit_pipeline.
_GetResultAnalysisStatus(analysis.result))
analysis.put()
« no previous file with comments | « appengine/findit/handlers/test/build_failure_test.py ('k') | appengine/findit/model/base_suspected_cl.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698