validate:launcher: Report error and exit when a testsuite could not load

Otherwise the user might end up seeing a lot of meaningless logs about
'removed' tests.
This commit is contained in:
Thibault Saunier 2016-09-05 12:16:59 -03:00
parent f7f600e730
commit 8973fa04eb
2 changed files with 6 additions and 2 deletions

View file

@ -1210,6 +1210,7 @@ class _TestsLauncher(Loggable):
printc("Could not load testsuite: %s"
" maybe because of missing TestManager"
% (testsuite), Colors.FAIL)
return False
def _load_config(self, options):
printc("Loading config files is DEPRECATED"
@ -1250,7 +1251,9 @@ class _TestsLauncher(Loggable):
tester.set_settings(options, args, self.reporter)
if not options.config and options.testsuites:
self._setup_testsuites()
if self._setup_testsuites() is False:
return False
return True
def _check_tester_has_other_testsuite(self, testsuite, tester):
if tester.name != testsuite.TEST_MANAGER[0]:

View file

@ -525,7 +525,8 @@ Note that all testsuite should be inside python modules, so the directory should
# Ensure that the scenario manager singleton is ready to be used
ScenarioManager().config = options
tests_launcher.set_settings(options, [])
if not tests_launcher.set_settings(options, []):
exit(1)
if tests_launcher.list_tests() == -1:
printc("\nFailling as tests have been removed/added "
" (--fail-on-testlist-change)", Colors.FAIL)