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

Unified Diff: appengine/findit/waterfall/process_swarming_task_result_pipeline.py

Issue 2027333002: [Findit] don't included skipped or unknown tests in swarming tasks into failed tests. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Make sure only collect swarming result for targeted tests. 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/process_swarming_task_result_pipeline.py
diff --git a/appengine/findit/waterfall/process_swarming_task_result_pipeline.py b/appengine/findit/waterfall/process_swarming_task_result_pipeline.py
index 06d55d6de4d23ccba2e8dceb475278617b6aa2b4..f8dae19ca11bad13e08d32584e46e274a7e2bfb1 100644
--- a/appengine/findit/waterfall/process_swarming_task_result_pipeline.py
+++ b/appengine/findit/waterfall/process_swarming_task_result_pipeline.py
@@ -15,11 +15,12 @@ from waterfall import swarming_util
from waterfall import waterfall_config
-def _CheckTestsRunStatuses(output_json):
+def _CheckTestsRunStatuses(output_json, targeted_tests):
"""Checks result status for each test run and saves the numbers accordingly.
Args:
output_json (dict): A dict of all test results in the swarming task.
+ targeted_tests (list): A list of targeted tests.
Returns:
tests_statuses (dict): A dict of different statuses for each test.
@@ -31,6 +32,10 @@ def _CheckTestsRunStatuses(output_json):
if output_json:
for iteration in output_json.get('per_iteration_data'):
for test_name, tests in iteration.iteritems():
+ if test_name not in targeted_tests:
stgao 2016/06/02 01:31:20 If PRE_A failed on Waterfall and PRE_PRE_A failed
chanli 2016/06/02 22:40:09 In the end we should still say PRE_A failed.
stgao 2016/06/03 06:59:39 OK. The code seems fixed for this now.
+ # Some special pseudo tests like PRE_ tests may be added to task,
+ # should filter them out when check results.
+ continue
tests_statuses[test_name]['total_run'] += len(tests)
for test in tests:
tests_statuses[test_name][test['status']] += 1
@@ -62,7 +67,8 @@ class ProcessSwarmingTaskResultPipeline(BasePipeline):
HTTP_CLIENT = HttpClient()
# Arguments number differs from overridden method - pylint: disable=W0221
- def run(self, master_name, builder_name, build_number, step_name, task_id):
+ def run(
+ self, master_name, builder_name, build_number, step_name, task_id, tests):
"""
Args:
master_name (str): The master name.
@@ -70,6 +76,7 @@ class ProcessSwarmingTaskResultPipeline(BasePipeline):
build_number (str): The build number.
step_name (str): The failed test step name.
task_id (str): Id for the swarming task which is triggered by Findit.
+ tests (str): A list of test cases, eg: ['suite1.test1', 'suite2.test2'].
Returns:
A dict of lists for reliable/flaky tests.
@@ -102,7 +109,7 @@ class ProcessSwarmingTaskResultPipeline(BasePipeline):
outputs_ref = data.get('outputs_ref')
output_json = swarming_util.GetSwarmingTaskFailureLog(
outputs_ref, self.HTTP_CLIENT)
- tests_statuses = _CheckTestsRunStatuses(output_json)
+ tests_statuses = _CheckTestsRunStatuses(output_json, tests)
task.status = analysis_status.COMPLETED
task.tests_statuses = tests_statuses

Powered by Google App Engine
This is Rietveld 408576698