| Index: appengine/findit/waterfall/swarming_tasks_to_try_job_pipeline.py
|
| diff --git a/appengine/findit/waterfall/swarming_tasks_to_try_job_pipeline.py b/appengine/findit/waterfall/swarming_tasks_to_try_job_pipeline.py
|
| index 912dd2f9df6762bd27efaabdfef46cbafdee0b65..e0b6f3932b7f5ac481539efaab151c0f342f792b 100644
|
| --- a/appengine/findit/waterfall/swarming_tasks_to_try_job_pipeline.py
|
| +++ b/appengine/findit/waterfall/swarming_tasks_to_try_job_pipeline.py
|
| @@ -13,6 +13,32 @@ from waterfall.trigger_swarming_task_pipeline import TriggerSwarmingTaskPipeline
|
| from waterfall.try_job_type import TryJobType
|
|
|
|
|
| +_PRE_TEST_PREFIX = 'PRE_'
|
| +
|
| +
|
| +def _RemoveAnyPrefixes(tests):
|
| + """Remove prefixes from test names.
|
| +
|
| + Args:
|
| + tests (list): A list of tests, eg: ['suite1.PRE_test1', 'suite2.test2'].
|
| +
|
| + Returns:
|
| + base_tests (list): A list of base tests, eg:
|
| + ['suite1.test1', 'suite2.test2'].
|
| + """
|
| + base_tests = []
|
| + for test in tests:
|
| + test_name_start = test.find('.') if test.find('.') > -1 else 0
|
| + test_suite = test[ : test_name_start]
|
| + test_name = test[test_name_start + 1 : ]
|
| + pre_position = test_name.find(_PRE_TEST_PREFIX)
|
| + while pre_position == 0:
|
| + test_name = test_name[len(_PRE_TEST_PREFIX):]
|
| + pre_position = test_name.find(_PRE_TEST_PREFIX)
|
| + base_tests.append(test_suite + '.' + test_name)
|
| + return base_tests
|
| +
|
| +
|
| class SwarmingTasksToTryJobPipeline(BasePipeline):
|
| """Root Pipeline to start swarming tasks and possible try job on the build."""
|
|
|
| @@ -26,13 +52,18 @@ class SwarmingTasksToTryJobPipeline(BasePipeline):
|
| # ProcessSwarmingTaskResultPipeline.
|
| # The format would be [('step1', {'flaky_tests': ['test1', ..], ..}), ..]
|
| classified_tests_by_step = []
|
| + targeted_base_tests = {}
|
|
|
| if try_job_type == TryJobType.TEST:
|
| for step_name, tests in targeted_tests.iteritems():
|
| + base_tests = _RemoveAnyPrefixes(tests)
|
| + targeted_base_tests[step_name] = base_tests
|
| +
|
| if not tests: # Skip non-swarming tests.
|
| continue
|
| + # Triggers swarming task for the base_tests.
|
| task_id = yield TriggerSwarmingTaskPipeline(
|
| - master_name, builder_name, build_number, step_name, tests)
|
| + master_name, builder_name, build_number, step_name, base_tests)
|
| step_future = yield ProcessSwarmingTaskResultPipeline(
|
| master_name, builder_name, build_number, step_name, task_id)
|
| logging_str = (
|
| @@ -44,5 +75,5 @@ class SwarmingTasksToTryJobPipeline(BasePipeline):
|
| # Waits until classified_tests_by_step are ready.
|
| yield RunTryJobForReliableFailurePipeline(
|
| master_name, builder_name, build_number, good_revision,
|
| - bad_revision, blame_list, try_job_type, compile_targets, targeted_tests,
|
| - suspected_cls, *classified_tests_by_step)
|
| + bad_revision, blame_list, try_job_type, compile_targets,
|
| + targeted_base_tests, suspected_cls, *classified_tests_by_step)
|
|
|