| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 | 5 |
| 6 from slave import recipe_api | 6 from slave import recipe_api |
| 7 from slave import recipe_config_types | 7 from slave import recipe_config_types |
| 8 from common.skia import builder_name_schema | 8 from common.skia import builder_name_schema |
| 9 from common.skia import global_constants | 9 from common.skia import global_constants |
| 10 from . import android_flavor | 10 from . import android_flavor |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 self.flavor.create_clean_device_dir(device_path) | 213 self.flavor.create_clean_device_dir(device_path) |
| 214 self.flavor.copy_directory_contents_to_device(host_path, device_path) | 214 self.flavor.copy_directory_contents_to_device(host_path, device_path) |
| 215 | 215 |
| 216 # Copy the new version file. | 216 # Copy the new version file. |
| 217 self.flavor.copy_file_to_device(actual_version_file, | 217 self.flavor.copy_file_to_device(actual_version_file, |
| 218 device_version_file) | 218 device_version_file) |
| 219 | 219 |
| 220 def download_and_copy_images(self): | 220 def download_and_copy_images(self): |
| 221 """Download test images if needed.""" | 221 """Download test images if needed.""" |
| 222 # Ensure that the tmp_dir exists. | 222 # Ensure that the tmp_dir exists. |
| 223 self._run_once(self.m.path.makedirs, 'tmp_dir', self.tmp_dir) | 223 self._run_once(self.m.file.makedirs, 'tmp_dir', self.tmp_dir) |
| 224 | 224 |
| 225 # Determine which version we have and which version we want. | 225 # Determine which version we have and which version we want. |
| 226 timestamp_file = 'TIMESTAMP_LAST_UPLOAD_COMPLETED' | 226 timestamp_file = 'TIMESTAMP_LAST_UPLOAD_COMPLETED' |
| 227 url = '/'.join(('gs:/', global_constants.GS_GM_BUCKET, 'skimage', 'input', | 227 url = '/'.join(('gs:/', global_constants.GS_GM_BUCKET, 'skimage', 'input', |
| 228 timestamp_file)) | 228 timestamp_file)) |
| 229 expected_version = self.m.gsutil.cat( | 229 expected_version = self.m.gsutil.cat( |
| 230 url, | 230 url, |
| 231 name='cat %s' % timestamp_file, | 231 name='cat %s' % timestamp_file, |
| 232 version=GSUTIL_VERSION, | 232 version=GSUTIL_VERSION, |
| 233 stdout=self.m.raw_io.output()).stdout.rstrip() | 233 stdout=self.m.raw_io.output()).stdout.rstrip() |
| 234 | 234 |
| 235 test_data = TEST_EXPECTED_SKIMAGE_VERSION | 235 test_data = TEST_EXPECTED_SKIMAGE_VERSION |
| 236 if self.m.properties.get('test_downloaded_skimage_version'): | 236 if self.m.properties.get('test_downloaded_skimage_version'): |
| 237 test_data = self.m.properties['test_downloaded_skimage_version'] | 237 test_data = self.m.properties['test_downloaded_skimage_version'] |
| 238 | 238 |
| 239 self._download_and_copy_dir(expected_version, | 239 self._download_and_copy_dir(expected_version, |
| 240 'SKIMAGE_VERSION', | 240 'SKIMAGE_VERSION', |
| 241 '/'.join(('skimage', 'input')), | 241 '/'.join(('skimage', 'input')), |
| 242 self.images_dir, | 242 self.images_dir, |
| 243 self.device_dirs.images_dir, | 243 self.device_dirs.images_dir, |
| 244 test_actual_version=test_data) | 244 test_actual_version=test_data) |
| 245 | 245 |
| 246 def download_and_copy_skps(self): | 246 def download_and_copy_skps(self): |
| 247 """Download the SKPs if needed.""" | 247 """Download the SKPs if needed.""" |
| 248 # Ensure that the tmp_dir exists. | 248 # Ensure that the tmp_dir exists. |
| 249 self._run_once(self.m.path.makedirs, 'tmp_dir', self.tmp_dir) | 249 self._run_once(self.m.file.makedirs, 'tmp_dir', self.tmp_dir) |
| 250 | 250 |
| 251 # Determine which version we have and which version we want. | 251 # Determine which version we have and which version we want. |
| 252 version_file = 'SKP_VERSION' | 252 version_file = 'SKP_VERSION' |
| 253 expected_version_file = self.m.path['checkout'].join(version_file) | 253 expected_version_file = self.m.path['checkout'].join(version_file) |
| 254 expected_version = self._readfile(expected_version_file, | 254 expected_version = self._readfile(expected_version_file, |
| 255 name='Get expected SKP_VERSION', | 255 name='Get expected SKP_VERSION', |
| 256 test_data=TEST_EXPECTED_SKP_VERSION) | 256 test_data=TEST_EXPECTED_SKP_VERSION) |
| 257 | 257 |
| 258 test_data = TEST_EXPECTED_SKP_VERSION | 258 test_data = TEST_EXPECTED_SKP_VERSION |
| 259 if self.m.properties.get('test_downloaded_skp_version'): | 259 if self.m.properties.get('test_downloaded_skp_version'): |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 # TryBots are uploaded elsewhere so they can use the same key. | 517 # TryBots are uploaded elsewhere so they can use the same key. |
| 518 blacklist = ['role', 'is_trybot'] | 518 blacklist = ['role', 'is_trybot'] |
| 519 | 519 |
| 520 params = builder_name_schema.DictForBuilderName(self.c.BUILDER_NAME) | 520 params = builder_name_schema.DictForBuilderName(self.c.BUILDER_NAME) |
| 521 flat = [] | 521 flat = [] |
| 522 for k in sorted(params.keys()): | 522 for k in sorted(params.keys()): |
| 523 if k not in blacklist: | 523 if k not in blacklist: |
| 524 flat.append(k) | 524 flat.append(k) |
| 525 flat.append(params[k]) | 525 flat.append(params[k]) |
| 526 return flat | 526 return flat |
| OLD | NEW |