| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """Utility class to build the Skia master BuildFactory's for HouseKeeping bots. | 5 """Utility class to build the Skia master BuildFactory's for HouseKeeping bots. |
| 6 | 6 |
| 7 Overrides SkiaFactory with Periodic HouseKeeping steps.""" | 7 Overrides SkiaFactory with Periodic HouseKeeping steps.""" |
| 8 | 8 |
| 9 import tempfile | 9 import tempfile |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 """Build and return the complete BuildFactory. | 23 """Build and return the complete BuildFactory. |
| 24 | 24 |
| 25 clobber: boolean indicating whether we should clean before building | 25 clobber: boolean indicating whether we should clean before building |
| 26 """ | 26 """ |
| 27 self.UpdateSteps() | 27 self.UpdateSteps() |
| 28 if clobber is None: | 28 if clobber is None: |
| 29 clobber = self._default_clobber | 29 clobber = self._default_clobber |
| 30 if clobber: | 30 if clobber: |
| 31 self.AddSlaveScript(script='clean.py', description='Clean') | 31 self.AddSlaveScript(script='clean.py', description='Clean') |
| 32 | 32 |
| 33 sanitize_script_path = self.TargetPathJoin('tools', | 33 if not self._do_patch_step: # Do not run the sanitizer if it is a try job. |
| 34 'sanitize_source_files.py') | 34 sanitize_script_path = self.TargetPathJoin('tools', |
| 35 skia_trunk_svn_baseurl = '%s/%s' % ( | 35 'sanitize_source_files.py') |
| 36 SKIA_SVN_BASEURL.replace('http', 'https'), 'trunk') | 36 skia_trunk_svn_baseurl = '%s/%s' % ( |
| 37 # Run the sanitization script. | 37 SKIA_SVN_BASEURL.replace('http', 'https'), 'trunk') |
| 38 self._skia_cmd_obj.AddRunCommand( | 38 # Run the sanitization script. |
| 39 command='python %s' % sanitize_script_path, | |
| 40 description='RunSanitization') | |
| 41 if self._do_upload_results: | |
| 42 merge_dir_path = self.TargetPathJoin(tempfile.gettempdir(), | |
| 43 'sanitize-merge') | |
| 44 # Cleanup the previous (if any) sanitize merge dir. | |
| 45 self._skia_cmd_obj.AddRunCommand( | 39 self._skia_cmd_obj.AddRunCommand( |
| 46 command='rm -rf %s' % merge_dir_path, description='Cleanup') | 40 command='python %s' % sanitize_script_path, |
| 47 # Upload sanitized files. | 41 description='RunSanitization') |
| 48 self._skia_cmd_obj.AddMergeIntoSvn( | 42 if self._do_upload_results: |
| 49 source_dir_path='.', | 43 merge_dir_path = self.TargetPathJoin(tempfile.gettempdir(), |
| 50 dest_svn_url=skia_trunk_svn_baseurl, | 44 'sanitize-merge') |
| 51 merge_dir_path=merge_dir_path, | 45 # Cleanup the previous (if any) sanitize merge dir. |
| 52 svn_username_file=self._skia_svn_username_file, | 46 self._skia_cmd_obj.AddRunCommand( |
| 53 svn_password_file=self._skia_svn_password_file, | 47 command='rm -rf %s' % merge_dir_path, description='Cleanup') |
| 54 commit_message=WithProperties( | 48 # Upload sanitized files. |
| 55 'Sanitizing source files in %s' % self._builder_name), | 49 self._skia_cmd_obj.AddMergeIntoSvn( |
| 56 description='UploadSanitizedFiles') | 50 source_dir_path='.', |
| 51 dest_svn_url=skia_trunk_svn_baseurl, |
| 52 merge_dir_path=merge_dir_path, |
| 53 svn_username_file=self._skia_svn_username_file, |
| 54 svn_password_file=self._skia_svn_password_file, |
| 55 commit_message=WithProperties( |
| 56 'Sanitizing source files in %s' % self._builder_name), |
| 57 description='UploadSanitizedFiles') |
| 57 | 58 |
| 58 # pylint: disable=W0212 | 59 # pylint: disable=W0212 |
| 59 clang_static_analyzer_script_path = self.TargetPathJoin( | 60 clang_static_analyzer_script_path = self.TargetPathJoin( |
| 60 self._skia_cmd_obj._local_slave_script_dir, | 61 self._skia_cmd_obj._local_slave_script_dir, |
| 61 'run-clang-static-analyzer.sh') | 62 'run-clang-static-analyzer.sh') |
| 62 self._skia_cmd_obj.AddRunCommand( | 63 self._skia_cmd_obj.AddRunCommand( |
| 63 command=clang_static_analyzer_script_path, | 64 command=clang_static_analyzer_script_path, |
| 64 description='RunClangStaticAnalyzer') | 65 description='RunClangStaticAnalyzer') |
| 65 | 66 |
| 66 self.AddSlaveScript(script='check_gs_timestamps.py', | 67 self.AddSlaveScript(script='check_gs_timestamps.py', |
| 67 description='CheckGoogleStorageTimestamps') | 68 description='CheckGoogleStorageTimestamps') |
| 68 | 69 |
| 69 # pylint: disable=W0212 | 70 if not self._do_patch_step: # Do not run the checkers if it is a try job. |
| 70 disk_usage_script_path = self.TargetPathJoin( | 71 # pylint: disable=W0212 |
| 71 self._skia_cmd_obj._local_slave_script_dir, | 72 disk_usage_script_path = self.TargetPathJoin( |
| 72 'check_compute_engine_disk_usage.sh') | 73 self._skia_cmd_obj._local_slave_script_dir, |
| 73 self._skia_cmd_obj.AddRunCommand( | 74 'check_compute_engine_disk_usage.sh') |
| 74 command=('SKIA_COMPUTE_ENGINE_HOSTNAME=%s PERSISTENT_DISK_NAME=' | 75 self._skia_cmd_obj.AddRunCommand( |
| 75 '/home/default/skia-master %s' | 76 command=('SKIA_COMPUTE_ENGINE_HOSTNAME=%s PERSISTENT_DISK_NAME=' |
| 76 % (SKIA_PUBLIC_MASTER, disk_usage_script_path)), | 77 '/home/default/skia-master %s' |
| 77 description='CheckMasterDiskUsage') | 78 % (SKIA_PUBLIC_MASTER, disk_usage_script_path)), |
| 78 self._skia_cmd_obj.AddRunCommand( | 79 description='CheckMasterDiskUsage') |
| 79 command=(WithProperties('SKIA_COMPUTE_ENGINE_HOSTNAME=%(slavename)s ' | 80 self._skia_cmd_obj.AddRunCommand( |
| 80 'PERSISTENT_DISK_NAME=' | 81 command=(WithProperties('SKIA_COMPUTE_ENGINE_HOSTNAME=%(slavename)s ' |
| 81 '/home/default/skia-slave ' + \ | 82 'PERSISTENT_DISK_NAME=' |
| 82 disk_usage_script_path)), | 83 '/home/default/skia-slave ' + \ |
| 83 description='CheckHousekeepingSlaveDiskUsage') | 84 disk_usage_script_path)), |
| 85 description='CheckHousekeepingSlaveDiskUsage') |
| 84 | 86 |
| 85 return self | 87 return self |
| 86 | 88 |
| OLD | NEW |