diff --git a/easybuild/tools/build_log.py b/easybuild/tools/build_log.py index b64b5f648e..b663dbe30e 100644 --- a/easybuild/tools/build_log.py +++ b/easybuild/tools/build_log.py @@ -57,13 +57,17 @@ class EasyBuildError(LoggedException): """ EasyBuildError is thrown when EasyBuild runs into something horribly wrong. """ + LOC_INFO_TOP_PKG_NAMES = ['easybuild', 'vsc'] + LOC_INFO_LEVEL = 1 + # use custom error logging method, to make sure EasyBuildError isn't being raised again to avoid infinite recursion # only required because 'error' log method raises (should no longer be needed in EB v3.x) LOGGING_METHOD_NAME = '_error_no_raise' def __init__(self, msg, *args): """Constructor: initialise EasyBuildError instance.""" - msg = msg % args + if args: + msg = msg % args LoggedException.__init__(self, msg) self.msg = msg @@ -133,7 +137,7 @@ def _error_no_raise(self, msg): orig_raise_error = self.raiseError self.raiseError = False - self.error(msg) + fancylogger.FancyLogger.error(self, msg) # reinstate previous raiseError setting self.raiseError = orig_raise_error diff --git a/setup.py b/setup.py index 4fecf38036..6335ba4f77 100644 --- a/setup.py +++ b/setup.py @@ -106,5 +106,5 @@ def find_rel_test(): provides=["eb"] + easybuild_packages, test_suite="test.framework.suite", zip_safe=False, - install_requires=["vsc-base >= 2.1.1"], + install_requires=["vsc-base >= 2.2.0"], ) diff --git a/test/framework/build_log.py b/test/framework/build_log.py index cd97e53b32..e4773e83e6 100644 --- a/test/framework/build_log.py +++ b/test/framework/build_log.py @@ -65,7 +65,7 @@ def test_easybuilderror(self): self.assertErrorRegex(EasyBuildError, 'BOOM', raise_easybuilderror, 'BOOM') logToFile(tmplog, enable=False) - log_re = re.compile("^%s :: EasyBuild crashed .*: BOOM$" % getRootLoggerName(), re.M) + log_re = re.compile("^%s :: BOOM \(at %s:[0-9]+ in [a-z_]+\)$" % (getRootLoggerName(), __file__), re.M) logtxt = open(tmplog, 'r').read() self.assertTrue(log_re.match(logtxt), "%s matches %s" % (log_re.pattern, logtxt)) diff --git a/test/framework/options.py b/test/framework/options.py index 0f381055a0..038844dac1 100644 --- a/test/framework/options.py +++ b/test/framework/options.py @@ -109,7 +109,7 @@ def test_no_args(self): outtxt = self.eb_main([]) - error_msg = "ERROR .* Please provide one or multiple easyconfig files," + error_msg = "ERROR Please provide one or multiple easyconfig files," error_msg += " or use software build options to make EasyBuild search for easyconfigs" self.assertTrue(re.search(error_msg, outtxt), "Error message when eb is run without arguments") @@ -922,9 +922,10 @@ def test_no_such_software(self): outtxt = self.eb_main(args) # error message when template is not found - error_msg1 = "ERROR .* No easyconfig files found for software nosuchsoftware, and no templates available. I'm all out of ideas." + error_msg1 = "ERROR No easyconfig files found for software nosuchsoftware, and no templates available. " + error_msg1 += "I'm all out of ideas." # error message when template is found - error_msg2 = "ERROR .* Unable to find an easyconfig for the given specifications" + error_msg2 = "ERROR Unable to find an easyconfig for the given specifications" msg = "Error message when eb can't find software with specified name (outtxt: %s)" % outtxt self.assertTrue(re.search(error_msg1, outtxt) or re.search(error_msg2, outtxt), msg)