Fix handling of array of information
With a benchmark info we only ever want test one, so pass only that to the formatter. Simplifies the format function.
This commit is contained in:
parent
056cf3740d
commit
0058f19d88
|
@ -1601,21 +1601,21 @@ def format_info_benchmark(config, oformat, benchmark_information):
|
||||||
0: format_info_benchmark_legacy,
|
0: format_info_benchmark_legacy,
|
||||||
}
|
}
|
||||||
|
|
||||||
benchmark_version = benchmark_information['test_format']
|
benchmark_version = benchmark_information[0]['test_format']
|
||||||
|
|
||||||
if oformat == 'json-pretty':
|
if oformat == 'json-pretty':
|
||||||
return dumps(benchmark_information, indent=4)
|
return dumps(benchmark_information, indent=4)
|
||||||
elif oformat == 'json':
|
elif oformat == 'json':
|
||||||
return dumps(benchmark_information)
|
return dumps(benchmark_information)
|
||||||
else:
|
else:
|
||||||
return benchmark_matrix.get(benchmark_version, lambda: 'Invalid format function')(config, benchmark_information)
|
return benchmark_matrix.get(benchmark_version, lambda: 'Invalid format function')(config, benchmark_information[0])
|
||||||
|
|
||||||
|
|
||||||
def format_info_benchmark_legacy(config, benchmark_information):
|
def format_info_benchmark_legacy(config, benchmark_information):
|
||||||
if benchmark_information[0]['benchmark_result'] == "Running":
|
if benchmark_information['benchmark_result'] == "Running":
|
||||||
return "Benchmark test is still running."
|
return "Benchmark test is still running."
|
||||||
|
|
||||||
benchmark_details = benchmark_information[0]['benchmark_result']
|
benchmark_details = benchmark_information['benchmark_result']
|
||||||
|
|
||||||
# Format a nice output; do this line-by-line then concat the elements at the end
|
# Format a nice output; do this line-by-line then concat the elements at the end
|
||||||
ainformation = []
|
ainformation = []
|
||||||
|
|
Loading…
Reference in New Issue