summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2016-10-05 17:30:16 -0700
committerDylan Baker <dylan@pnwbakers.com>2016-11-10 10:49:09 -0800
commit2385a07cf4e0de347bb7dacb8749aea7023387e8 (patch)
tree5d7217d85de8bc97a64b361a2ec3e891131b256c /framework
parent22eaa0fa486407ea99a25bda6c3f6cd49182d131 (diff)
framework/programs/run: Remove use of TestrunResult
We basically only used it to set the name and the time elapsed. That's silly, just do those things directly. It needs less code and doesn't require creating a big object. This is leftover from the days before atomic writes, when results were all stored in memory until the end of the run. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/programs/run.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/framework/programs/run.py b/framework/programs/run.py
index 880d74848..b92de9935 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -305,20 +305,12 @@ def run(input_):
'Cannot overwrite existing folder without the -o/--overwrite '
'option being set.')
- results = framework.results.TestrunResult()
- backends.set_meta(args.backend, results)
-
- # Set results.name
- if args.name is not None:
- results.name = args.name
- else:
- results.name = path.basename(args.results_path)
-
backend = backends.get_backend(args.backend)(
args.results_path,
junit_suffix=args.junit_suffix,
junit_subtests=args.junit_subtests)
- backend.initialize(_create_metadata(args, results.name))
+ backend.initialize(_create_metadata(
+ args, args.name or path.basename(args.results_path)))
profile = framework.profile.merge_test_profiles(args.test_profile)
profile.results_dir = args.results_path
@@ -328,7 +320,6 @@ def run(input_):
# Strip newlines
profile.forced_test_list = list([t.strip() for t in test_list])
- results.time_elapsed.start = time.time()
# Set the dmesg type
if args.dmesg:
profile.dmesg = args.dmesg
@@ -336,10 +327,12 @@ def run(input_):
if args.monitored:
profile.monitoring = args.monitored
+ time_elapsed = framework.results.TimeAttribute(start=time.time())
+
framework.profile.run(profile, args.log_level, backend, args.concurrency)
- results.time_elapsed.end = time.time()
- backend.finalize({'time_elapsed': results.time_elapsed.to_json()})
+ time_elapsed.end = time.time()
+ backend.finalize({'time_elapsed': time_elapsed.to_json()})
print('Thank you for running Piglit!\n'
'Results have been written to ' + args.results_path)