...
 
Commits (4)
......@@ -32,6 +32,7 @@ import datetime
import shutil
import git
import os
import operator
# This command line executable acts as the central method for configuring
# the benchmark CI run. A number of elements are passed in to check that
......@@ -184,8 +185,11 @@ def generate_buildstream_config(output_file, results_path, run_token_path, url_p
for dirpath, dirnames, files in os.walk(results_path):
if files:
list_of_files = glob.glob(results_path + '*.json')
if list_of_files:
latest_file = max(list_of_files, key=os.path.getmtime)
file_times = {}
for file in list_of_files:
file_times[file] = datetime.datetime.strptime(os.path.basename(file), 'results-%Y-%m-%d-%H:%M:%S.json')
if file_times:
latest_file = max(file_times.items(), key=operator.itemgetter(1))[0]
archive_result = ntpath.basename(latest_file)
else:
logging.info('No results files found from: ', results_path)
......