summaryrefslogtreecommitdiffstats
path: root/dovetail/report.py
diff options
context:
space:
mode:
authorhongbo tian <hongbo.tianhongbo@huawei.com>2016-11-29 01:31:04 +0000
committerGerrit Code Review <gerrit@opnfv.org>2016-11-29 01:31:04 +0000
commitcd94a6e124ae98f85bc2f7c3c26e052bb3f5e549 (patch)
tree6da81dc5e6badbafacfbc2e226260df2fb4f838a /dovetail/report.py
parent57e5b616ddbb32f87c660269642b8da86b30b3c1 (diff)
parent3bf95fd09e2128f1cd762905c5d69cf66b56fd75 (diff)
Merge "dovetail tool: testarea argument added"
Diffstat (limited to 'dovetail/report.py')
-rw-r--r--dovetail/report.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/dovetail/report.py b/dovetail/report.py
index 7dd8ba2d..2e544ad3 100644
--- a/dovetail/report.py
+++ b/dovetail/report.py
@@ -36,11 +36,15 @@ class Report:
checker.check(testcase, db_result)
@classmethod
- def generate_json(cls, scenario_yaml):
+ def generate_json(cls, testsuite_yaml, testarea):
report_obj = {}
- report_obj['scenario'] = scenario_yaml['name']
+ report_obj['testsuite'] = testsuite_yaml['name']
report_obj['testcases_list'] = []
- for testcase_name in scenario_yaml['testcases_list']:
+ testarea_list = []
+ for value in testsuite_yaml['testcases_list']:
+ if value is not None and (testarea == 'full' or testarea in value):
+ testarea_list.append(value)
+ for testcase_name in testarea_list:
testcase = Testcase.get(testcase_name)
testcase_in_rpt = {}
testcase_in_rpt['name'] = testcase_name
@@ -66,8 +70,8 @@ class Report:
return report_obj
@classmethod
- def generate(cls, scenario_yaml):
- rpt_data = cls.generate_json(scenario_yaml)
+ def generate(cls, testsuite_yaml, testarea):
+ rpt_data = cls.generate_json(testsuite_yaml, testarea)
rpt_text = ''
split_line = '+-----------------------------------------------------'
split_line += '---------------------+\n'
@@ -76,7 +80,7 @@ class Report:
+==========================================================================+\n\
| report |\n'
rpt_text += split_line
- rpt_text += '|scenario: %s\n' % rpt_data['scenario']
+ rpt_text += '|testsuite: %s\n' % rpt_data['testsuite']
for testcase in rpt_data['testcases_list']:
rpt_text += '| [testcase]: %s\t\t\t\t[%s]\n' % \
(testcase['name'], testcase['result'])