| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 import re | 5 import re |
| 6 | 6 |
| 7 # Note: this module is tested by a unit test config_validation_test.py, | 7 # Note: this module is tested by a unit test config_validation_test.py, |
| 8 # rather than recipe simulation tests. | 8 # rather than recipe simulation tests. |
| 9 | 9 |
| 10 _BISECT_CONFIG_SCHEMA = { | 10 _BISECT_CONFIG_SCHEMA = { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 except ValueError: | 99 except ValueError: |
| 100 return # The revisions could be sha1 hashes. | 100 return # The revisions could be sha1 hashes. |
| 101 if earlier >= later: | 101 if earlier >= later: |
| 102 raise ValidationFail('Order of good_revision (%d) and bad_revision(%d) ' | 102 raise ValidationFail('Order of good_revision (%d) and bad_revision(%d) ' |
| 103 'is reversed.' % (earlier, later)) | 103 'is reversed.' % (earlier, later)) |
| 104 | 104 |
| 105 | 105 |
| 106 def _validate_metric(bisect_mode, metric): # pragma: no cover | 106 def _validate_metric(bisect_mode, metric): # pragma: no cover |
| 107 if bisect_mode not in ('mean', 'std_dev'): | 107 if bisect_mode not in ('mean', 'std_dev'): |
| 108 return | 108 return |
| 109 if not (isinstance(metric, basestring) and metric.count('/') == 1): | 109 if not (isinstance(metric, basestring) and ((metric.count('/') == 1) or |
| 110 (metric.count('/') == 2))): |
| 110 raise ValidationFail('Invalid value for "metric": %s' % metric) | 111 raise ValidationFail('Invalid value for "metric": %s' % metric) |
| OLD | NEW |