Lines Matching defs:error_msg

56 def check_keys(error_msg, src_dict, supported_keys):
60 errors += error_msg(f'Key "{key}" must be one of {supported_keys}')
64 def _check_properties(error_msg, src_dict, prop_name, supported_keys):
67 return error_msg(f'Value for {prop_name} must be a dict')
68 return check_keys(error_msg, properties, supported_keys)
71 def _check_int_range(error_msg, src_dict, prop_name, lower_bound=None,
79 return error_msg(f'If specified, {prop_name} must be an int')
81 return error_msg(f'If specified, {prop_name} must be >={lower_bound}')
83 return error_msg(f'If specified, {prop_name} must be <={upper_bound}')
87 def _check_swarming_task_attrs(error_msg, src_dict):
91 error_msg, task_attrs, 'priority', lower_bound=25, upper_bound=100)
93 error_msg, task_attrs, 'expiration', lower_bound=1)
95 error_msg, task_attrs, 'hard_timeout', lower_bound=1)
99 def _check_swarming_config(error_msg, src_dict):
102 error_msg, src_dict, 'swarming_dimensions',
105 error_msg, src_dict, 'swarming_task_attrs',
107 errors += _check_swarming_task_attrs(error_msg, src_dict)
111 def _check_test(error_msg, test):
113 return error_msg('Each test must be specified with a dict')
114 errors = check_keys(error_msg, test, SUPPORTED_TEST_KEYS)
116 errors += error_msg('A test requires a name')
117 errors += _check_swarming_config(error_msg, test)
121 errors += error_msg('If specified, test_args must be a list of arguments')
123 errors += error_msg('If specified, all test_args must be strings')
127 error_msg, test, 'shards', lower_bound=1, upper_bound=14)
131 errors += error_msg('If specified, variant must be a non-empty string')
137 def error_msg(msg):
144 return error_msg(f'Pyl parsing failed with:\n{e}')
147 return error_msg('Test spec must be a dict')
151 def error_msg(msg):
155 errors += error_msg('Buildername must be a non-empty string')
158 errors += error_msg('Value must be a non-empty dict')
161 errors += check_keys(error_msg, builder_spec, SUPPORTED_BUILDER_SPEC_KEYS)
162 errors += _check_swarming_config(error_msg, builder_spec)
165 errors += _check_test(error_msg, test)