diff --git a/tester.py b/tester.py index 79bed5ac85c21cd7f725fdb7c6059380f02e3b4a..91efb3ded9bb0f4c42e4e5851de58c9b5d0d7ef6 100755 --- a/tester.py +++ b/tester.py @@ -123,17 +123,22 @@ class Tester(): def discover_tests(self, basic_only=False): ignored_tests = utils.get_conf('TESTER_IGNORED_TESTS', '').split(',') - tests = list() # Get standard tests path = os.path.join(self.root_dir, 'tests') if not os.path.isdir(path): log('The tests dir is missing ("%s").' % path) - return tests + return names = os.listdir(path) names.sort() if not names: log('The tests dir is empty ("%s").' % path) - return tests + return + criticalities_map = { + 'Low': 1, + 'Normal': 2, + 'High': 3, + } + tests = list() for name in names: if name in ignored_tests: continue @@ -142,6 +147,7 @@ class Tester(): criticality, description = self.parse_file_header(test_path) tests.append((name, criticality, description, [test_path])) if basic_only: + tests.sort(key=lambda i: (-criticalities_map.get(i[1], 0), i[0])) return tests # Get MS instances ms_users = list() @@ -199,6 +205,7 @@ class Tester(): test_path = os.path.join(ms_path, name) criticality, description = self.parse_file_header(test_path) tests.append(('%s (%s)' % (name, user), criticality, description, [test_path, user])) + tests.sort(key=lambda i: (-criticalities_map.get(i[1], 0), i[0])) return tests def run_tests(self, tests, email=False, email_if_fail=False):