add EESSIError exception to avoid printing traceback#319
add EESSIError exception to avoid printing traceback#319casparvl merged 6 commits intoEESSI:mainfrom
Conversation
|
Is it really preferable to hide the traceback? I mean, in most cases you just need to respect the suggestion and change it to a valid value. But in some cases, you might want to add support for a new value - and this will essentially provide you a starting point for that. |
|
do you have an example in mind? my idea was that, since the test suite is emitting the error and not ReFrame, the user should not have to see the ugly ReFrame traceback, but we can make exceptions of course. or we could add an option to increase the traceback limit? |
| @@ -1,5 +1,5 @@ | |||
| [build-system] | |||
| requires = ["setuptools>=42", "wheel"] | |||
| requires = ["setuptools>=42,<=81.0.0", "wheel"] | |||
There was a problem hiding this comment.
please open an issue on this, mention why you had to start doing this (which errors, etc.)
this should be a temporary measure...
There was a problem hiding this comment.
yes, it's the same issue as easybuild: pkg_resources should be replaced
There was a problem hiding this comment.
Ah, we're actually using it ourselves in here... https://github.com/search?q=repo%3AEESSI%2Ftest-suite%20pkg_resources&type=code
It's been deprecated since setuptools 67.5.0 (March 2023), see also pypa/setuptools#3085
There was a problem hiding this comment.
|
Discussed in the test meeting: we could make this optional, based on a parameter set on the command line (-S something). It would be really nice if the message that is printed then provides this suggestion ("to see the full traceback, rerun with -S ") |
|
using a ReFrame |
casparvl
left a comment
There was a problem hiding this comment.
Works like a charm. I inserted some test class that didn't properly define the module_name in time and got:
$ reframe -c test-suite/eessi/testsuite/tests/ -t CI -t 1_8_node --system snellius:rome --list
...
ERROR: run session stopped: eessierror: The variable 'module_name' should be defined in any test class that inherits from EESSI_Mixin before (or in) the init phase, but it wasn't
Rerun with `TRACEBACK=1 reframe ...` to show the full traceback.
ERROR: eessi.testsuite.utils.EESSIError: The variable 'module_name' should be defined in any test class that inherits from EESSI_Mixin before (or in) the init phase, but it wasn't
Rerun with `TRACEBACK=1 reframe ...` to show the full traceback.
Then, with TRACEBACK=1:
$ TRACEBACK=1 reframe -c test-suite/eessi/testsuite/tests/ -t CI -t 1_8_node --system snellius:rome --list
...
ERROR: run session stopped: eessierror: The variable 'module_name' should be defined in any test class that inherits from EESSI_Mixin before (or in) the init phase, but it wasn't
ERROR: Traceback (most recent call last):
File "/gpfs/home4/casparl/EESSI/reframe/reframe/frontend/cli.py", line 1354, in main
checks_found = loader.load_all(force=True)
File "/gpfs/home4/casparl/EESSI/reframe/reframe/core/logging.py", line 1116, in _fn
return fn(*args, **kwargs)
File "/gpfs/home4/casparl/EESSI/reframe/reframe/frontend/loader.py", line 244, in load_all
checks += self.load_from_dir(d, self._recurse, force)
File "/gpfs/home4/casparl/EESSI/reframe/reframe/frontend/loader.py", line 216, in load_from_dir
checks += self.load_from_dir(entry.path, recurse, force)
File "/gpfs/home4/casparl/EESSI/reframe/reframe/frontend/loader.py", line 216, in load_from_dir
checks += self.load_from_dir(entry.path, recurse, force)
File "/gpfs/home4/casparl/EESSI/reframe/reframe/frontend/loader.py", line 223, in load_from_dir
checks += self.load_from_file(entry.path, force)
File "/gpfs/home4/casparl/EESSI/reframe/reframe/frontend/loader.py", line 195, in load_from_file
return self.load_from_module(util.import_module_from_file(
File "/gpfs/home4/casparl/EESSI/reframe/reframe/frontend/loader.py", line 156, in load_from_module
candidate_tests = registry.instantiate_all(reset_sysenv,
File "/gpfs/home4/casparl/EESSI/reframe/reframe/core/logging.py", line 1116, in _fn
return fn(*args, **kwargs)
File "/gpfs/home4/casparl/EESSI/reframe/reframe/core/decorators.py", line 105, in instantiate_all
leaf_tests.append(test(*args, **kwargs))
File "/gpfs/home4/casparl/EESSI/reframe/reframe/core/meta.py", line 497, in __call__
obj.__init__(*args, **kwargs)
File "/gpfs/home4/casparl/EESSI/reframe/reframe/core/hooks.py", line 111, in _fn
getattr(obj, h.__name__)()
File "/gpfs/home4/casparl/EESSI/reframe/reframe/core/hooks.py", line 38, in _fn
func(*args, **kwargs)
File "/gpfs/home4/casparl/EESSI/test-suite/eessi/testsuite/eessi_mixin.py", line 145, in EESSI_mixin_validate_init
raise EESSIError(msg)
eessi.testsuite.utils.EESSIError: The variable 'module_name' should be defined in any test class that inherits from EESSI_Mixin before (or in) the init phase, but it wasn't
Great!
changes this:
to this: