summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhongbo tian <hongbo.tianhongbo@huawei.com>2016-12-20 11:27:28 +0000
committerGerrit Code Review <gerrit@opnfv.org>2016-12-20 11:27:28 +0000
commit5230decde18c9640a60118e091840fd1eedd5d3d (patch)
tree51f3f515d8f26f4c34c3c726a7be2313cc13567a
parent5f53e6ec38e4f0d1e200249954f655abba8bcc18 (diff)
parent06bc12f0b6212ee5e9a29468da327d52ad057fac (diff)
Merge "bugfix for duration missed"
-rw-r--r--dovetail/report.py2
-rwxr-xr-xdovetail/run.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/dovetail/report.py b/dovetail/report.py
index bee84041..654e6bf8 100644
--- a/dovetail/report.py
+++ b/dovetail/report.py
@@ -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']
diff --git a/dovetail/run.py b/dovetail/run.py
index 368ea675..8a91e4b3 100755
--- a/dovetail/run.py
+++ b/dovetail/run.py
@@ -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)