Skip to content

Commit 8fb23ab

Browse files
authored
Merge branch 'develop' into develop
2 parents 32e50c2 + 48448aa commit 8fb23ab

File tree

7 files changed

+44
-21
lines changed

7 files changed

+44
-21
lines changed

docs/tutorial.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@ By inspecting the generated script files, you will notice that ReFrame emits the
16721672
.. code-block:: bash
16731673
:caption: Run with the Docker compose setup.
16741674
1675-
cat /scratch/rfm-stage/output/pseudo-cluster/compute/gnu/stream_test_pseudo-cluster_compute_8de19aca/rfm_job.sh
1675+
cat /scratch/rfm-stage/output/pseudo-cluster/compute/gnu/stream_test_584fea5f/rfm_job.sh
16761676
16771677
.. code-block:: bash
16781678

examples/tutorial/dockerfiles/slurm-cluster/docker-compose.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ services:
1212

1313
frontend:
1414
image: slurm-reframe
15-
build: examples/tutorial/dockerfiles/slurm-cluster/reframe
15+
build:
16+
context: examples/tutorial/dockerfiles/slurm-cluster/reframe
17+
args:
18+
REFRAME_REPO: reframe-hpc
19+
REFRAME_TAG: develop
1620
container_name: frontend
1721
hostname: login
1822
user: admin

reframe/core/meta.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ def __new__(metacls, name, bases, namespace, **kwargs):
305305
'''
306306

307307
# Collect the loggable properties
308-
loggable_props = []
309308
namespace['_rfm_loggable_props'] = [
310309
v.fget._rfm_loggable for v in namespace.values()
311310
if hasattr(v, 'fget') and hasattr(v.fget, '_rfm_loggable')
@@ -816,7 +815,8 @@ def is_abstract(cls):
816815
def variant_name(cls, variant_num=None):
817816
'''Return the name of the test variant with a specific variant number.
818817
819-
:param variant_num: An integer in the range of ``[0, cls.num_variants)``.
818+
:param variant_num: An integer in the range of
819+
``[0, cls.num_variants)``.
820820
'''
821821

822822
name = cls.__name__

reframe/core/pipeline.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,9 +1194,26 @@ def unique_name(self):
11941194
def name(self):
11951195
'''The name of the test.
11961196
1197-
This is an alias of :attr:`display_name`.
1197+
This is an alias of :attr:`display_name` but omitting any implicit
1198+
parameters starting with ``$`` that are inserted by the
1199+
:option:`--repeat`, :option:`--distribute` and other similar options.
1200+
1201+
.. versionchanged:: 4.7
1202+
1203+
The implicit parameters starting with ``$`` are now omitted.
11981204
'''
1199-
return self.display_name
1205+
if hasattr(self, '_rfm_name'):
1206+
return self._rfm_name
1207+
1208+
# Remove any special parameters starting with `$`
1209+
basename, *params = self.display_name.split(' ')
1210+
name = basename
1211+
for p in params:
1212+
if not p.startswith('%$'):
1213+
name += f' {p}'
1214+
1215+
self._rfm_name = name
1216+
return self._rfm_name
12001217

12011218
@loggable
12021219
@property

reframe/frontend/cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,15 @@ def describe_checks(testcases, printer):
141141
if tc.check.is_fixture():
142142
continue
143143

144-
if tc.check.name not in unique_names:
145-
unique_names.add(tc.check.name)
144+
if tc.check.display_name not in unique_names:
145+
unique_names.add(tc.check.display_name)
146146
rec = json.loads(jsonext.dumps(tc.check))
147147

148148
# Now manipulate the record to be more user-friendly
149149
#
150150
# 1. Add other fields that are relevant for users
151151
# 2. Remove all private fields
152+
rec['name'] = tc.check.name
152153
rec['unique_name'] = tc.check.unique_name
153154
rec['display_name'] = tc.check.display_name
154155
rec['pipeline_hooks'] = {}

reframe/frontend/filters.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import re
77

88
from reframe.core.exceptions import ReframeError
9-
from reframe.core.runtime import runtime
109

1110

1211
def re_compile(patt):
@@ -22,7 +21,6 @@ def _have_name(patt):
2221
def _fn(case):
2322
# Match pattern, but remove spaces from the `display_name`
2423
display_name = case.check.display_name.replace(' ', '')
25-
rt = runtime()
2624
if '@' in patt:
2725
# Do an exact match on the unique name
2826
return patt.replace('@', '_') == case.check.unique_name
@@ -43,7 +41,6 @@ def _fn(case):
4341

4442

4543
def have_any_name(names):
46-
rt = runtime()
4744
variant_matches = []
4845
hash_matches = []
4946
regex_matches = []

reframe/frontend/testgenerators.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,16 @@ def _rfm_set_valid_systems(obj):
9494
obj.valid_systems = [partition.fullname]
9595

9696
return make_test(
97-
f'{cls.__name__}_{partition.fullname.replace(":", "_")}',
98-
(cls,),
97+
cls.__name__, (cls,),
9998
{
10099
'valid_systems': [partition.fullname],
100+
# We add a partition parameter so as to differentiate the test
101+
# in case another test has the same nodes in another partition
102+
'$part': builtins.parameter([partition.fullname],
103+
loggable=False),
101104
'$nid': builtins.parameter(
102105
[[n] for n in node_map[partition.fullname]],
103-
fmt=util.nodelist_abbrev
106+
fmt=util.nodelist_abbrev, loggable=False
104107
)
105108
},
106109
methods=[
@@ -110,7 +113,7 @@ def _rfm_set_valid_systems(obj):
110113
# will not be overwritten by a parent post-init hook
111114
builtins.run_after('init')(_rfm_set_valid_systems),
112115
]
113-
), ['$nid']
116+
), ['$part', '$nid']
114117

115118
return _generate_tests(testcases, _make_dist_test)
116119

@@ -122,9 +125,10 @@ def repeat_tests(testcases, num_repeats):
122125
def _make_repeat_test(testcase):
123126
cls = type(testcase.check)
124127
return make_test(
125-
f'{cls.__name__}', (cls,),
128+
cls.__name__, (cls,),
126129
{
127-
'$repeat_no': builtins.parameter(range(num_repeats))
130+
'$repeat_no': builtins.parameter(range(num_repeats),
131+
loggable=False)
128132
}
129133
), ['$repeat_no']
130134

@@ -150,25 +154,25 @@ def _make_parameterized_test(testcase):
150154
if var_check != cls.__name__:
151155
continue
152156
else:
153-
getlogger().warning(f'cannot set a variable in a fixture')
157+
getlogger().warning('cannot set a variable in a fixture')
154158
continue
155159

156-
if not var in cls.var_space:
160+
if var not in cls.var_space:
157161
getlogger().warning(
158162
f'variable {var!r} not defined for test '
159163
f'{check.display_name!r}; ignoring parameterization'
160164
)
161165
continue
162166

163-
body[f'${var}'] = builtins.parameter(values)
167+
body[f'${var}'] = builtins.parameter(values, loggable=False)
164168

165169
def _set_vars(self):
166170
for var in body.keys():
167171
setattr(self, var[1:],
168172
make_convertible(getattr(self, f'{var}')))
169173

170174
return make_test(
171-
f'{cls.__name__}', (cls,),
175+
cls.__name__, (cls,),
172176
body=body,
173177
methods=[builtins.run_after('init')(_set_vars)]
174178
), body.keys()

0 commit comments

Comments
 (0)