avocado: Remove configurable behavior of uncaught exceptions

In order to keep things simple and clear, enforce the
following test results rules:

 * `PASS`: the test passed, which means all conditions
   being tested have passed.
 * `FAIL`: the test failed, which means at least one
   condition being tested has failed. Ideally, it should
   mean a problem in the software being tested has been found.
 * `ERROR`: an error happened during the test execution.
   This can happen, for example, if there's a bug in the test
   runner, in its libraries or if a resource breaks unexpectedly.
   Uncaught exceptions in the test code will also result in this
   status.
 * `SKIP`: the test runner decided a requested test should not
   be executed. This can happen, for example, due to missing
   requirements in the test environment or when there's a job
   timeout.

In order to do that, let's not make the behavior on exceptions
other than TestFail to be configurable. Therefore, the config
value uncaught_exception_result must be removed and the status
of the test always be 'ERROR'.
Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 b5748f03
......@@ -35,8 +35,6 @@ from . import data_dir
from . import sysinfo
from . import exceptions
from . import multiplexer
from . import status
from .settings import settings
from .version import VERSION
from ..utils import genio
from ..utils import path as utils_path
......@@ -451,16 +449,7 @@ class Test(unittest.TestCase):
self.fail_reason = detail
self.traceback = stacktrace.prepare_exc_info(sys.exc_info())
except Exception, detail:
stat = settings.get_value("runner.behavior",
"uncaught_exception_result",
default="ERROR")
if stat not in status.mapping:
stacktrace.log_message("Incorrect runner.behavior.generic_"
"exception_result value '%s', using "
"'ERROR' instead." % stat,
"avocado.test")
stat = "ERROR"
self.status = stat
self.status = 'ERROR'
tb_info = stacktrace.tb_info(sys.exc_info())
self.traceback = stacktrace.prepare_exc_info(sys.exc_info())
try:
......
......@@ -33,8 +33,6 @@ utf8 =
[runner.behavior]
# Keep job temporary files after jobs (useful for avocado debugging)
keep_tmp_files = False
# Overrides the test result in case of uncaught exception (FAIL, ERROR, ...)
uncaught_exception_result = ERROR
[job.output]
# Base log level for --show-job-log.
......
......@@ -12,7 +12,7 @@ class ErrorTest(Test):
def test(self):
"""
This should end with ERROR (on default config)
This should end with ERROR.
"""
raise Exception("This is a generic exception")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册