bugfix for duration missed 85/26185/3
authorMatthewLi <matthew.lijun@huawei.com>
Mon, 19 Dec 2016 01:48:56 +0000 (20:48 -0500)
committerMatthewLi <matthew.lijun@huawei.com>
Tue, 20 Dec 2016 07:34:57 +0000 (02:34 -0500)
JIRA: DOVETAIL-162

Change-Id: Idc78790e49ab3e3552d45b902cfdf8cc37fd2847
Signed-off-by: MatthewLi <matthew.lijun@huawei.com>
dovetail/report.py
dovetail/run.py

index 1f970b2..6e79985 100644 (file)
@@ -98,7 +98,7 @@ class Report:
         report_txt += 'Validation ID: %s\n' % report_data['validation_ID']
         report_txt += 'Upload Date: %s\n' % report_data['upload_date']
         if report_data['duration'] == 0:
-            report_txt += 'Duration: %s\n\n' % 'NA'
+            report_txt += 'Duration: %s\n\n' % 'N/A'
         else:
             report_txt += 'Duration: %.2f s\n\n' % report_data['duration']
 
index c0cc872..75a6fc3 100755 (executable)
@@ -11,6 +11,7 @@
 import click
 import os
 import copy
+import time
 
 import utils.dovetail_logger as dt_logger
 import utils.dovetail_utils as dt_utils
@@ -58,7 +59,10 @@ def run_test(testsuite, testarea, logger):
             run_testcase = False
 
         if run_testcase:
+            start_time = time.time()
             testcase.run()
+            end_time = time.time()
+            duration = end_time - start_time
 
         db_result = Report.get_result(testcase)
         Report.check_result(testcase, db_result)