diff --git a/eessi/testsuite/common_config.py b/eessi/testsuite/common_config.py index ec330392..c9011713 100644 --- a/eessi/testsuite/common_config.py +++ b/eessi/testsuite/common_config.py @@ -1,9 +1,51 @@ import json import os +from reframe.core.config import load_config +from reframe.core.exceptions import ConfigError from reframe.core.logging import getlogger from eessi.testsuite.constants import FEATURES +from eessi.testsuite.utils import EESSIError + + +def reframe_version_is_supported(): + testconfig = load_config() + testconfig.update_config({ + 'systems': [{ + 'name': 'config_probe', + 'hostnames': ['.*'], + 'partitions': [{ + 'name': 'default', + 'scheduler': 'local', + 'launcher': 'local', + 'environs': ['EESSI-2025.06'], + # feature names starting with a digit must be supported + 'features': ['16_nodes'], + }], + }], + 'environments': [{ + # environment names containing dots must be supported + 'name': 'EESSI-2025.06', + }], + }, '') + + try: + testconfig.validate() + except ConfigError: + return False + + return True + + +if not reframe_version_is_supported(): + msg = ' '.join([ + 'The EESSI test suite does not support this ReFrame version due to feature name and environment name', + 'restrictions. Unsupported versions: >=4.10.1,<4.11', + 'See https://github.com/reframe-hpc/reframe/issues/3723 for details.', + ]) + raise EESSIError(msg) + perflog_format = '|'.join([ '%(check_job_completion_time)s', diff --git a/eessi/testsuite/utils.py b/eessi/testsuite/utils.py index 95d92a2d..32f18250 100644 --- a/eessi/testsuite/utils.py +++ b/eessi/testsuite/utils.py @@ -37,6 +37,10 @@ pass +def make_red(msg): + return f'\033[31m{msg}\033[0m' + + class EESSIError(ReframeFatalError): traceback = os.getenv('TRACEBACK', "0") addendum = '' @@ -46,7 +50,7 @@ class EESSIError(ReframeFatalError): addendum = '\nRerun with `TRACEBACK=1 reframe ...` to show the full traceback.' def __str__(self): - return super().__str__() + EESSIError.addendum + return make_red(super().__str__()) + EESSIError.addendum def log(msg, logger=printer.debug):