Skip to content

Commit 99188bf

Browse files
author
Vasileios Karakasis
authored
Merge branch 'master' into feat/queuing-timeout
2 parents bb3a026 + a32e677 commit 99188bf

File tree

12 files changed

+120
-47
lines changed

12 files changed

+120
-47
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
dist: xenial
22
language: python
33
python:
4-
- "3.5"
54
- "3.6"
65
- "3.7"
76
- "3.8"

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'}

docs/started.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ Getting Started
55
Requirements
66
------------
77

8-
* Python 3.5 or higher. Python 2 is not supported.
8+
* Python 3.6 or higher. Python 2 is not supported.
99

1010
.. note::
1111
.. versionchanged:: 2.8
1212
A functional TCL modules system is no more required. ReFrame can now operate without a modules system at all.
1313

14+
.. note::
15+
.. versionchanged:: 3.0
16+
Support for Python 3.5 has been dropped.
17+
1418
Optional
1519
~~~~~~~~
1620

reframe/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
VERSION = '3.0-dev2'
1111
INSTALL_PREFIX = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
12-
MIN_PYTHON_VERSION = (3, 5, 0)
12+
MIN_PYTHON_VERSION = (3, 6, 0)
1313

1414
# Check python version
1515
if sys.version_info[:3] < MIN_PYTHON_VERSION:

reframe/core/pipeline.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,10 @@ def __new__(cls, *args, **kwargs):
682682
try:
683683
prefix = cls._rfm_custom_prefix
684684
except AttributeError:
685-
prefix = os.path.abspath(os.path.dirname(inspect.getfile(cls)))
685+
if os_ext.is_interactive():
686+
prefix = os.getcwd()
687+
else:
688+
prefix = os.path.abspath(os.path.dirname(inspect.getfile(cls)))
686689

687690
obj._rfm_init(name, prefix)
688691
return obj
@@ -1517,6 +1520,7 @@ def compile_wait(self):
15171520
This is a no-op for this type of test.
15181521
'''
15191522

1523+
@_run_hooks('pre_run')
15201524
def run(self):
15211525
'''The run phase of the regression test pipeline.
15221526
@@ -1530,7 +1534,7 @@ def run(self):
15301534
self._copy_to_stagedir(os.path.join(self._prefix,
15311535
self.sourcesdir))
15321536

1533-
super().run()
1537+
super().run.__wrapped__(self)
15341538

15351539

15361540
class CompileOnlyRegressionTest(RegressionTest):
@@ -1550,6 +1554,7 @@ def _rfm_init(self, *args, **kwargs):
15501554
super()._rfm_init(*args, **kwargs)
15511555
self.local = True
15521556

1557+
@_run_hooks()
15531558
def setup(self, partition, environ, **job_opts):
15541559
'''The setup stage of the regression test pipeline.
15551560

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.'''

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
jsonschema
2-
pytest>=3.5.0
2+
pytest>=5.0.0
33
coverage
44
setuptools

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
scripts=['bin/reframe'],
2626
classifiers=(
2727
'Development Status :: 5 - Production/Stable',
28-
'Programming Language :: Python :: 3.5',
2928
'Programming Language :: Python :: 3.6',
3029
'Programming Language :: Python :: 3.7',
3130
'Programming Language :: Python :: 3.8',
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2016-2020 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
2+
# ReFrame Project Developers. See the top-level LICENSE file for details.
3+
#
4+
# SPDX-License-Identifier: BSD-3-Clause
5+
6+
#
7+
# Check for testing handling of the TERM signal
8+
#
9+
import os
10+
import signal
11+
import time
12+
13+
import reframe as rfm
14+
import reframe.utility.sanity as sn
15+
16+
17+
@rfm.simple_test
18+
class SelfKillCheck(rfm.RunOnlyRegressionTest):
19+
def __init__(self):
20+
self.local = True
21+
self.valid_systems = ['*']
22+
self.valid_prog_environs = ['*']
23+
self.executable = 'echo hello'
24+
self.sanity_patterns = sn.assert_found('hello', self.stdout)
25+
self.tags = {type(self).__name__}
26+
self.maintainers = ['TM']
27+
28+
def run(self):
29+
super().run()
30+
time.sleep(0.5)
31+
os.kill(os.getpid(), signal.SIGTERM)

unittests/test_pipeline.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,30 @@ def postfoo(self):
457457
assert '_RFM_PRE_SETUP' in os.environ
458458
assert '_RFM_POST_SETUP' in os.environ
459459

460+
def test_setup_hooks_in_compile_only_test(self):
461+
@fixtures.custom_prefix('unittests/resources/checks')
462+
class MyTest(rfm.CompileOnlyRegressionTest):
463+
def __init__(self):
464+
self.name = 'hellocheck_compile'
465+
self.valid_systems = ['*']
466+
self.valid_prog_environs = ['*']
467+
self.sourcepath = 'hello.c'
468+
self.executable = os.path.join('.', self.name)
469+
self.sanity_patterns = sn.assert_found('.*', self.stdout)
470+
self.count = 0
471+
472+
@rfm.run_before('setup')
473+
def presetup(self):
474+
self.count += 1
475+
476+
@rfm.run_after('setup')
477+
def postsetup(self):
478+
self.count += 1
479+
480+
test = MyTest()
481+
_run(test, self.partition, self.prgenv)
482+
assert test.count == 2
483+
460484
def test_compile_hooks(self):
461485
@fixtures.custom_prefix('unittests/resources/checks')
462486
class MyTest(HelloTest):
@@ -498,6 +522,26 @@ def check_executable(self):
498522
test = MyTest()
499523
_run(test, self.partition, self.prgenv)
500524

525+
def test_run_hooks_in_run_only_test(self):
526+
@fixtures.custom_prefix('unittests/resources/checks')
527+
class MyTest(rfm.RunOnlyRegressionTest):
528+
def __init__(self):
529+
self.executable = 'echo'
530+
self.executable_opts = ['Hello, World!']
531+
self.local = True
532+
self.valid_prog_environs = ['*']
533+
self.valid_systems = ['*']
534+
self.sanity_patterns = sn.assert_found(
535+
r'Hello, World\!', self.stdout)
536+
537+
@rfm.run_before('run')
538+
def check_empty_stage(self):
539+
# Make sure nothing has been copied to the stage directory yet
540+
assert len(os.listdir(self.stagedir)) == 0
541+
542+
test = MyTest()
543+
_run(test, self.partition, self.prgenv)
544+
501545
def test_multiple_hooks(self):
502546
@fixtures.custom_prefix('unittests/resources/checks')
503547
class MyTest(HelloTest):

0 commit comments

Comments
 (0)