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

Side by Side Diff: appengine/findit/waterfall/test/build_util_test.py

Issue 2007783003: [Findit] Make sure build data is updated when use build master. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: . 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 unified diff | Download patch
« no previous file with comments | « appengine/findit/waterfall/build_util.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import datetime 5 import datetime
6 6
7 from testing_utils import testing 7 from testing_utils import testing
8 8
9 from model.wf_build import WfBuild 9 from model.wf_build import WfBuild
10 from waterfall import build_util 10 from waterfall import build_util
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 build.put() 140 build.put()
141 141
142 self.UpdateUnitTestConfigSettings( 142 self.UpdateUnitTestConfigSettings(
143 'download_build_data_settings', {'use_chrome_build_extract': False}) 143 'download_build_data_settings', {'use_chrome_build_extract': False})
144 self._MockUrlfetchWithBuildData(master_name, builder_name, build_number, 144 self._MockUrlfetchWithBuildData(master_name, builder_name, build_number,
145 build_data='Test get build data') 145 build_data='Test get build data')
146 146
147 build_util.DownloadBuildData(master_name, builder_name, build_number) 147 build_util.DownloadBuildData(master_name, builder_name, build_number)
148 148
149 self.assertEqual(build.data_source, build_util.BUILDBOT_MASTER) 149 self.assertEqual(build.data_source, build_util.BUILDBOT_MASTER)
150
151 def testDownloadBuildDataSourceFromBMUpateBuildData(self):
152 master_name = 'm'
153 builder_name = 'b'
154 build_number = 123
155 build = WfBuild.Create(master_name, builder_name, build_number)
156 build.data = 'Original build data'
157 build.last_crawled_time = self._TimeBeforeNowBySeconds(360)
158 build.put()
159
160 self.UpdateUnitTestConfigSettings(
161 'download_build_data_settings', {'use_chrome_build_extract': False})
162 self._MockUrlfetchWithBuildData(master_name, builder_name, build_number,
163 build_data='Test get build data')
164
165 build_util.DownloadBuildData(master_name, builder_name, build_number)
166
167 self.assertEqual(build.data_source, build_util.BUILDBOT_MASTER)
168 self.assertEqual(build.data, 'Test get build data from build master')
OLDNEW
« no previous file with comments | « appengine/findit/waterfall/build_util.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698