Skip to content
Snippets Groups Projects
Commit 3a88a055 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Order tests results by criticality (refs #20690).

parent 6c2ac7bc
No related branches found
No related tags found
No related merge requests found
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment