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

Unified Diff: appengine/findit/waterfall/test/swarming_tasks_to_try_job_pipeline_test.py

Issue 1836293002: [Findit] Adding central config test class for unit tests (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebase Created 4 years, 8 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/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')

Powered by Google App Engine
This is Rietveld 408576698