Initial implementation of results parser
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import datetime
|
||||
import foundation
|
||||
from foundation import (benchrunner,
|
||||
buildbot,
|
||||
@@ -240,7 +241,7 @@ def latestDirGet(path):
|
||||
def ensureOutputDir(config):
|
||||
output_dir = config['farm']['output_dir']
|
||||
if not os.path.exists(output_dir):
|
||||
os.mkdir(output_dir)
|
||||
os.makedirs(output_dir)
|
||||
max_dir = latestDirGet(output_dir)
|
||||
if not max_dir:
|
||||
max_dir = 0
|
||||
@@ -268,7 +269,7 @@ def getResultJSONString(ctx, results):
|
||||
stats[scene]['result'] = 'OK'
|
||||
else:
|
||||
stats[scene] = {'result': 'CRASH'}
|
||||
return json.dumps(json_results, sort_keys=True, indent=4)
|
||||
return json.dumps(json_results, sort_keys=True, indent=2)
|
||||
|
||||
|
||||
def saveResults(ctx, results, output_dir):
|
||||
@@ -281,6 +282,7 @@ def saveResults(ctx, results, output_dir):
|
||||
# Main logic.
|
||||
########################################
|
||||
|
||||
|
||||
def main():
|
||||
parser = configureArgumentParser()
|
||||
args = parser.parse_args()
|
||||
@@ -333,7 +335,9 @@ def main():
|
||||
# Run benchmark.
|
||||
all_stats = benchrunner.benchmarkAll(ctx)
|
||||
# Gather all information together.
|
||||
timestamp = datetime.datetime.now(datetime.timezone.utc).isoformat()
|
||||
results = {
|
||||
"timestamp": timestamp,
|
||||
"blender_version": system_info.getBlenderVersion(ctx),
|
||||
"system_info": system_info.gatherSystemInfo(ctx),
|
||||
"device_info": blender_dvice_info,
|
||||
|
Reference in New Issue
Block a user