Chromium Code Reviews| Index: slave/skia_slave_scripts/render_skps.py |
| diff --git a/slave/skia_slave_scripts/render_skps.py b/slave/skia_slave_scripts/render_skps.py |
| index 650c6fccdebb910aeceb1afc2e61cdacdd8ac804..39a1372ab6fe8fe2bb744e45bda022886116507f 100644 |
| --- a/slave/skia_slave_scripts/render_skps.py |
| +++ b/slave/skia_slave_scripts/render_skps.py |
| @@ -5,68 +5,91 @@ |
| """ Run the Skia render_pictures executable. """ |
| -from build_step import BuildStep |
| +from build_step import BuildStep, BuildStepWarning |
| import os |
| import sys |
| DEFAULT_TILE_X = 256 |
| DEFAULT_TILE_Y = 256 |
| -JSON_SUMMARY_BASENAME = 'renderskp-' |
| +JSON_SUMMARY_FILENAME_FORMATTER = 'renderskp-%s.json' |
| class RenderSKPs(BuildStep): |
| + |
| def __init__(self, timeout=9600, no_output_timeout=9600, **kwargs): |
| super(RenderSKPs, self).__init__( |
| timeout=timeout, no_output_timeout=no_output_timeout, **kwargs) |
| - def DoRenderSKPs(self, args, config='8888', write_images=True, |
| - json_summary_filename=None): |
| + |
| + def DoRenderSKPs(self, args, description, config='8888', write_images=True): |
| """Run render_pictures. |
| Args: |
| args: (list of strings) misc args to append to the command line |
| + description: (string) description of this RenderSKPs run; used as part |
| + of the JSON summary filename |
| config: (string) which config to run in |
| write_images: (boolean) whether to save the generated images (IGNORED) |
| - json_summary_filename: (string) name of file to write summary of actually- |
| - generated images into |
| + |
| + Raises: |
| + BuildStepWarning if there was a problem, but the step should keep going. |
| + Something else if there was a major problem and we should give up now. |
| """ |
| # For now, don't run on Android, since it takes too long and we don't use |
| # the results. |
| if 'Android' in self._builder_name: |
| return |
| - cmd = ['-r', self._device_dirs.SKPDir(), '--config', config, |
| - '--mode', 'tile', str(DEFAULT_TILE_X), str(DEFAULT_TILE_Y)] |
| - if json_summary_filename: |
| - cmd.extend(['--writeJsonSummaryPath', os.path.join( |
| - self._device_dirs.SKPOutDir(), json_summary_filename)]) |
| + json_summary_filename = JSON_SUMMARY_FILENAME_FORMATTER % description |
| + json_expectations_devicepath = self._flavor_utils.DevicePathJoin( |
| + self._device_dirs.PlaybackExpectedSummariesDir(), json_summary_filename) |
| + if not self._flavor_utils.DevicePathExists(json_expectations_devicepath): |
| + raise BuildStepWarning('could not find JSON expectations file %s' % |
| + json_expectations_devicepath) |
| + |
| + cmd = [ |
| + '--config', config, |
| + '--mode', 'tile', str(DEFAULT_TILE_X), str(DEFAULT_TILE_Y), |
| + '--readJsonSummaryPath', json_expectations_devicepath, |
| + '--readPath', self._device_dirs.SKPDir(), |
| + '--writeChecksumBasedFilenames', |
| + '--writeJsonSummaryPath', self._flavor_utils.DevicePathJoin( |
| + self._device_dirs.PlaybackActualSummariesDir(), |
| + json_summary_filename), |
| + ] |
| + if write_images: |
| + cmd.extend([ |
| + '--mismatchPath', self._device_dirs.PlaybackActualImagesDir()]) |
| cmd.extend(args) |
| if False: |
| - # For now, skip --validate and writing images on all builders, since they |
| - # take too long and we aren't making use of them. |
| - # Also skip --validate on Windows, where it is currently failing. |
| - if write_images: |
| - cmd.extend(['-w', self._device_dirs.SKPOutDir()]) |
| + # For now, skip --validate on all builders, since it takes more time, |
| + # and at last check failed on Windows. |
| if not os.name == 'nt': |
| cmd.append('--validate') |
| + |
| self._flavor_utils.RunFlavoredCmd('render_pictures', cmd) |
| + |
| def _Run(self): |
| - self.DoRenderSKPs( |
| - args=[], |
| - json_summary_filename=JSON_SUMMARY_BASENAME + 'defaults.json') |
| - self.DoRenderSKPs( |
| - args=['--bbh', 'grid', str(DEFAULT_TILE_X), str(DEFAULT_TILE_X), |
| - '--clone', '1'], |
| - json_summary_filename=JSON_SUMMARY_BASENAME + 'grid.json') |
| - self.DoRenderSKPs( |
| - args=['--bbh', 'rtree', '--clone', '2'], |
| - json_summary_filename=JSON_SUMMARY_BASENAME + 'rtree.json') |
| - self.DoRenderSKPs( |
| - args=['--deferImageDecoding', '--useVolatileCache'], |
| - json_summary_filename=JSON_SUMMARY_BASENAME + 'deferImageDecoding.json') |
| + configs = { |
| + 'defaults': [], |
| + 'deferImageDecoding': ['--deferImageDecoding', '--useVolatileCache'], |
| + 'grid': ['--bbh', 'grid', str(DEFAULT_TILE_X), str(DEFAULT_TILE_X), |
| + '--clone', '1'], |
| + 'rtree': ['--bbh', 'rtree', '--clone', '2'], |
| + } |
|
borenet
2014/05/19 21:04:38
It's possible that these belong in a config file i
epoger
2014/05/19 22:07:24
Yeah, maybe, I'm not sure. And maybe we should ev
|
| + exceptions = [] |
| + for description, args in sorted(configs.iteritems()): |
| + try: |
| + self.DoRenderSKPs(args=args, description=description) |
| + except BuildStepWarning, e: |
| + exceptions.append(e) |
| + print e |
| + if exceptions: |
| + raise BuildStepWarning('\nGot %d exceptions:\n%s' % ( |
| + len(exceptions), '\n'.join([repr(e) for e in exceptions]))) |
| if '__main__' == __name__: |