Commit 6e816849 authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis Committed by Giorgos Korfiatis

burnin: Skip whole testsuite

Add functionality to allow burnin to skip a testsuite after
it has been started.
parent 46fa9093
...@@ -105,6 +105,20 @@ class BurninTestResult(unittest.TestResult): ...@@ -105,6 +105,20 @@ class BurninTestResult(unittest.TestResult):
super(BurninTestResult, self).addFailure(test, err) super(BurninTestResult, self).addFailure(test, err)
self._test_failed(test, err) self._test_failed(test, err)
# pylint: disable=fixme
def addSkip(self, test, reason): # noqa
"""Called when the test case test is skipped
If reason starts with "__SkipClass__: " then
we should stop the execution of all the TestSuite.
TODO: There should be a better way to do this
"""
super(BurninTestResult, self).addSkip(test, reason)
if reason.startswith("__SkipClass__: "):
self.stop()
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# Helper Classes # Helper Classes
...@@ -347,6 +361,12 @@ class BurninTests(unittest.TestCase): ...@@ -347,6 +361,12 @@ class BurninTests(unittest.TestCase):
self.info("Test skipped: %s" % msg) self.info("Test skipped: %s" % msg)
self.skipTest(msg) self.skipTest(msg)
def _skip_suite_if(self, condition, msg):
"""Skip the whole testsuite"""
if condition:
self.info("TestSuite skipped: %s" % msg)
self.skipTest("__SkipClass__: %s" % msg)
# ---------------------------------- # ----------------------------------
# Flavors # Flavors
def _get_list_of_flavors(self, detail=False): def _get_list_of_flavors(self, detail=False):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment