Chromium Code Reviews| 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 # b. All of the printing can noticeably slow down the master startup | 241 # b. All of the printing can noticeably slow down the master startup |
| 242 # c. The master prints so much output that it would be easy to miss the | 242 # c. The master prints so much output that it would be easy to miss the |
| 243 # diff if we did print it. | 243 # diff if we did print it. |
| 244 print 'Warning: Factory configuration for %s does not match ' \ | 244 print 'Warning: Factory configuration for %s does not match ' \ |
| 245 'expectation!' % self._builder_name | 245 'expectation!' % self._builder_name |
| 246 | 246 |
| 247 # TODO(borenet): Can kwargs be used to simplify this function declaration? | 247 # TODO(borenet): Can kwargs be used to simplify this function declaration? |
| 248 def AddSlaveScript(self, script, description, args=None, timeout=None, | 248 def AddSlaveScript(self, script, description, args=None, timeout=None, |
| 249 halt_on_failure=False, | 249 halt_on_failure=False, |
| 250 is_upload_render_step=False, is_upload_bench_step=False, | 250 is_upload_render_step=False, is_upload_bench_step=False, |
| 251 is_rebaseline_step=False, get_props_from_stdout=None, | 251 is_rebaseline_step=False, |
| 252 get_links_from_stdout=None, get_props_from_stdout=None, | |
| 252 workdir=None, do_step_if=None, always_run=False, | 253 workdir=None, do_step_if=None, always_run=False, |
| 253 flunk_on_failure=True, exception_on_failure=False): | 254 flunk_on_failure=True, exception_on_failure=False): |
| 254 """ Add a BuildStep consisting of a python script. | 255 """ Add a BuildStep consisting of a python script. |
| 255 | 256 |
| 256 script: which slave-side python script to run. | 257 script: which slave-side python script to run. |
| 257 description: string briefly describing the BuildStep; if this description | 258 description: string briefly describing the BuildStep; if this description |
| 258 is in the self.skipsteps list, this BuildStep will be skipped--unless | 259 is in the self.skipsteps list, this BuildStep will be skipped--unless |
| 259 it's in the self.dontskipsteps list, in which case we run it! | 260 it's in the self.dontskipsteps list, in which case we run it! |
| 260 args: optional list of strings; arguments to pass to the script. | 261 args: optional list of strings; arguments to pass to the script. |
| 261 timeout: optional integer; maximum time for the BuildStep to complete. | 262 timeout: optional integer; maximum time for the BuildStep to complete. |
| 262 halt_on_failure: boolean indicating whether to continue the build if this | 263 halt_on_failure: boolean indicating whether to continue the build if this |
| 263 step fails. | 264 step fails. |
| 264 is_upload_render_step: boolean; if true, only run if | 265 is_upload_render_step: boolean; if true, only run if |
| 265 self._do_upload_render_results is True | 266 self._do_upload_render_results is True |
| 266 is_upload_bench_step: boolean; if true, only run if | 267 is_upload_bench_step: boolean; if true, only run if |
| 267 self._do_upload_bench_results is True | 268 self._do_upload_bench_results is True |
| 268 is_rebaseline_step: boolean indicating whether this step is required for | 269 is_rebaseline_step: boolean indicating whether this step is required for |
| 269 rebaseline-only builds. | 270 rebaseline-only builds. |
| 271 get_links_from_stdout: optional dictionary. Keys are strings indicating | |
| 272 link text to set based on the output of this step. Values are | |
| 273 strings containing regular expressions for parsing the linked URL from | |
| 274 the output of the step. | |
| 270 get_props_from_stdout: optional dictionary. Keys are strings indicating | 275 get_props_from_stdout: optional dictionary. Keys are strings indicating |
| 271 build properties to set based on the output of this step. Values are | 276 build properties to set based on the output of this step. Values are |
| 272 strings containing regular expressions for parsing the property from | 277 strings containing regular expressions for parsing the property from |
| 273 the output of the step. | 278 the output of the step. |
| 274 workdir: optional string indicating the working directory in which to run | 279 workdir: optional string indicating the working directory in which to run |
| 275 the script. If this is provided, then the script must be given relative | 280 the script. If this is provided, then the script must be given relative |
| 276 to this directory. | 281 to this directory. |
| 277 do_step_if: optional, function which determines whether or not to run the | 282 do_step_if: optional, function which determines whether or not to run the |
| 278 step. The function is not evaluated until runtime. | 283 step. The function is not evaluated until runtime. |
| 279 always_run: boolean indicating whether this step should run even if a | 284 always_run: boolean indicating whether this step should run even if a |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 298 if args: | 303 if args: |
| 299 arguments += args | 304 arguments += args |
| 300 self._skia_cmd_obj.AddSlaveScript( | 305 self._skia_cmd_obj.AddSlaveScript( |
| 301 script=script, | 306 script=script, |
| 302 args=arguments, | 307 args=arguments, |
| 303 description=description, | 308 description=description, |
| 304 timeout=timeout, | 309 timeout=timeout, |
| 305 halt_on_failure=halt_on_failure, | 310 halt_on_failure=halt_on_failure, |
| 306 is_upload_step=is_upload_render_step or is_upload_bench_step, | 311 is_upload_step=is_upload_render_step or is_upload_bench_step, |
| 307 is_rebaseline_step=is_rebaseline_step, | 312 is_rebaseline_step=is_rebaseline_step, |
| 313 get_links_from_stdout=get_links_from_stdout, | |
| 308 get_props_from_stdout=get_props_from_stdout, | 314 get_props_from_stdout=get_props_from_stdout, |
| 309 workdir=workdir, | 315 workdir=workdir, |
| 310 do_step_if=do_step_if, | 316 do_step_if=do_step_if, |
| 311 always_run=always_run, | 317 always_run=always_run, |
| 312 flunk_on_failure=flunk_on_failure, | 318 flunk_on_failure=flunk_on_failure, |
| 313 exception_on_failure=exception_on_failure) | 319 exception_on_failure=exception_on_failure) |
| 314 | 320 |
| 315 def AddFlavoredSlaveScript(self, script, args=None, **kwargs): | 321 def AddFlavoredSlaveScript(self, script, args=None, **kwargs): |
| 316 """ Add a flavor-specific BuildStep. | 322 """ Add a flavor-specific BuildStep. |
| 317 | 323 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 525 def PostBench(self): | 531 def PostBench(self): |
| 526 """ Step to run after the benchmarking steps. """ | 532 """ Step to run after the benchmarking steps. """ |
| 527 self.AddFlavoredSlaveScript(script='postbench.py', | 533 self.AddFlavoredSlaveScript(script='postbench.py', |
| 528 description='PostBench', | 534 description='PostBench', |
| 529 exception_on_failure=True) | 535 exception_on_failure=True) |
| 530 | 536 |
| 531 def CompareGMs(self): | 537 def CompareGMs(self): |
| 532 """Compare the actually-generated GM images to the checked-in baselines.""" | 538 """Compare the actually-generated GM images to the checked-in baselines.""" |
| 533 self.AddSlaveScript(script='compare_gms.py', | 539 self.AddSlaveScript(script='compare_gms.py', |
| 534 description='CompareGMs', | 540 description='CompareGMs', |
| 535 get_props_from_stdout={ | 541 get_links_from_stdout={ |
| 536 'latest_gm_failures_url': | 542 'Latest GM failures on this builder': |
|
epoger
2014/06/05 22:15:36
For more flexibility, we could even allow the clie
borenet
2014/06/06 12:10:34
This makes me wish we had better performance measu
epoger
2014/06/09 13:33:28
I think those functions sound like a good idea. A
| |
| 537 '%s([^\n]*)\n' % skia_vars.GetGlobalVariable( | 543 '%s([^\n]*)\n' % skia_vars.GetGlobalVariable( |
| 538 'latest_gm_failures_preamble')}, | 544 'latest_gm_failures_preamble')}, |
| 539 is_rebaseline_step=True) | 545 is_rebaseline_step=True) |
| 540 | 546 |
| 541 def CompareRenderedSKPs(self): | 547 def CompareRenderedSKPs(self): |
| 542 """Compare the actual image results of SKP rendering to expectations.""" | 548 """Compare the actual image results of SKP rendering to expectations.""" |
| 543 self.AddSlaveScript(script='compare_rendered_skps.py', | 549 self.AddSlaveScript(script='compare_rendered_skps.py', |
| 544 description='CompareRenderedSKPs', | 550 description='CompareRenderedSKPs', |
| 545 is_rebaseline_step=True) | 551 is_rebaseline_step=True) |
| 546 | 552 |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 812 # Perf-only builder. | 818 # Perf-only builder. |
| 813 if not self._perf_output_basedir: | 819 if not self._perf_output_basedir: |
| 814 raise ValueError( | 820 raise ValueError( |
| 815 'BuildPerfOnly requires perf_output_basedir to be defined.') | 821 'BuildPerfOnly requires perf_output_basedir to be defined.') |
| 816 if self._configuration != CONFIG_RELEASE: | 822 if self._configuration != CONFIG_RELEASE: |
| 817 raise ValueError('BuildPerfOnly should run in %s configuration.' % | 823 raise ValueError('BuildPerfOnly should run in %s configuration.' % |
| 818 CONFIG_RELEASE) | 824 CONFIG_RELEASE) |
| 819 self.PerfSteps() | 825 self.PerfSteps() |
| 820 self.Validate() | 826 self.Validate() |
| 821 return self | 827 return self |
| OLD | NEW |