From b9034fde76d6df073043bc8ef6b011c3a0dd5a37 Mon Sep 17 00:00:00 2001 From: xudan Date: Thu, 12 Jul 2018 07:00:52 -0400 Subject: Update test suite ovp.next Update test suite ovp.next according to the latest OVP scope. Modify Dovetail daily jobs to run all the scope. There should be 2 jobs. One for all mandatory test cases and the other for all optional ones. That's mainly because of that the total executed time will be too large (more than 300 minutes). Then the job will always failed because of time out. It's hard to enlarge the time because it's already larger than common 3 hours. Split it into 2 jobs can avoid the time out issue and make the results clearer for reviewing. JIRA: DOVETAIL-694 Change-Id: Ie0ea6221868941781af1477f7c7719f7cb4351a4 Signed-off-by: xudan --- dovetail/testcase.py | 47 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 12 deletions(-) (limited to 'dovetail/testcase.py') diff --git a/dovetail/testcase.py b/dovetail/testcase.py index 23220aeb..69b8ee4c 100644 --- a/dovetail/testcase.py +++ b/dovetail/testcase.py @@ -253,34 +253,57 @@ class Testcase(object): if not testarea: return True, area_full - mandatory_list = dt_cfg.dovetail_config['mandatory'] - optional_list = dt_cfg.dovetail_config['optional'] for area in testarea: if area not in dt_cfg.dovetail_config['testarea_supported']: return False, None if area == 'full': return True, area_full - if area == 'mandatory': - for mandatory_area in mandatory_list: - area_no_duplicate.append(mandatory_area) - continue - if area == 'optional': - for optional_area in optional_list: - area_no_duplicate.append(optional_area) - continue area_no_duplicate.append(area) area_no_duplicate = list(set(area_no_duplicate)) return True, area_no_duplicate + @staticmethod + def check_testcase_area(testcase, testarea): + if not testcase: + return False + if testarea == 'full' or testarea in testcase: + return True + else: + return False + @classmethod def get_testcase_list(cls, testsuite, testarea): testcase_list = [] + selected_tests = [] testcases = dt_utils.get_value_from_dict('testcases_list', testsuite) + mandatory = dt_utils.get_value_from_dict('mandatory', testcases) + optional = dt_utils.get_value_from_dict('optional', testcases) if not testcases: return testcase_list - for value in testcases: + if dt_cfg.dovetail_config['mandatory']: + if not mandatory: + cls.logger.error("There is no mandatory test case in " + "test suite {}".format(testsuite['name'])) + else: + selected_tests += mandatory + if dt_cfg.dovetail_config['optional']: + if not optional: + cls.logger.error("There is no optional test case in " + "test suite {}".format(testsuite['name'])) + else: + selected_tests += optional + if (not dt_cfg.dovetail_config['mandatory'] and + not dt_cfg.dovetail_config['optional']): + if mandatory: + selected_tests += mandatory + if optional: + selected_tests += optional + + if not selected_tests: + return None + for value in selected_tests: for area in testarea: - if value is not None and (area == 'full' or area in value): + if cls.check_testcase_area(value, area): testcase_list.append(value) break return testcase_list -- cgit 1.2.3-korg