diff --git a/docs/tutorial.rst b/docs/tutorial.rst index e2d8bd2a99..55c52bd1df 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -1672,7 +1672,7 @@ By inspecting the generated script files, you will notice that ReFrame emits the .. code-block:: bash :caption: Run with the Docker compose setup. - cat /scratch/rfm-stage/output/pseudo-cluster/compute/gnu/stream_test_pseudo-cluster_compute_8de19aca/rfm_job.sh + cat /scratch/rfm-stage/output/pseudo-cluster/compute/gnu/stream_test_584fea5f/rfm_job.sh .. code-block:: bash diff --git a/examples/tutorial/dockerfiles/slurm-cluster/docker-compose.yml b/examples/tutorial/dockerfiles/slurm-cluster/docker-compose.yml index 13ce87e9ff..d6ef75df9f 100644 --- a/examples/tutorial/dockerfiles/slurm-cluster/docker-compose.yml +++ b/examples/tutorial/dockerfiles/slurm-cluster/docker-compose.yml @@ -12,7 +12,11 @@ services: frontend: image: slurm-reframe - build: examples/tutorial/dockerfiles/slurm-cluster/reframe + build: + context: examples/tutorial/dockerfiles/slurm-cluster/reframe + args: + REFRAME_REPO: reframe-hpc + REFRAME_TAG: develop container_name: frontend hostname: login user: admin diff --git a/reframe/core/meta.py b/reframe/core/meta.py index 1b3faed419..b57de01c14 100644 --- a/reframe/core/meta.py +++ b/reframe/core/meta.py @@ -305,7 +305,6 @@ def __new__(metacls, name, bases, namespace, **kwargs): ''' # Collect the loggable properties - loggable_props = [] namespace['_rfm_loggable_props'] = [ v.fget._rfm_loggable for v in namespace.values() if hasattr(v, 'fget') and hasattr(v.fget, '_rfm_loggable') @@ -816,7 +815,8 @@ def is_abstract(cls): def variant_name(cls, variant_num=None): '''Return the name of the test variant with a specific variant number. - :param variant_num: An integer in the range of ``[0, cls.num_variants)``. + :param variant_num: An integer in the range of + ``[0, cls.num_variants)``. ''' name = cls.__name__ diff --git a/reframe/core/pipeline.py b/reframe/core/pipeline.py index f928a406f5..79c8d6a916 100644 --- a/reframe/core/pipeline.py +++ b/reframe/core/pipeline.py @@ -1194,9 +1194,26 @@ def unique_name(self): def name(self): '''The name of the test. - This is an alias of :attr:`display_name`. + This is an alias of :attr:`display_name` but omitting any implicit + parameters starting with ``$`` that are inserted by the + :option:`--repeat`, :option:`--distribute` and other similar options. + + .. versionchanged:: 4.7 + + The implicit parameters starting with ``$`` are now omitted. ''' - return self.display_name + if hasattr(self, '_rfm_name'): + return self._rfm_name + + # Remove any special parameters starting with `$` + basename, *params = self.display_name.split(' ') + name = basename + for p in params: + if not p.startswith('%$'): + name += f' {p}' + + self._rfm_name = name + return self._rfm_name @loggable @property diff --git a/reframe/frontend/cli.py b/reframe/frontend/cli.py index 19d4ffec6e..ff88f5f856 100644 --- a/reframe/frontend/cli.py +++ b/reframe/frontend/cli.py @@ -141,14 +141,15 @@ def describe_checks(testcases, printer): if tc.check.is_fixture(): continue - if tc.check.name not in unique_names: - unique_names.add(tc.check.name) + if tc.check.display_name not in unique_names: + unique_names.add(tc.check.display_name) rec = json.loads(jsonext.dumps(tc.check)) # Now manipulate the record to be more user-friendly # # 1. Add other fields that are relevant for users # 2. Remove all private fields + rec['name'] = tc.check.name rec['unique_name'] = tc.check.unique_name rec['display_name'] = tc.check.display_name rec['pipeline_hooks'] = {} diff --git a/reframe/frontend/filters.py b/reframe/frontend/filters.py index 3b47ad5737..77d90b9b6a 100644 --- a/reframe/frontend/filters.py +++ b/reframe/frontend/filters.py @@ -6,7 +6,6 @@ import re from reframe.core.exceptions import ReframeError -from reframe.core.runtime import runtime def re_compile(patt): @@ -22,7 +21,6 @@ def _have_name(patt): def _fn(case): # Match pattern, but remove spaces from the `display_name` display_name = case.check.display_name.replace(' ', '') - rt = runtime() if '@' in patt: # Do an exact match on the unique name return patt.replace('@', '_') == case.check.unique_name @@ -43,7 +41,6 @@ def _fn(case): def have_any_name(names): - rt = runtime() variant_matches = [] hash_matches = [] regex_matches = [] diff --git a/reframe/frontend/testgenerators.py b/reframe/frontend/testgenerators.py index bae4cc4f16..b5f597d48a 100644 --- a/reframe/frontend/testgenerators.py +++ b/reframe/frontend/testgenerators.py @@ -94,13 +94,16 @@ def _rfm_set_valid_systems(obj): obj.valid_systems = [partition.fullname] return make_test( - f'{cls.__name__}_{partition.fullname.replace(":", "_")}', - (cls,), + cls.__name__, (cls,), { 'valid_systems': [partition.fullname], + # We add a partition parameter so as to differentiate the test + # in case another test has the same nodes in another partition + '$part': builtins.parameter([partition.fullname], + loggable=False), '$nid': builtins.parameter( [[n] for n in node_map[partition.fullname]], - fmt=util.nodelist_abbrev + fmt=util.nodelist_abbrev, loggable=False ) }, methods=[ @@ -110,7 +113,7 @@ def _rfm_set_valid_systems(obj): # will not be overwritten by a parent post-init hook builtins.run_after('init')(_rfm_set_valid_systems), ] - ), ['$nid'] + ), ['$part', '$nid'] return _generate_tests(testcases, _make_dist_test) @@ -122,9 +125,10 @@ def repeat_tests(testcases, num_repeats): def _make_repeat_test(testcase): cls = type(testcase.check) return make_test( - f'{cls.__name__}', (cls,), + cls.__name__, (cls,), { - '$repeat_no': builtins.parameter(range(num_repeats)) + '$repeat_no': builtins.parameter(range(num_repeats), + loggable=False) } ), ['$repeat_no'] @@ -150,17 +154,17 @@ def _make_parameterized_test(testcase): if var_check != cls.__name__: continue else: - getlogger().warning(f'cannot set a variable in a fixture') + getlogger().warning('cannot set a variable in a fixture') continue - if not var in cls.var_space: + if var not in cls.var_space: getlogger().warning( f'variable {var!r} not defined for test ' f'{check.display_name!r}; ignoring parameterization' ) continue - body[f'${var}'] = builtins.parameter(values) + body[f'${var}'] = builtins.parameter(values, loggable=False) def _set_vars(self): for var in body.keys(): @@ -168,7 +172,7 @@ def _set_vars(self): make_convertible(getattr(self, f'{var}'))) return make_test( - f'{cls.__name__}', (cls,), + cls.__name__, (cls,), body=body, methods=[builtins.run_after('init')(_set_vars)] ), body.keys()