diff --git a/docs/config_reference.rst b/docs/config_reference.rst index c503d14848..7e70e4f367 100644 --- a/docs/config_reference.rst +++ b/docs/config_reference.rst @@ -1340,21 +1340,6 @@ General Configuration The command-line option sets the configuration option to ``false``. -.. js:attribute:: .general[].compact_test_names - - :required: No - :default: ``false`` - - Use a compact test naming scheme. - When set to ``true``, the test parameter values will not be encoded into the test name. - Instead, the several test variants are differentiated by including the unique variant number into the test name. - - .. warning:: - The default value will be changed to ``true`` in version 4.0.0. - - .. versionadded:: 3.9.0 - - .. js:attribute:: .general[].compress_report :required: No diff --git a/docs/manpage.rst b/docs/manpage.rst index 7c0f884f5d..90543a9f3d 100644 --- a/docs/manpage.rst +++ b/docs/manpage.rst @@ -872,8 +872,8 @@ Test Naming Scheme .. versionadded:: 3.10.0 -This section describes the new test naming scheme which will replace the current one in ReFrame 4.0. -It can be enabled by setting the :envvar:`RFM_COMPACT_TEST_NAMES` environment variable. +This section describes the test naming scheme. +This scheme has superseded the old one in ReFrame 4.0. Each ReFrame test is assigned a unique name, which will be used internally by the framework to reference the test. Any test-specific path component will use that name, too. @@ -976,9 +976,6 @@ This could lead to very large and hard to read names when a test defined multipl Very large test names meant also very large path names which could also lead to problems and random failures. Fixtures followed a similar naming pattern making them hard to debug. -The old naming scheme is still the default for parameterized tests (but not for fixtures) and will remain so until ReFrame 4.0, in order to ensure backward compatibility. -However, users are advised to enable the new naming scheme by setting the :envvar:`RFM_COMPACT_TEST_NAMES` environment variable. - Environment ----------- @@ -1107,21 +1104,6 @@ Here is an alphabetical list of the environment variables recognized by ReFrame: ================================== ================== -.. envvar:: RFM_COMPACT_TEST_NAMES - - Enable the new test naming scheme. - - .. table:: - :align: left - - ================================== ================== - Associated command line option N/A - Associated configuration parameter :js:attr:`compact_test_names` general configuration parameter - ================================== ================== - - .. versionadded:: 3.9.0 - - .. envvar:: RFM_COMPRESS_REPORT Compress the generated run report file. diff --git a/reframe/core/decorators.py b/reframe/core/decorators.py index a04c11335e..18a4711911 100644 --- a/reframe/core/decorators.py +++ b/reframe/core/decorators.py @@ -10,7 +10,6 @@ __all__ = ['simple_test'] -import collections import inspect import sys import traceback @@ -42,7 +41,6 @@ class TestRegistry: def __init__(self): self._tests = dict() - self._skip_tests = set() @classmethod def create(cls, test, *args, **kwargs): @@ -54,11 +52,6 @@ def add(self, test, *args, **kwargs): self._tests.setdefault(test, []) self._tests[test].append((args, kwargs)) - # FIXME: To drop with the required_version decorator - def skip(self, test): - '''Add a test to the skip set.''' - self._skip_tests.add(test) - @time_function def instantiate_all(self, reset_sysenv=0): '''Instantiate all the registered tests. @@ -75,9 +68,6 @@ def instantiate_all(self, reset_sysenv=0): leaf_tests = [] for test, variants in self._tests.items(): - if test in self._skip_tests: - continue - for args, kwargs in variants: try: kwargs['reset_sysenv'] = reset_sysenv @@ -138,54 +128,6 @@ def _register_test(cls, *args, **kwargs): mod._rfm_test_registry.add(cls, *args, **kwargs) -def _register_parameterized_test(cls, args=None): - '''Register the test. - - Register the test with _rfm_use_params=True. This additional argument flags - this case to consume the parameter space. Otherwise, the regression test - parameters would simply be initialized to None. - ''' - def _instantiate(cls, args): - if isinstance(args, collections.abc.Sequence): - return cls(*args) - elif isinstance(args, collections.abc.Mapping): - return cls(**args) - elif args is None: - return cls() - - def _instantiate_all(): - ret = [] - for cls, args in mod.__rfm_test_registry: - try: - if cls in mod.__rfm_skip_tests: - continue - except AttributeError: - mod.__rfm_skip_tests = set() - - try: - ret.append(_instantiate(cls, args)) - except SkipTestError as e: - getlogger().warning(f'skipping test {cls.__qualname__!r}: {e}') - except Exception: - exc_info = sys.exc_info() - getlogger().warning( - f"skipping test {cls.__qualname__!r}: {what(*exc_info)} " - f"(rerun with '-v' for more information)" - ) - getlogger().verbose(traceback.format_exc()) - - return ret - - mod = inspect.getmodule(cls) - if not hasattr(mod, '_rfm_gettests'): - mod._rfm_gettests = _instantiate_all - - try: - mod.__rfm_test_registry.append((cls, args)) - except AttributeError: - mod.__rfm_test_registry = [(cls, args)] - - def _validate_test(cls): if not issubclass(cls, RegressionTest): raise ReframeSyntaxError('the decorated class must be a ' diff --git a/reframe/core/fixtures.py b/reframe/core/fixtures.py index d1fcb06fa2..a4ce1907e0 100644 --- a/reframe/core/fixtures.py +++ b/reframe/core/fixtures.py @@ -111,11 +111,6 @@ def __init__(self): p.fullname: {e.name for e in p.environs} for p in sys_part } - # Compact naming switch - self._hash = runtime.runtime().get_option( - 'general/0/compact_test_names' - ) - # Store the system name for name-mangling purposes self._sys_name = runtime.runtime().system.name @@ -177,10 +172,7 @@ def add(self, fixture, variant_num, parent_test): (f'%{k}={utils.toalphanum(str(v))}' for k, v in sorted(variables.items())) ) - if self._hash: - vname = '_' + sha256(vname.encode('utf-8')).hexdigest()[:8] - - fname += vname + fname += '_' + sha256(vname.encode('utf-8')).hexdigest()[:8] # Select only the valid partitions try: diff --git a/reframe/core/logging.py b/reframe/core/logging.py index 8a66fed422..25e7d014c8 100644 --- a/reframe/core/logging.py +++ b/reframe/core/logging.py @@ -580,10 +580,6 @@ def _update_check_extras(self): self.extra[f'check_{extra_name}'] = val # Add special extras - - # FIXME: As soon as `name` becomes a read-only property in 4.0, the - # following assignment will not be needed. - self.extra['check_name'] = self.extra['check_unique_name'] self.extra['check_info'] = self.check.info() self.extra['check_job_completion_time'] = _format_time_rfc3339( time.localtime(self.extra['check_job_completion_time_unix']), diff --git a/reframe/core/meta.py b/reframe/core/meta.py index 5e5b227f1e..3abae0df09 100644 --- a/reframe/core/meta.py +++ b/reframe/core/meta.py @@ -20,7 +20,6 @@ import reframe.utility as utils from reframe.core.exceptions import ReframeSyntaxError -from reframe.core.runtime import runtime class RegressionTestMeta(type): @@ -799,20 +798,9 @@ def variant_name(cls, variant_num=None): if variant_num is None: return name - if runtime().get_option('general/0/compact_test_names'): - if cls.num_variants > 1: - width = utils.count_digits(cls.num_variants) - name += f'_{variant_num:0{width}}' - else: - pid, fid = cls._map_variant_num(variant_num) - - # Append the parameters to the name - if cls.param_space.params: - name += '_' + '_'.join(utils.toalphanum(str(v)) - for v in cls.param_space[pid].values()) - - if len(cls.fixture_space) > 1: - name += f'_{fid}' + if cls.num_variants > 1: + width = utils.count_digits(cls.num_variants) + name += f'_{variant_num:0{width}}' return name diff --git a/reframe/core/pipeline.py b/reframe/core/pipeline.py index 2d5910dee4..f189ef3cc5 100644 --- a/reframe/core/pipeline.py +++ b/reframe/core/pipeline.py @@ -914,8 +914,7 @@ def __new__(cls, *args, **kwargs): # Prepare initialization of test defaults (variables and parameters are # injected after __new__ has returned, so we schedule this function # call as a pre-init hook). - obj.__deferred_rfm_init = obj.__rfm_init__(*args, - prefix=prefix, **kwargs) + obj.__deferred_rfm_init = obj.__rfm_init__(prefix) # Build pipeline hook registry and add the pre-init hook cls._rfm_pipeline_hooks = cls._process_hook_registry() @@ -959,17 +958,10 @@ def __init_subclass__(cls, *, special=False, pin_prefix=False, ) @deferrable - def __rfm_init__(self, *args, prefix=None, **kwargs): + def __rfm_init__(self, prefix=None): if not self.is_fixture() and not hasattr(self, '_rfm_unique_name'): self._rfm_unique_name = type(self).variant_name(self.variant_num) - # Add the parameters from the parameterized_test decorator. - if args or kwargs: - arg_names = map(lambda x: util.toalphanum(str(x)), - itertools.chain(args, kwargs.values())) - self._rfm_unique_name += '_' + '_'.join(arg_names) - self._rfm_old_style_params = True - # Pass if descr is a required variable. if not hasattr(self, 'descr'): self.descr = self.display_name @@ -1092,6 +1084,7 @@ def unique_name(self): ''' return self._rfm_unique_name + @loggable @property def name(self): '''The name of the test. @@ -1136,9 +1129,6 @@ def _format_params(cls, info, prefix=' %'): return name - if hasattr(self, '_rfm_old_style_params'): - return self.unique_name - if hasattr(self, '_rfm_display_name'): return self._rfm_display_name diff --git a/reframe/frontend/cli.py b/reframe/frontend/cli.py index eb0e5458d0..83bba0fb18 100644 --- a/reframe/frontend/cli.py +++ b/reframe/frontend/cli.py @@ -595,13 +595,6 @@ def main(): action='store_true', help='Graylog server address' ) - argparser.add_argument( - dest='compact_test_names', - envvar='RFM_COMPACT_TEST_NAMES', - configvar='general/compact_test_names', - action='store_true', - help='Use a compact test naming scheme' - ) argparser.add_argument( dest='dump_pipeline_progress', envvar='RFM_DUMP_PIPELINE_PROGRESS', diff --git a/reframe/frontend/filters.py b/reframe/frontend/filters.py index 46fefac421..efdb95c9ec 100644 --- a/reframe/frontend/filters.py +++ b/reframe/frontend/filters.py @@ -23,14 +23,11 @@ def _fn(case): # Match pattern, but remove spaces from the `display_name` display_name = case.check.display_name.replace(' ', '') rt = runtime() - if not rt.get_option('general/0/compact_test_names'): - return regex.match(case.check.unique_name) + if '@' in patt: + # Do an exact match on the unique name + return patt.replace('@', '_') == case.check.unique_name else: - if '@' in patt: - # Do an exact match on the unique name - return patt.replace('@', '_') == case.check.unique_name - else: - return regex.match(display_name) + return regex.match(display_name) return _fn @@ -44,15 +41,13 @@ def _fn(case): def have_any_name(names): rt = runtime() - has_compact_names = rt.get_option('general/0/compact_test_names') exact_matches = [] regex_matches = [] for n in names: - if has_compact_names and '@' in n: + if '@' in n: test, _, variant = n.rpartition('@') if variant.isdigit(): exact_matches.append((test, int(variant))) - else: regex_matches.append(n) @@ -70,10 +65,7 @@ def _fn(case): display_name = case.check.display_name.replace(' ', '') if regex: - if has_compact_names: - return regex.match(display_name) - else: - return regex.match(case.check.unique_name) + return regex.match(display_name) return False diff --git a/reframe/frontend/loader.py b/reframe/frontend/loader.py index ab664872e8..4e73bcc009 100644 --- a/reframe/frontend/loader.py +++ b/reframe/frontend/loader.py @@ -166,20 +166,8 @@ def load_from_module(self, module): This method tries to load the test registry from a given module and instantiates all the tests in the registry. The instantiated checks are validated before return. - - For legacy reasons, a module might have the additional legacy registry - `_rfm_gettests`, which is a method that instantiates all the tests - registered with the deprecated `parameterized_test` decorator. ''' - from reframe.core.pipeline import RegressionTest - - # FIXME: Remove the legacy_registry after dropping parameterized_test registry = getattr(module, '_rfm_test_registry', None) - legacy_registry = getattr(module, '_rfm_gettests', None) - if not any((registry, legacy_registry)): - getlogger().debug('No tests registered') - return [] - self._set_defaults(registry) reset_sysenv = self._skip_prgenv_check << 1 | self._skip_system_check if registry: @@ -187,32 +175,9 @@ def load_from_module(self, module): else: candidate_tests = [] - legacy_tests = legacy_registry() if legacy_registry else [] - if self._external_vars and legacy_tests: - getlogger().warning( - "variables of tests using the deprecated " - "'@parameterized_test' decorator cannot be set externally; " - "please use the 'parameter' builtin in your tests" - ) - - # Reset valid_systems and valid_prog_environs in all legacy tests - if reset_sysenv: - for t in legacy_tests: - if self._skip_system_check: - t.valid_systems = ['*'] - - if self._skip_prgenv_check: - t.valid_prog_environs = ['*'] - - # Merge tests - candidate_tests += legacy_tests - # Post-instantiation validation of the candidate tests final_tests = [] for c in candidate_tests: - if not isinstance(c, RegressionTest): - continue - if not self._validate_check(c): continue diff --git a/reframe/frontend/statistics.py b/reframe/frontend/statistics.py index e5b81b1d7e..56b6eefb92 100644 --- a/reframe/frontend/statistics.py +++ b/reframe/frontend/statistics.py @@ -252,14 +252,10 @@ def print_failure_report(self, printer, rerun_info=True): printer.info(f" * Maintainers: {r['maintainers']}") printer.info(f" * Failing phase: {r['fail_phase']}") if rerun_info and not r['fixture']: - if rt.runtime().get_option('general/0/compact_test_names'): - cls = r['display_name'].split(' ')[0] - variant = r['unique_name'].replace(cls, '') - variant = variant.replace('_', '@') - nameoptarg = cls + variant - else: - nameoptarg = r['unique_name'] - + cls = r['display_name'].split(' ')[0] + variant = r['unique_name'].replace(cls, '') + variant = variant.replace('_', '@') + nameoptarg = cls + variant printer.info(f" * Rerun with '-n {nameoptarg}" f" -p {r['environment']} --system " f"{r['system']} -r'") diff --git a/reframe/schemas/config.json b/reframe/schemas/config.json index 46df7c9fdb..9ae74342df 100644 --- a/reframe/schemas/config.json +++ b/reframe/schemas/config.json @@ -465,7 +465,6 @@ "check_search_recursive": {"type": "boolean"}, "clean_stagedir": {"type": "boolean"}, "colorize": {"type": "boolean"}, - "compact_test_names": {"type": "boolean"}, "compress_report": {"type": "boolean"}, "git_timeout": {"type": "number"}, "ignore_check_conflicts": {"type": "boolean"}, @@ -519,7 +518,6 @@ "general/check_search_recursive": false, "general/clean_stagedir": true, "general/colorize": true, - "general/compact_test_names": false, "general/compress_report": false, "general/git_timeout": 5, "general/ignore_check_conflicts": false, diff --git a/unittests/resources/settings.py b/unittests/resources/settings.py index 0e10da749c..8ded35dc48 100644 --- a/unittests/resources/settings.py +++ b/unittests/resources/settings.py @@ -304,10 +304,6 @@ 'check_search_path': ['c:d'], 'target_systems': ['testsys'] }, - { - 'compact_test_names': True, - 'target_systems': ['sys1'] - }, { 'git_timeout': 10, 'target_systems': ['generic2:part1'] diff --git a/unittests/test_cli.py b/unittests/test_cli.py index 35676f3bd5..0136b66fe9 100644 --- a/unittests/test_cli.py +++ b/unittests/test_cli.py @@ -973,7 +973,6 @@ def test_dynamic_tests(run_reframe, tmp_path): def test_dynamic_tests_filtering(run_reframe, tmp_path): - # Target sys1 that has compact_test_names==True returncode, stdout, _ = run_reframe( system='sys1', environs=[], diff --git a/unittests/test_dependencies.py b/unittests/test_dependencies.py index 210722dbaa..e7378220ea 100644 --- a/unittests/test_dependencies.py +++ b/unittests/test_dependencies.py @@ -54,9 +54,9 @@ def has_edge(graph, src, dst): return dst in graph[src] -def num_deps(graph, cname): +def num_deps(graph, name): return sum(len(deps) for c, deps in graph.items() - if c.check.name == cname) + if c.check.display_name == name) def in_degree(graph, node): @@ -65,9 +65,9 @@ def in_degree(graph, node): return v.num_dependents -def find_check(name, checks): +def find_check(checks, name, **params): for c in checks: - if c.name == name: + if c.display_name == name: return c return None @@ -75,7 +75,7 @@ def find_check(name, checks): def find_case(cname, ename, partname, cases): for c in cases: - if (c.check.name == cname and + if (c.check.display_name == cname and c.environ.name == ename and c.partition.name == partname): return c @@ -320,13 +320,16 @@ def test_dependecies_how_functions_undoc(): def test_build_deps(loader, default_exec_ctx): checks = loader.load_all(force=True) + # Build a map from display names to unique names + uid = {c.display_name: c.unique_name for c in checks} + # We need to prepare the test cases as if we were about to run them, # because we want to test `getdep()` as well, which normally gets resolved # during the `setup` phase of the pipeline cases = executors.generate_testcases(checks, prepare=True) # Test calling getdep() before having built the graph - t = find_check('Test1_fully', checks) + t = find_check(checks, 'Test1 %kind=fully') with pytest.raises(DependencyError): t.getdep('Test0', 'e0', 'p0') @@ -335,110 +338,110 @@ def test_build_deps(loader, default_exec_ctx): dependencies.validate_deps(deps) # Check dependencies for fully connected graph - assert num_deps(deps, 'Test1_fully') == 16 + assert num_deps(deps, 'Test1 %kind=fully') == 16 for p0 in ['sys0:p0', 'sys0:p1']: for p1 in ['sys0:p0', 'sys0:p1']: for e0 in ['e0', 'e1']: for e1 in ['e0', 'e1']: assert has_edge(deps, - Node('Test1_fully', p0, e0), + Node(uid['Test1 %kind=fully'], p0, e0), Node('Test0', p1, e1)) # Check dependencies with same partition - assert num_deps(deps, 'Test1_by_part') == 8 + assert num_deps(deps, 'Test1 %kind=by_part') == 8 for p in ['sys0:p0', 'sys0:p1']: for e0 in ['e0', 'e1']: for e1 in ['e0', 'e1']: assert has_edge(deps, - Node('Test1_by_part', p, e0), + Node(uid['Test1 %kind=by_part'], p, e0), Node('Test0', p, e1)) # Check dependencies with same partition environment - assert num_deps(deps, 'Test1_by_case') == 4 - assert num_deps(deps, 'Test1_default') == 4 + assert num_deps(deps, 'Test1 %kind=by_case') == 4 + assert num_deps(deps, 'Test1 %kind=default') == 4 for p in ['sys0:p0', 'sys0:p1']: for e in ['e0', 'e1']: assert has_edge(deps, - Node('Test1_by_case', p, e), + Node(uid['Test1 %kind=by_case'], p, e), Node('Test0', p, e)) assert has_edge(deps, - Node('Test1_default', p, e), + Node(uid['Test1 %kind=default'], p, e), Node('Test0', p, e)) - assert num_deps(deps, 'Test1_any') == 12 + assert num_deps(deps, 'Test1 %kind=any') == 12 for p0 in ['sys0:p0', 'sys0:p1']: for p1 in ['sys0:p0', 'sys0:p1']: for e0 in ['e0', 'e1']: for e1 in ['e0', 'e1']: if (p0 == 'sys0:p0' or e1 == 'e1'): assert has_edge(deps, - Node('Test1_any', p0, e0), + Node(uid['Test1 %kind=any'], p0, e0), Node('Test0', p1, e1)) - assert num_deps(deps, 'Test1_all') == 2 + assert num_deps(deps, 'Test1 %kind=all') == 2 for p0 in ['sys0:p0', 'sys0:p1']: for p1 in ['sys0:p0', 'sys0:p1']: for e0 in ['e0', 'e1']: for e1 in ['e0', 'e1']: if (p0 == 'sys0:p0' and p1 == 'sys0:p0' and e1 == 'e1'): assert has_edge(deps, - Node('Test1_any', p0, e0), + Node(uid['Test1 %kind=any'], p0, e0), Node('Test0', p1, e1)) # Check custom dependencies - assert num_deps(deps, 'Test1_custom') == 1 + assert num_deps(deps, 'Test1 %kind=custom') == 1 assert has_edge(deps, - Node('Test1_custom', 'sys0:p0', 'e0'), + Node(uid['Test1 %kind=custom'], 'sys0:p0', 'e0'), Node('Test0', 'sys0:p1', 'e1')) - # Check dependencies of Test1_nodeps - assert num_deps(deps, 'Test1_nodeps') == 0 + # Check dependencies of Test1 %kind=nodeps + assert num_deps(deps, 'Test1 %kind=nodeps') == 0 # Check in-degree of Test0 - # 4 from Test1_fully, - # 2 from Test1_by_part, - # 1 from Test1_by_case, - # 2 from Test1_any, - # 2 from Test1_all, - # 0 from Test1_custom, - # 1 from Test1_default - # 0 from Test1_nodeps + # 4 from Test1 %kind=fully, + # 2 from Test1 %kind=by_part, + # 1 from Test1 %kind=by_case, + # 2 from Test1 %kind=any, + # 2 from Test1 %kind=all, + # 0 from Test1 %kind=custom, + # 1 from Test1 %kind=default + # 0 from Test1 %kind=nodeps assert in_degree(deps, Node('Test0', 'sys0:p0', 'e0')) == 12 - # 4 from Test1_fully, - # 2 from Test1_by_part, - # 1 from Test1_by_case, - # 2 from Test1_any, - # 0 from Test1_all, - # 0 from Test1_custom, - # 1 from Test1_default - # 0 from Test1_nodeps + # 4 from Test1 %kind=fully, + # 2 from Test1 %kind=by_part, + # 1 from Test1 %kind=by_case, + # 2 from Test1 %kind=any, + # 0 from Test1 %kind=all, + # 0 from Test1 %kind=custom, + # 1 from Test1 %kind=default + # 0 from Test1 %kind=nodeps assert in_degree(deps, Node('Test0', 'sys0:p1', 'e0')) == 10 - # 4 from Test1_fully, - # 2 from Test1_by_part, - # 1 from Test1_by_case, - # 4 from Test1_any, - # 0 from Test1_all, - # 0 from Test1_custom, - # 1 from Test1_default - # 0 from Test1_nodeps + # 4 from Test1 %kind=fully, + # 2 from Test1 %kind=by_part, + # 1 from Test1 %kind=by_case, + # 4 from Test1 %kind=any, + # 0 from Test1 %kind=all, + # 0 from Test1 %kind=custom, + # 1 from Test1 %kind=default + # 0 from Test1 %kind=nodeps assert in_degree(deps, Node('Test0', 'sys0:p0', 'e1')) == 12 - # 4 from Test1_fully, - # 2 from Test1_by_part, - # 1 from Test1_by_case, - # 4 from Test1_any, - # 0 from Test1_all, - # 1 from Test1_custom, - # 1 from Test1_default - # 0 from Test1_nodeps + # 4 from Test1 %kind=fully, + # 2 from Test1 %kind=by_part, + # 1 from Test1 %kind=by_case, + # 4 from Test1 %kind=any, + # 0 from Test1 %kind=all, + # 1 from Test1 %kind=custom, + # 1 from Test1 %kind=default + # 0 from Test1 %kind=nodeps assert in_degree(deps, Node('Test0', 'sys0:p1', 'e1')) == 13 # Pick a check to test getdep() - check_e0 = find_case('Test1_by_part', 'e0', 'p0', cases).check - check_e1 = find_case('Test1_by_part', 'e1', 'p0', cases).check + check_e0 = find_case('Test1 %kind=by_part', 'e0', 'p0', cases).check + check_e1 = find_case('Test1 %kind=by_part', 'e1', 'p0', cases).check with pytest.raises(DependencyError): check_e0.getdep('Test0', 'p0') diff --git a/unittests/test_filters.py b/unittests/test_filters.py index 8388980d69..e052061eff 100644 --- a/unittests/test_filters.py +++ b/unittests/test_filters.py @@ -45,26 +45,7 @@ class _X(rfm.RegressionTest): @pytest.fixture -def use_compact_names(make_exec_ctx_g): - yield from make_exec_ctx_g(options={'general/compact_test_names': True}) - - -@pytest.fixture -def sample_param_cases(use_compact_names): - class _X(rfm.RegressionTest): - p = parameter([1] + list(range(11))) - valid_systems = ['*'] - valid_prog_environs = ['*'] - - return [executors.TestCase(_X(variant_num=v), None, None) - for v in range(_X.num_variants)] - - -@pytest.fixture -def sample_param_cases_compat(): - # Param cases with the old naming scheme; i.e., with - # `general/compact_test_names=False` - +def sample_param_cases(): class _X(rfm.RegressionTest): p = parameter([1] + list(range(11))) valid_systems = ['*'] @@ -103,25 +84,7 @@ def test_have_any_name_param_test(sample_param_cases): assert 2 == count_checks(filters.have_any_name(['_X@0', '_X@1']), sample_param_cases) assert 12 == count_checks(filters.have_any_name(['_X@0', '_X.*']), - sample_param_cases) - - -def test_have_any_name_param_test_compat(sample_param_cases_compat): - assert 0 == count_checks(filters.have_any_name(['.*%p=1']), - sample_param_cases_compat) - assert 0 == count_checks(filters.have_any_name(['_X%p=3']), - sample_param_cases_compat) - assert 0 == count_checks(filters.have_any_name(['_X@2']), - sample_param_cases_compat) - # The regex will match "_X_1" as well as "_X_10" - assert 3 == count_checks(filters.have_any_name(['_X_1']), - sample_param_cases_compat) - assert 2 == count_checks(filters.have_any_name(['_X_1$']), - sample_param_cases_compat) - assert 0 == count_checks(filters.have_any_name(['_X@0', '_X@1']), - sample_param_cases_compat) - assert 12 == count_checks(filters.have_any_name(['_X@0', '_X.*']), - sample_param_cases_compat) + sample_param_cases) def test_have_not_name(sample_cases): diff --git a/unittests/test_parameters.py b/unittests/test_parameters.py index 12938ad528..f9cfdd6c33 100644 --- a/unittests/test_parameters.py +++ b/unittests/test_parameters.py @@ -316,21 +316,6 @@ class Foo(rfm.RegressionTest): p += 1 -def test_parameter_space_order(): - '''FIXME: This can be removed when the old naming scheme is dropped. - - The order of the parameters is only relevant for the old naming scheme. - This test simply ensures that these legacy options are not broken. - ''' - - class MyTest(rfm.RegressionTest): - p0 = parameter([0]) - p1 = parameter([0]) - p2 = parameter([0]) - - assert ['p0', 'p1', 'p2'] == [p for p in MyTest.param_space.params] - - def test_local_paramspace_is_empty(): class MyTest(rfm.RegressionTest): p = parameter([1, 2, 3]) diff --git a/unittests/test_pipeline.py b/unittests/test_pipeline.py index 0c7c358b0b..5edbd26aef 100644 --- a/unittests/test_pipeline.py +++ b/unittests/test_pipeline.py @@ -1224,73 +1224,6 @@ def setz(self, T0): assert t.z == 3 -# All the following tests about naming are for the deprecated -# @parameterized_test decorator - -def test_regression_test_name(): - class MyTest(rfm.RegressionTest): - def __init__(self, a, b): - self.a = a - self.b = b - - test = MyTest(1, 2) - assert os.path.abspath(os.path.dirname(__file__)) == test.prefix - assert 'MyTest_1_2' == test.name - - -def test_strange_test_names(): - class C: - def __init__(self, a): - self.a = a - - def __repr__(self): - return f'C({self.a})' - - class MyTest(rfm.RegressionTest): - def __init__(self, a, b): - self.a = a - self.b = b - - test = MyTest('(a*b+c)/12', C(33)) - assert 'MyTest__a_b_c__12_C_33_' == test.name - - -def test_name_user_inheritance(): - class MyBaseTest(rfm.RegressionTest): - def __init__(self, a, b): - self.a = a - self.b = b - - class MyTest(MyBaseTest): - def __init__(self): - super().__init__(1, 2) - - test = MyTest() - assert 'MyTest' == test.name - - -def test_name_runonly_test(): - class MyTest(rfm.RunOnlyRegressionTest): - def __init__(self, a, b): - self.a = a - self.b = b - - test = MyTest(1, 2) - assert os.path.abspath(os.path.dirname(__file__)) == test.prefix - assert 'MyTest_1_2' == test.name - - -def test_name_compileonly_test(): - class MyTest(rfm.CompileOnlyRegressionTest): - def __init__(self, a, b): - self.a = a - self.b = b - - test = MyTest(1, 2) - assert os.path.abspath(os.path.dirname(__file__)) == test.prefix - assert 'MyTest_1_2' == test.name - - def test_trap_job_errors_without_sanity_patterns(local_exec_ctx): rt.runtime().site_config.add_sticky_option('general/trap_job_errors', True)