summaryrefslogtreecommitdiffstats
path: root/dovetail/testcase.py
diff options
context:
space:
mode:
authorGeorg Kunz <georg.kunz@ericsson.com>2018-06-22 09:26:36 +0200
committerGeorg Kunz <georg.kunz@ericsson.com>2018-07-24 16:38:25 +0200
commit947f1bf0147c40971fdae36feecd477ab3caf3b8 (patch)
tree5cad79bea5cb0490df591445c64017c12203ef88 /dovetail/testcase.py
parent69500f77438eb6fccbb37921e612a3179c311313 (diff)
Making the results file a proper json file
The results.json file is currently not a properly formated json file, but contains one json structure per line/testcase. Whit this change, all test results are being collected at runtime and then written to a properly formated json file at the end of a test run. Moreover, this patch introduces 'mandatory' and 'optional' sections to the test suites definition files in order to clearly indicate if a test is part of the corresponding test scope. The web portal needs to be adapted accordingly to be able to read the new results file. JIRA: DOVETAIL-672 Change-Id: Id0706c7e82622fc9c2c2fece26b2d6c07c1580be Signed-off-by: Georg Kunz <georg.kunz@ericsson.com>
Diffstat (limited to 'dovetail/testcase.py')
-rw-r--r--dovetail/testcase.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/dovetail/testcase.py b/dovetail/testcase.py
index ff716292..8eec9388 100644
--- a/dovetail/testcase.py
+++ b/dovetail/testcase.py
@@ -30,6 +30,8 @@ class Testcase(object):
self.cmds = []
self.sub_testcase_status = {}
self.update_validate_testcase(self.validate_testcase())
+ self.is_mandatory = False
+ self.results = None
@classmethod
def create_log(cls):
@@ -101,6 +103,12 @@ class Testcase(object):
self.testcase['passed'] = passed
return self.testcase['passed']
+ def set_results(self, results):
+ self.results = results
+
+ def get_results(self):
+ return self.results
+
def script_result_acquired(self, acquired=None):
return self._result_acquired(self.validate_testcase(), acquired)
@@ -270,7 +278,7 @@ class Testcase(object):
return False
@classmethod
- def get_testcase_list(cls, testsuite, testarea):
+ def get_testcases_for_testsuite(cls, testsuite, testarea):
testcase_list = []
selected_tests = []
testcases = dt_utils.get_value_from_dict('testcases_list', testsuite)
@@ -303,6 +311,10 @@ class Testcase(object):
for area in testarea:
if cls.check_testcase_area(value, area):
testcase_list.append(value)
+ if value in mandatory:
+ Testcase.testcase_list[value].is_mandatory = True
+ else:
+ Testcase.testcase_list[value].is_mandatory = False
break
return testcase_list