Skip to content

Commit a87fac5

Browse files
committed
Warn if frameworks exceed the maximum number of test mutations
> The number of test mutations will be limited to 10. #8420 This change shows a warning message for frameworks if the maximum is reached.
1 parent 46de0d4 commit a87fac5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

toolset/utils/metadata.py

+12
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,18 @@ def parse_config(self, config, directory):
191191
% config['framework'],
192192
color=Fore.YELLOW)
193193

194+
# Check that each framework does not have more than the maximum number of tests
195+
maximum_tests = 10
196+
non_broken_tests_filter = lambda test: (not hasattr(test, "tags")) or ("broken" not in test.tags)
197+
non_broken_tests_to_run = list(filter(non_broken_tests_filter, tests_to_run))
198+
if len(non_broken_tests_to_run) > maximum_tests:
199+
message = [
200+
"Framework %s defines %s tests in benchmark_config.json (max is %s)."
201+
% (config['framework'], len(non_broken_tests_to_run), maximum_tests),
202+
"Contact maintainers and remove deprecated or discarded ones to make room."
203+
]
204+
log("\n".join(message), color=Fore.YELLOW)
205+
194206
# Check that each test configuration is acceptable
195207
# Throw exceptions if a field is missing, or how to improve the field
196208
for test_name, test_keys in test.items():

0 commit comments

Comments
 (0)