reframe icon indicating copy to clipboard operation
reframe copied to clipboard

Extend the framework to be able to give warnings for tests

Open ekouts opened this issue 3 years ago • 0 comments

Sometime we may want a test to pass but give a warning. I am thinking that it would be nice to add a workaround warning for tests with a “temporary” fix. This is one option currently:

from reframe.core.logging import getlogger

...
  @run_before('run')
  def workaround(self):
    ..
    getlogger().warning('Temporary fix in test foo')

By @vkarak :

I think that’s the only way for the moment. We could potentially wrap the logger through a user-friendly API, such that the users could write self.warning(…) or even better, make it a builtin to avoid using the self . And then we could even have user errors with something like error() .

If we have a builtin maybe we could also accumulate the warnings and add them in an (optional) summary in the end?

ekouts avatar Oct 18 '22 13:10 ekouts