From 947f1bf0147c40971fdae36feecd477ab3caf3b8 Mon Sep 17 00:00:00 2001 From: Georg Kunz Date: Fri, 22 Jun 2018 09:26:36 +0200 Subject: 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 --- dovetail/testcase.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'dovetail/testcase.py') 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 -- cgit 1.2.3-korg