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..ee9d764d7d4c37f7fa548992efde52455af92359 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_testcase |
from waterfall.try_job_type import TryJobType |
@@ -82,33 +80,10 @@ _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_testcase.WaterfallTestCase): |
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 +97,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 +196,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 +243,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 +321,6 @@ class SwarmingTasksToTryJobPipelineTest(testing.AppengineTestCase): |
} |
} |
] |
- self._MockGetTrybotForWaterfallBuilder(master_name, builder_name) |
self._MockTriggerTryJobs(responses) |
self._MockGetTryJobs('2') |
self._MockGetChangeLog('rev1') |