Skip to content

Commit 6abc2f4

Browse files
author
Vasileios Karakasis
authored
Merge branch 'master' into bugfix/sigterm_unittest
2 parents 3083c52 + ed2cfbe commit 6abc2f4

File tree

4 files changed

+26
-7
lines changed

4 files changed

+26
-7
lines changed

cscs-checks/apps/namd/namd_check.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ def __init__(self, scale, variant):
7272
if scale == 'small':
7373
self.valid_systems += ['dom:gpu']
7474
self.reference = {
75-
'dom:gpu': {'days_ns': (0.18, None, 0.05, 'days/ns')},
76-
'daint:gpu': {'days_ns': (0.18, None, 0.05, 'days/ns')}
75+
'dom:gpu': {'days_ns': (0.15, None, 0.05, 'days/ns')},
76+
'daint:gpu': {'days_ns': (0.15, None, 0.05, 'days/ns')}
7777
}
7878
else:
7979
self.reference = {
80-
'daint:gpu': {'days_ns': (0.11, None, 0.05, 'days/ns')}
80+
'daint:gpu': {'days_ns': (0.07, None, 0.05, 'days/ns')}
8181
}
8282

8383

@@ -94,12 +94,12 @@ def __init__(self, scale, variant):
9494
if scale == 'small':
9595
self.valid_systems += ['dom:mc']
9696
self.reference = {
97-
'dom:mc': {'days_ns': (0.57, None, 0.05, 'days/ns')},
98-
'daint:mc': {'days_ns': (0.56, None, 0.05, 'days/ns')}
97+
'dom:mc': {'days_ns': (0.51, None, 0.05, 'days/ns')},
98+
'daint:mc': {'days_ns': (0.51, None, 0.05, 'days/ns')}
9999
}
100100
else:
101101
self.reference = {
102-
'daint:mc': {'days_ns': (0.38, None, 0.05, 'days/ns')}
102+
'daint:mc': {'days_ns': (0.28, None, 0.05, 'days/ns')}
103103
}
104104

105105
self.tags |= {'maintenance' if variant == 'maint' else 'production'}

reframe/core/pipeline.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,10 @@ def __new__(cls, *args, **kwargs):
670670
try:
671671
prefix = cls._rfm_custom_prefix
672672
except AttributeError:
673-
prefix = os.path.abspath(os.path.dirname(inspect.getfile(cls)))
673+
if os_ext.is_interactive():
674+
prefix = os.getcwd()
675+
else:
676+
prefix = os.path.abspath(os.path.dirname(inspect.getfile(cls)))
674677

675678
obj._rfm_init(name, prefix)
676679
return obj

reframe/utility/os_ext.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,11 @@ def inpath(entry, pathvar):
227227
return entry in set(pathvar.split(':'))
228228

229229

230+
def is_interactive():
231+
'''Returns whether the given Python session is interactive'''
232+
return hasattr(sys, 'ps1') or sys.flags.interactive
233+
234+
230235
def subdirs(dirname, recurse=False):
231236
'''Returns a list of dirname + its subdirectories. If recurse is True,
232237
recursion is performed in pre-order.'''

unittests/test_utility.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,17 @@ def test_samefile(self):
173173
os.path.join(prefix, 'broken1'))
174174
shutil.rmtree(prefix)
175175

176+
# FIXME: This should be changed in order to use the `monkeypatch`
177+
# fixture of `pytest` instead of creating an instance of `MonkeyPatch`
178+
def test_is_interactive(self):
179+
from _pytest.monkeypatch import MonkeyPatch # noqa: F401, F403
180+
181+
monkey = MonkeyPatch()
182+
with monkey.context() as c:
183+
# Set `sys.ps1` to immitate an interactive session
184+
c.setattr(sys, 'ps1', 'rfm>>> ', raising=False)
185+
assert os_ext.is_interactive()
186+
176187
def test_is_url(self):
177188
repo_https = 'https://github.com/eth-cscs/reframe.git'
178189
repo_ssh = '[email protected]:eth-cscs/reframe.git'

0 commit comments

Comments
 (0)