[7/27] framework/programs/run: Remove use of TestrunResult

Submitted by Dylan Baker on Oct. 24, 2016, 7:54 p.m.

Details

Message ID 491735bcbbdd21e5a81c7bc68a0de206da4424a5.1477338764.git-series.dylan@pnwbakers.com
State New
Headers show
Series "Various cleanups for profiles" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Dylan Baker Oct. 24, 2016, 7:54 p.m.
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>
---
 framework/programs/run.py | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

Patch hide | download patch | download mbox

diff --git a/framework/programs/run.py b/framework/programs/run.py
index 4c2227f..556878a 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 = time.time()
+
     framework.profile.run(profile, args.log_level, backend, args.concurrent)
 
-    results.time_elapsed.end = time.time()
-    backend.finalize({'time_elapsed': results.time_elapsed})
+    time_elapsed = time.time() - time_elapsed
+    backend.finalize({'time_elapsed': time_elapsed})
 
     print('Thank you for running Piglit!\n'
           'Results have been written to ' + args.results_path)