OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 """Utility class to build the Skia master BuildFactory's. | 6 """Utility class to build the Skia master BuildFactory's. |
7 | 7 |
8 Based on gclient_factory.py and adds Skia-specific steps.""" | 8 Based on gclient_factory.py and adds Skia-specific steps.""" |
9 | 9 |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 _COMPILE_NO_WERR_PREFIX = 'Retry_NoWarningsAsErrors_' + _COMPILE_STEP_PREFIX | 43 _COMPILE_NO_WERR_PREFIX = 'Retry_NoWarningsAsErrors_' + _COMPILE_STEP_PREFIX |
44 | 44 |
45 | 45 |
46 class SkiaFactory(BuildFactory): | 46 class SkiaFactory(BuildFactory): |
47 """Encapsulates data and methods common to the Skia master.cfg files.""" | 47 """Encapsulates data and methods common to the Skia master.cfg files.""" |
48 | 48 |
49 def __init__(self, other_subdirs=None, do_upload_results=False, | 49 def __init__(self, other_subdirs=None, do_upload_results=False, |
50 do_patch_step=False, build_subdir='trunk', | 50 do_patch_step=False, build_subdir='trunk', |
51 target_platform=None, configuration=CONFIG_DEBUG, | 51 target_platform=None, configuration=CONFIG_DEBUG, |
52 default_timeout=8*60*60, deps_target_os=None, | 52 default_timeout=8*60*60, deps_target_os=None, |
53 environment_variables=None, gm_image_subdir=None, | 53 environment_variables=None, |
54 perf_output_basedir=None, builder_name=None, flavor=None, | 54 perf_output_basedir=None, builder_name=None, flavor=None, |
55 make_flags=None, test_args=None, gm_args=None, bench_args=None, | 55 make_flags=None, test_args=None, gm_args=None, bench_args=None, |
56 bench_pictures_cfg='default', compile_warnings_as_errors=False, | 56 bench_pictures_cfg='default', compile_warnings_as_errors=False, |
57 gyp_defines=None, build_targets=None): | 57 gyp_defines=None, build_targets=None): |
58 """Instantiates a SkiaFactory as appropriate for this target_platform. | 58 """Instantiates a SkiaFactory as appropriate for this target_platform. |
59 | 59 |
60 do_upload_results: whether we should upload bench/gm results | 60 do_upload_results: whether we should upload bench/gm results |
61 do_patch_step: whether the build should include a step which applies a | 61 do_patch_step: whether the build should include a step which applies a |
62 patch. This is only applicable for trybots. | 62 patch. This is only applicable for trybots. |
63 build_subdir: subdirectory to check out and then build within | 63 build_subdir: subdirectory to check out and then build within |
64 other_subdirs: list of other subdirectories to also check out (or None) | 64 other_subdirs: list of other subdirectories to also check out (or None) |
65 target_platform: a string such as TARGET_PLATFORM_LINUX | 65 target_platform: a string such as TARGET_PLATFORM_LINUX |
66 configuration: 'Debug' or 'Release' | 66 configuration: 'Debug' or 'Release' |
67 default_timeout: default timeout for each command, in seconds | 67 default_timeout: default timeout for each command, in seconds |
68 deps_target_os: string; the target_os to be specified in the gclient config. | 68 deps_target_os: string; the target_os to be specified in the gclient config. |
69 environment_variables: dictionary of environment variables that should | 69 environment_variables: dictionary of environment variables that should |
70 be passed to all commands | 70 be passed to all commands |
71 gm_image_subdir: directory containing images for comparison against results | |
72 of gm tool | |
73 perf_output_basedir: path to directory under which to store performance | 71 perf_output_basedir: path to directory under which to store performance |
74 data, or None if we don't want to store performance data | 72 data, or None if we don't want to store performance data |
75 builder_name: name of the builder associated with this factory | 73 builder_name: name of the builder associated with this factory |
76 flavor: which "flavor" of slave-side scripts this factory should use | 74 flavor: which "flavor" of slave-side scripts this factory should use |
77 make_flags: list of extra flags to pass to the compile step | 75 make_flags: list of extra flags to pass to the compile step |
78 test_args: list of extra flags to pass to the 'tests' executable | 76 test_args: list of extra flags to pass to the 'tests' executable |
79 gm_args: list of extra flags to pass to the 'gm' executable | 77 gm_args: list of extra flags to pass to the 'gm' executable |
80 bench_args: list of extra flags to pass to the 'bench' executable | 78 bench_args: list of extra flags to pass to the 'bench' executable |
81 bench_pictures_cfg: config name to use for bench_pictures | 79 bench_pictures_cfg: config name to use for bench_pictures |
82 compile_warnings_as_errors: boolean; whether to build with "-Werror" or | 80 compile_warnings_as_errors: boolean; whether to build with "-Werror" or |
(...skipping 24 matching lines...) Expand all Loading... |
107 subdirs_to_checkout = set(other_subdirs) | 105 subdirs_to_checkout = set(other_subdirs) |
108 | 106 |
109 # Trybots need to check out all of these directories. | 107 # Trybots need to check out all of these directories. |
110 for other_subdir in subdirs_to_checkout: | 108 for other_subdir in subdirs_to_checkout: |
111 self._gclient_solutions.append(gclient_factory.GClientSolution( | 109 self._gclient_solutions.append(gclient_factory.GClientSolution( |
112 svn_url=SKIA_SVN_BASEURL + '/' + other_subdir, | 110 svn_url=SKIA_SVN_BASEURL + '/' + other_subdir, |
113 name=other_subdir).GetSpec()) | 111 name=other_subdir).GetSpec()) |
114 | 112 |
115 self._deps_target_os = deps_target_os | 113 self._deps_target_os = deps_target_os |
116 | 114 |
117 if gm_image_subdir: | |
118 properties['gm_image_subdir'] = gm_image_subdir | |
119 | |
120 # Set _default_clobber based on config.Master | 115 # Set _default_clobber based on config.Master |
121 self._default_clobber = getattr(config.Master, 'default_clobber', False) | 116 self._default_clobber = getattr(config.Master, 'default_clobber', False) |
122 | 117 |
123 self._do_upload_results = do_upload_results | 118 self._do_upload_results = do_upload_results |
124 self._do_upload_bench_results = do_upload_results and \ | 119 self._do_upload_bench_results = do_upload_results and \ |
125 perf_output_basedir != None | 120 perf_output_basedir != None |
126 self._do_patch_step = do_patch_step | 121 self._do_patch_step = do_patch_step |
127 | 122 |
128 if not environment_variables: | 123 if not environment_variables: |
129 self._env_vars = {} | 124 self._env_vars = {} |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 if not gm_args: | 173 if not gm_args: |
179 gm_args = [] | 174 gm_args = [] |
180 if not bench_args: | 175 if not bench_args: |
181 bench_args = [] | 176 bench_args = [] |
182 | 177 |
183 self._common_args = [ | 178 self._common_args = [ |
184 '--autogen_svn_baseurl', AUTOGEN_SVN_BASEURL, | 179 '--autogen_svn_baseurl', AUTOGEN_SVN_BASEURL, |
185 '--configuration', configuration, | 180 '--configuration', configuration, |
186 '--deps_target_os', self._deps_target_os or 'None', | 181 '--deps_target_os', self._deps_target_os or 'None', |
187 '--do_upload_results', str(self._do_upload_results), | 182 '--do_upload_results', str(self._do_upload_results), |
188 '--gm_image_subdir', gm_image_subdir or 'None', | |
189 '--builder_name', builder_name, | 183 '--builder_name', builder_name, |
190 '--target_platform', target_platform, | 184 '--target_platform', target_platform, |
191 '--revision', WithProperties('%(rev)s', rev=_DetermineRevision), | 185 '--revision', WithProperties('%(rev)s', rev=_DetermineRevision), |
192 '--got_revision', WithProperties('%(got_revision:-None)s'), | 186 '--got_revision', WithProperties('%(got_revision:-None)s'), |
193 '--perf_output_basedir', perf_output_basedir or 'None', | 187 '--perf_output_basedir', perf_output_basedir or 'None', |
194 '--make_flags', '"%s"' % ' '.join(self._make_flags), | 188 '--make_flags', '"%s"' % ' '.join(self._make_flags), |
195 '--test_args', '"%s"' % ' '.join(test_args), | 189 '--test_args', '"%s"' % ' '.join(test_args), |
196 '--gm_args', '"%s"' % ' '.join(gm_args), | 190 '--gm_args', '"%s"' % ' '.join(gm_args), |
197 '--bench_args', '"%s"' % ' '.join(bench_args), | 191 '--bench_args', '"%s"' % ' '.join(bench_args), |
198 '--num_cores', WithProperties('%(num_cores:-None)s'), | 192 '--num_cores', WithProperties('%(num_cores:-None)s'), |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 def PreBench(self): | 487 def PreBench(self): |
494 """ Step to run before the benchmarking steps. """ | 488 """ Step to run before the benchmarking steps. """ |
495 self.AddFlavoredSlaveScript(script='prebench.py', description='PreBench') | 489 self.AddFlavoredSlaveScript(script='prebench.py', description='PreBench') |
496 | 490 |
497 def PostBench(self): | 491 def PostBench(self): |
498 """ Step to run after the benchmarking steps. """ | 492 """ Step to run after the benchmarking steps. """ |
499 self.AddFlavoredSlaveScript(script='postbench.py', description='PostBench') | 493 self.AddFlavoredSlaveScript(script='postbench.py', description='PostBench') |
500 | 494 |
501 def CompareGMs(self): | 495 def CompareGMs(self): |
502 """ Run the "skdiff" tool to compare the "actual" GM images we just | 496 """ Run the "skdiff" tool to compare the "actual" GM images we just |
503 generated to the baselines in _gm_image_subdir. """ | 497 generated to the baselines for this builder_name. """ |
504 self.AddSlaveScript(script='compare_gms.py', description='CompareGMs', | 498 self.AddSlaveScript(script='compare_gms.py', description='CompareGMs', |
505 is_rebaseline_step=True) | 499 is_rebaseline_step=True) |
506 | 500 |
507 def CompareAndUploadWebpageGMs(self): | 501 def CompareAndUploadWebpageGMs(self): |
508 """ Run the "skdiff" tool to compare the "actual" GM images we just | 502 """ Run the "skdiff" tool to compare the "actual" GM images we just |
509 generated to the baselines in _gm_image_subdir and uploads the actual | 503 generated to the baselines for this builder_name and uploads the actual |
510 images if appropriate. """ | 504 images if appropriate. """ |
511 self.AddSlaveScript(script='compare_and_upload_webpage_gms.py', | 505 self.AddSlaveScript(script='compare_and_upload_webpage_gms.py', |
512 description='CompareAndUploadWebpageGMs', | 506 description='CompareAndUploadWebpageGMs', |
513 is_rebaseline_step=True) | 507 is_rebaseline_step=True) |
514 | 508 |
515 def RunBench(self): | 509 def RunBench(self): |
516 """ Run "bench", piping the output somewhere so we can graph | 510 """ Run "bench", piping the output somewhere so we can graph |
517 results over time. """ | 511 results over time. """ |
518 self.AddFlavoredSlaveScript(script='run_bench.py', description='RunBench') | 512 self.AddFlavoredSlaveScript(script='run_bench.py', description='RunBench') |
519 | 513 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 # Perf-only builder. | 699 # Perf-only builder. |
706 if not self._perf_output_basedir: | 700 if not self._perf_output_basedir: |
707 raise ValueError( | 701 raise ValueError( |
708 'BuildPerfOnly requires perf_output_basedir to be defined.') | 702 'BuildPerfOnly requires perf_output_basedir to be defined.') |
709 if self._configuration != CONFIG_RELEASE: | 703 if self._configuration != CONFIG_RELEASE: |
710 raise ValueError('BuildPerfOnly should run in %s configuration.' % | 704 raise ValueError('BuildPerfOnly should run in %s configuration.' % |
711 CONFIG_RELEASE) | 705 CONFIG_RELEASE) |
712 self.PerfSteps() | 706 self.PerfSteps() |
713 self.Validate() | 707 self.Validate() |
714 return self | 708 return self |
OLD | NEW |