| 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 5f2dac55b4bb957defe1c713752da63f3aacccd5..23fb5f25dc24ef24d31090822c2b283bb901a7a7 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
|
| @@ -4,18 +4,16 @@
|
|
|
| import json
|
|
|
| -from testing_utils import testing
|
| -
|
| from common import buildbucket_client
|
| from common.git_repository import GitRepository
|
| from model.wf_try_job import WfTryJob
|
| from pipeline_wrapper import pipeline_handlers
|
| from waterfall import swarming_util
|
| from waterfall import trigger_swarming_task_pipeline
|
| -from waterfall import waterfall_config
|
| from waterfall.swarming_task_request import SwarmingTaskRequest
|
| from waterfall.swarming_tasks_to_try_job_pipeline import (
|
| SwarmingTasksToTryJobPipeline)
|
| +from waterfall.test import wf_configured_test_case
|
| from waterfall.try_job_type import TryJobType
|
|
|
|
|
| @@ -82,33 +80,11 @@ _SAMPLE_FAILURE_LOG = {
|
| ]
|
| }
|
|
|
| -_MOCK_SWARMING_SETTINGS = {
|
| - 'task_timeout_hours': 23,
|
| - 'server_query_interval_seconds': 60,
|
| - 'iterations_to_rerun': 10,
|
| - 'server_host': 'chromium-swarm.appspot.com',
|
| - 'default_request_priority': 150,
|
| - 'isolated_storage_url': 'isolateserver.storage.googleapis.com',
|
| - 'isolated_server': 'https://isolateserver.appspot.com',
|
| - 'request_expiration_hours': 20
|
| -}
|
| -
|
| -_MOCK_TRY_JOB_SETTINGS = {
|
| - 'server_query_interval_seconds': 60,
|
| - 'job_timeout_hours': 5,
|
| - 'allowed_response_error_times': 1
|
| -}
|
| -
|
|
|
| -class SwarmingTasksToTryJobPipelineTest(testing.AppengineTestCase):
|
| +class SwarmingTasksToTryJobPipelineTest(
|
| + wf_configured_test_case.WaterfallConfiguredTestCase):
|
| app_module = pipeline_handlers._APP
|
|
|
| - def _MockGetTrybotForWaterfallBuilder(self, *_):
|
| - def MockedGetTrybotForWaterfallBuilder(*_):
|
| - return 'linux_chromium_variable', 'master.tryserver.chromium.linux'
|
| - self.mock(waterfall_config, 'GetTrybotForWaterfallBuilder',
|
| - MockedGetTrybotForWaterfallBuilder)
|
| -
|
| def _MockTriggerTryJobs(self, responses):
|
| def MockedTriggerTryJobs(*_):
|
| try_job_results = []
|
| @@ -122,16 +98,6 @@ class SwarmingTasksToTryJobPipelineTest(testing.AppengineTestCase):
|
| return try_job_results
|
| self.mock(buildbucket_client, 'TriggerTryJobs', MockedTriggerTryJobs)
|
|
|
| - def _MockGetSwarmingSettings(self):
|
| - def _GetMockSwarmingSettings():
|
| - return _MOCK_SWARMING_SETTINGS
|
| - self.mock(waterfall_config, 'GetSwarmingSettings', _GetMockSwarmingSettings)
|
| -
|
| - def _MockGetTryJobSettings(self):
|
| - def _GetMockTryJobSettings():
|
| - return _MOCK_TRY_JOB_SETTINGS
|
| - self.mock(waterfall_config, 'GetTryJobSettings', _GetMockTryJobSettings)
|
| -
|
| def _MockGetTryJobs(self, build_id):
|
| def MockedGetTryJobs(*_):
|
| data = {
|
| @@ -231,11 +197,9 @@ class SwarmingTasksToTryJobPipelineTest(testing.AppengineTestCase):
|
| }
|
| }
|
| ]
|
| - self._MockGetTrybotForWaterfallBuilder(master_name, builder_name)
|
| self._MockTriggerTryJobs(responses)
|
| self._MockGetTryJobs('1')
|
| self._MockGetChangeLog('rev2')
|
| - self._MockGetTryJobSettings()
|
|
|
| WfTryJob.Create(master_name, builder_name, build_number).put()
|
|
|
| @@ -280,9 +244,6 @@ class SwarmingTasksToTryJobPipelineTest(testing.AppengineTestCase):
|
| 'b_test': [], # Non-swarming test.
|
| }
|
|
|
| - self._MockGetSwarmingSettings()
|
| - self._MockGetTryJobSettings()
|
| -
|
| # Mocks for TriggerSwarmingTaskPipeline.
|
| def MockedDownloadSwarmingTaskData(*_):
|
| return [{'task_id': '1'}, {'task_id': '2'}]
|
| @@ -361,7 +322,6 @@ class SwarmingTasksToTryJobPipelineTest(testing.AppengineTestCase):
|
| }
|
| }
|
| ]
|
| - self._MockGetTrybotForWaterfallBuilder(master_name, builder_name)
|
| self._MockTriggerTryJobs(responses)
|
| self._MockGetTryJobs('2')
|
| self._MockGetChangeLog('rev1')
|
|
|