Chromium Code Reviews| Index: master/skia_master_scripts/skia_build_step.py |
| diff --git a/master/skia_master_scripts/skia_build_step.py b/master/skia_master_scripts/skia_build_step.py |
| index 80c9aaafe59e376033ee7627c3d24a2f54c4b5cb..ebb3772feb4226d81e60ce15b2e3aa4ddf126e6a 100644 |
| --- a/master/skia_master_scripts/skia_build_step.py |
| +++ b/master/skia_master_scripts/skia_build_step.py |
| @@ -16,7 +16,8 @@ class SkiaBuildStep(retcode_command.ReturnCodeCommand): |
| to by BuildStep.getProperty() are scoped for the entire duration of the build. |
| """ |
| def __init__(self, is_upload_step=False, is_rebaseline_step=False, |
| - get_props_from_stdout=None, **kwargs): |
| + get_props_from_stdout=None, exception_on_failure=False, |
| + **kwargs): |
| """ Instantiates a new SkiaBuildStep. |
| is_upload_step: boolean indicating whether this step should be skipped when |
| @@ -26,11 +27,14 @@ class SkiaBuildStep(retcode_command.ReturnCodeCommand): |
| get_props_from_stdout: optional dictionary. Keys are strings indicating |
| build properties to set based on the output of this step. Values are |
| strings containing regular expressions for parsing the property from |
| - the output of the step. |
| + the output of the step. |
| + exception_on_failure: boolean indicating whether to raise an exception if |
| + this step fails. |
|
rmistry
2014/02/24 14:47:54
Can we add here something like:
If there is a fail
borenet
2014/02/24 15:05:46
Done. Note that this does cause the build as a who
|
| """ |
| self._is_upload_step = is_upload_step |
| self._is_rebaseline_step = is_rebaseline_step |
| self._get_props_from_stdout = get_props_from_stdout |
| + self._exception_on_failure = exception_on_failure |
| # self._changed_props will be a dictionary containing the build properties |
| # which were updated by this BuildStep. Those properties will be displayed |
| @@ -49,6 +53,8 @@ class SkiaBuildStep(retcode_command.ReturnCodeCommand): |
| def commandComplete(self, cmd): |
| """ Override of BuildStep's commandComplete method which allows us to parse |
| build properties from the output of this step. """ |
| + if cmd.rc and self._exception_on_failure: |
| + raise Exception('Command marked exception_on_failure failed.') |
| if self._get_props_from_stdout and cmd.rc == 0: |
| log = cmd.logs['stdio'] |
| stdout = ''.join(log.getChunks([STDOUT], onlyText=True)) |