Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarak committed Jul 7, 2023
2 parents fb385e1 + 3d2fb4d commit b1d4de3
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 20 deletions.
3 changes: 2 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
archspec==0.2.1
docutils==0.17.1 # https://github.com/sphinx-doc/sphinx/issues/9001
jsonschema==3.2.0
semver==3.0.1
semver==2.13.0; python_version == '3.6'
semver==3.0.1; python_version >= '3.7'
Sphinx==5.3.0
sphinx-rtd-theme==1.2.2
2 changes: 1 addition & 1 deletion reframe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import sys

VERSION = '4.4.0-dev.0'
VERSION = '4.4.0-dev.1'
INSTALL_PREFIX = os.path.normpath(
os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
)
Expand Down
3 changes: 2 additions & 1 deletion reframe/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ def _merge_config_sections(self, target, other):
entry = functools.reduce(
lambda l, r: l.update(r) or l, optionset
)
entry['target_systems'] = [system]
entry.setdefault('target_systems', [])
entry['target_systems'].append(system)
ret.append(entry)

return ret
Expand Down
20 changes: 14 additions & 6 deletions reframe/core/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@ class TestRegistry:
and the constructor arguments for the different instantiations of the
test are stored as the dictionary value as a list of (args, kwargs)
tuples.
For backward compatibility reasons, the registry also contains a set of
tests to be skipped. The machinery related to this should be dropped with
the ``required_version`` decorator.
'''

def __init__(self):
self._tests = dict()
self._tests = {}
self._unset_vars = {}

@property
def unset_vars(self):
return self._unset_vars

@classmethod
def create(cls, test, *args, **kwargs):
Expand All @@ -85,6 +86,10 @@ def instantiate_all(self, reset_sysenv=0, external_vars=None):
:param reset_sysenv: Reset valid_systems and valid_prog_environs after
instantiating the tests. Bit 0 resets the valid_systems, bit 1
resets the valid_prog_environs.
:param external_vars: Test variables to set in the instantiated
fixtures.
'''

# We first instantiate the leaf tests and then walk up their
Expand Down Expand Up @@ -118,6 +123,7 @@ def instantiate_all(self, reset_sysenv=0, external_vars=None):
# candidate tests; the leaf tests are consumed at the end of the
# traversal and all instantiated tests (including fixtures) are stored
# in `final_tests`.
unset_vars = {}
final_tests = []
fixture_registry = FixtureRegistry()
while leaf_tests:
Expand All @@ -132,7 +138,9 @@ def instantiate_all(self, reset_sysenv=0, external_vars=None):
# Instantiate the new fixtures and update the registry
new_fixtures = tmp_registry.difference(fixture_registry)
if external_vars:
_setvars(new_fixtures.uninst_tests(), external_vars)
self._unset_vars.update(
_setvars(new_fixtures.uninst_tests(), external_vars)
)

leaf_tests = new_fixtures.instantiate_all()
fixture_registry.update(new_fixtures)
Expand Down
8 changes: 7 additions & 1 deletion reframe/core/schedulers/oar.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,16 @@ def poll(self, *jobs):
jobinfo = {}

# Typical oarstat -fj <job_id> output:
#
# https://github.com/oar-team/oar/blob/0fccc4fc3bb86ee935ce58effc5aec514a3e155d/sources/core/qfunctions/oarstat#L310
#
# Update 2023-07: oarstat now supports multiple types of output,
# once containing `id: XXX` and once containing `Job_Id: XXX`
#
# https://github.com/oar-team/oar/blob/37db5384c7827cca2d334e5248172bb700015434/sources/core/qfunctions/oarstat#L332
job_raw_info = completed.stdout
jobid_match = re.search(
r'^Job_Id:\s*(?P<jobid>\S+)', completed.stdout, re.MULTILINE
r'^(Job_Id|id):\s*(?P<jobid>\S+)', completed.stdout, re.MULTILINE
)
if jobid_match:
jobid = jobid_match.group('jobid')
Expand Down
19 changes: 10 additions & 9 deletions reframe/frontend/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,15 +1069,6 @@ def print_infoline(param, value):
f'{len(testcases)} remaining'
)

# Warn on any unset test variables for the final set of selected tests
for clsname in {type(tc.check).__name__ for tc in testcases}:
varlist = ', '.join(f'{v!r}' for v in loader.unset_vars(clsname))
if varlist:
printer.warning(
f'test {clsname!r}: '
f'the following variables were not set: {varlist}'
)

# Filter in failed cases
if options.failed:
if options.restore_session is None:
Expand Down Expand Up @@ -1195,6 +1186,16 @@ def _sort_testcases(testcases):
)
printer.verbose(f'Final number of test cases: {len(testcases)}')

# Warn on any unset test variables for the final set of selected tests
# including any dependencies
for clsname in {type(tc.check).__name__ for tc in testcases}:
varlist = ', '.join(f'{v!r}' for v in loader.unset_vars(clsname))
if varlist:
printer.warning(
f'test {clsname!r}: '
f'the following variables were not set: {varlist}'
)

# Disable hooks
for tc in testcases:
for h in options.hooks:
Expand Down
1 change: 1 addition & 0 deletions reframe/frontend/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def load_from_module(self, module):
if registry:
candidate_tests = registry.instantiate_all(reset_sysenv,
self._external_vars)
self._unset_vars.update(registry.unset_vars)
else:
candidate_tests = []

Expand Down
2 changes: 1 addition & 1 deletion tutorials/cscs-webinar-2022/config/mysettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{
'name': 'tresa',
'descr': 'My laptop',
'hostnames': ['tresa\.local'],
'hostnames': ['tresa\.local', 'tresa'],
'partitions': [
{
'name': 'default',
Expand Down

0 comments on commit b1d4de3

Please sign in to comment.