Commit d4439824 by Jamie Madill Committed by Commit Bot

Gold Trace Tests: Fix JSON output with empty test set.

Previously we would leave an empty test suite name with no tests run. According to the JSON test results spec this is likely a malformed output and we should instead include just an empty "tests" key. Bad: "tests": { "angle_restricted_trace_gold_tests": {} } Good: "tests": {} Bug: angleproject:5299 Change-Id: I459da593df150d804130f9c63e05d031e77a16a3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2525147Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent aca3d408
......@@ -341,9 +341,7 @@ def main():
sys.exit(1)
results = {
'tests': {
'angle_restricted_trace_gold_tests': {}
},
'tests': {},
'interrupted': False,
'seconds_since_epoch': time.time(),
'path_delimiter': '.',
......@@ -355,7 +353,7 @@ def main():
},
}
result_tests = results['tests']['angle_restricted_trace_gold_tests']
result_tests = {}
def run_tests(args, tests, extra_flags, env, screenshot_dir):
keys = get_skia_gold_keys(args)
......@@ -372,8 +370,8 @@ def main():
if args.isolated_script_test_filter:
full_name = 'angle_restricted_trace_gold_tests.%s' % test
if not fnmatch.fnmatch(full_name, args.isolated_script_test_filter):
print('Skipping test %s because it does not match filter %s' %
(full_name, args.isolated_script_test_filter))
logging.info('Skipping test %s because it does not match filter %s' %
(full_name, args.isolated_script_test_filter))
continue
with common.temporary_file() as tempfile_path:
......@@ -433,6 +431,9 @@ def main():
traceback.print_exc()
rc = 1
if result_tests:
results['tests']['angle_restricted_trace_gold_tests'] = result_tests
if args.isolated_script_test_output:
with open(args.isolated_script_test_output, 'w') as out_file:
out_file.write(json.dumps(results, indent=2))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment