Skip to content

Commit 7656d9f

Browse files
author
Vasileios Karakasis
committed
Final grooming
1 parent ce9fc6f commit 7656d9f

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

reframe/core/systems.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ def create(cls, site_config):
475475
)
476476
)
477477

478-
env_patt = site_config.get('general/valid_env_names') or [r'.*']
478+
env_patt = site_config.get('general/0/valid_env_names') or [r'.*']
479479
part_environs = [
480480
ProgEnvironment(
481481
name=e,

reframe/frontend/cli.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,13 @@ def main():
260260
'-n', '--name', action='append', dest='names', default=[],
261261
metavar='PATTERN', help='Select checks whose name matches PATTERN'
262262
)
263+
264+
# FIXME: The following is the only selection option that has an associated
265+
# (undocumented) configuration variable. This is to support pruning of the
266+
# partition environments as the runtime is created, similarly to how the
267+
# system partitions are treated. Currently, this facilitates the
268+
# implementation of fixtures, but we should reconsider it: see discussion
269+
# in https://github.com/eth-cscs/reframe/issues/2245
263270
select_options.add_argument(
264271
'-p', '--prgenv', action='append', default=[r'.*'], metavar='PATTERN',
265272
configvar='general/valid_env_names',

reframe/frontend/loader.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,35 +171,40 @@ def load_from_module(self, module):
171171
return []
172172

173173
self._set_defaults(registry)
174-
candidates = registry.instantiate_all() if registry else []
175-
legacy_candidates = legacy_registry() if legacy_registry else []
176-
if self._external_vars and legacy_candidates:
174+
test_pool = registry.instantiate_all() if registry else []
175+
legacy_tests = legacy_registry() if legacy_registry else []
176+
if self._external_vars and legacy_tests:
177177
getlogger().warning(
178178
"variables of tests using the deprecated "
179179
"'@parameterized_test' decorator cannot be set externally; "
180180
"please use the 'parameter' builtin in your tests"
181181
)
182182

183183
# Merge registries
184-
candidates += legacy_candidates
184+
test_pool += legacy_tests
185185

186-
# Serialize the fixture registries doing a level-order traversal
186+
# Do a level-order traversal of the fixture registries of all tests in
187+
# the test pool, instantiate all fixtures and generate the final set
188+
# of candidate tests to load; the test pool is consumed at the end of
189+
# the traversal and all instantiated tests (including fixtures) are
190+
# stored in `candidate_tests`.
187191
candidate_tests = []
188192
fixture_registry = FixtureRegistry()
189-
while candidates:
193+
while test_pool:
190194
tmp_registry = FixtureRegistry()
191-
while candidates:
192-
c = candidates.pop()
195+
while test_pool:
196+
c = test_pool.pop()
193197
reg = getattr(c, '_rfm_fixture_registry', None)
194198
candidate_tests.append(c)
195199
if reg:
196200
tmp_registry.update(reg)
197201

198202
# Instantiate the new fixtures and update the registry
199203
new_fixtures = tmp_registry.difference(fixture_registry)
200-
candidates = new_fixtures.instantiate_all()
204+
test_pool = new_fixtures.instantiate_all()
201205
fixture_registry.update(new_fixtures)
202206

207+
# Post-instantiation validation of the candidate tests
203208
tests = []
204209
for c in candidate_tests:
205210
if not isinstance(c, RegressionTest):

0 commit comments

Comments
 (0)