summaryrefslogtreecommitdiffstats
path: root/dovetail/report.py
diff options
context:
space:
mode:
authorMatthewLi <matthew.lijun@huawei.com>2016-11-24 01:56:41 -0500
committerMatthewLi <matthew.lijun@huawei.com>2016-11-26 03:27:08 -0500
commit3bf95fd09e2128f1cd762905c5d69cf66b56fd75 (patch)
tree308c93574110bab93fcd36b85bbfaf95d0075aea /dovetail/report.py
parent042dcda01c51493eda99b7a835cdbd59c1ae12b0 (diff)
dovetail tool: testarea argument added
JIRA: DOVETAIL-71 1) argument testarea is added 2) terminology "scenario" change to "testsuite" 3) related documents amended 4) all word "certification" changed to "compliance" Change-Id: I038a9e04bf83cfdac20f0c59adb1841bf5470584 Signed-off-by: MatthewLi <matthew.lijun@huawei.com>
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'])