From 8973fa04ebb66aeb10aa23e4108ce886feae378f Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 5 Sep 2016 12:16:59 -0300 Subject: [PATCH] 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. --- validate/launcher/baseclasses.py | 5 ++++- validate/launcher/main.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/validate/launcher/baseclasses.py b/validate/launcher/baseclasses.py index d81c5756df..5d46c5210b 100644 --- a/validate/launcher/baseclasses.py +++ b/validate/launcher/baseclasses.py @@ -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]: diff --git a/validate/launcher/main.py b/validate/launcher/main.py index 99c1191d74..4204f32430 100644 --- a/validate/launcher/main.py +++ b/validate/launcher/main.py @@ -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)