Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
cdc4082
Version bump to 4.x
Mar 9, 2021
88d76d1
Merge branch 'master' into 4.x
Mar 10, 2021
909dbf1
Merge branch 'master' into 4.x
Mar 16, 2021
806cd3c
Merge branch 'master' into 4.x
Mar 24, 2021
89231b4
Merge branch 'master' into 4.x
Apr 6, 2021
f1f0747
Merge branch 'master' into 4.x
Apr 26, 2021
1f495c6
Remove @parameterized_test decorator
Apr 26, 2021
6858d6d
Remove unused imports
Apr 26, 2021
1276baa
Merge pull request #1951 from vkarak/feat/drop-parameterized-test-deco
Apr 27, 2021
08aa419
Merge branch 'master' into 4.x
May 25, 2021
f2d8e60
Merge branch '4.x' of github.com:eth-cscs/reframe into 4.x
May 25, 2021
37c559b
Remove deprecated features in 4.x
May 25, 2021
1f28ca2
Remove unused imports
May 25, 2021
bfa84c2
Merge pull request #1986 from vkarak/feat/remove-deprecated-feats
May 26, 2021
d2c12f1
Merge branch 'master' into 4.x
Jul 23, 2021
35c8ed4
Remove old `how` syntax
Jul 23, 2021
1afc67c
Remove references to parameterized_decorator from the docs
Jul 23, 2021
1e5e66c
Remove obsolete decorators
Jul 23, 2021
9bb8a62
Remove support for old version strings
Jul 23, 2021
0b20efa
Remove unused imports
Jul 23, 2021
47c2758
Remove unused imports
Jul 23, 2021
44c1f33
Address PR comments
Jul 24, 2021
bcbdc52
Address PR comments
Jul 26, 2021
1335b8f
Merge pull request #2096 from vkarak/feat/remove-4.x-deprecated-feats
Jul 27, 2021
8410f87
Merge branch 'master' into 4.x
Aug 11, 2021
3bdf410
Fix unit tests
Aug 11, 2021
357b37e
Remove unused imports
Aug 11, 2021
df97adf
Merge branch 'master' into 4.x
Oct 29, 2021
27e9b15
Fix merge of docs
Oct 29, 2021
7ff09cf
Merge branch 'master' into 4.x
Nov 16, 2021
5ef4641
Merge branch 'master' into 4.x
Feb 25, 2022
3e98aa3
Remove unused imports
Feb 25, 2022
003f3e1
Merge branch 'master' into 4.x
Jun 21, 2022
629d9e1
Merge branch 'master' into 4.x
Jul 12, 2022
5daf963
Fix unit test failures
Jul 12, 2022
41cecc4
Remove unused imports
Jul 12, 2022
f0e824b
Reset 4.0 dev version
Jul 12, 2022
e182d18
Merge branch 'master' into 4.x
Aug 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions docs/deferrable_functions_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,5 @@ List of deferrable functions and utilities
do_sth()


.. py:decorator:: reframe.utility.sanity.sanity_function(func)

Please use the :func:`reframe.core.pipeline.RegressionMixin.deferrable` decorator when possible. Alternatively, please use the :func:`reframe.utility.sanity.deferrable` decorator instead.

.. warning:: Not to be mistaken with :func:`~reframe.core.pipeline.RegressionMixin.sanity_function` built-in.
.. deprecated:: 3.8.0


.. automodule:: reframe.utility.sanity
:members:
50 changes: 3 additions & 47 deletions docs/regression_test_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ Test Base Classes
Test Decorators
---------------

.. autodecorator:: reframe.core.decorators.parameterized_test(*inst)

.. autodecorator:: reframe.core.decorators.required_version(*versions)

.. autodecorator:: reframe.core.decorators.simple_test


Expand Down Expand Up @@ -151,6 +147,9 @@ In the following example, :func:`BaseTest.x` will execute before :func:`DerivedT
Declaring pipeline hooks using the same name functions from the :py:mod:`reframe` or :py:mod:`reframe.core.decorators` modules is now deprecated.
You should use the builtin functions described in the :ref:`builtins` section..

.. versionchanged:: 4.0.0
Pipeline hooks can only be defined through the built-in functions described in this section.

.. warning::
.. versionchanged:: 3.9.2

Expand Down Expand Up @@ -317,49 +316,6 @@ The :py:mod:`reframe` module offers direct access to the basic test classes, con

See :class:`reframe.core.pipeline.RunOnlyRegressionTest`.

.. py:attribute:: reframe.DEPEND_BY_ENV

See :attr:`reframe.core.pipeline.DEPEND_BY_ENV`.


.. py:attribute:: reframe.DEPEND_EXACT

See :attr:`reframe.core.pipeline.DEPEND_EXACT`.


.. py:attribute:: reframe.DEPEND_FULLY

See :attr:`reframe.core.pipeline.DEPEND_FULLY`.


.. py:decorator:: reframe.parameterized_test

See :func:`@reframe.core.decorators.parameterized_test <reframe.core.decorators.parameterized_test>`.


.. py:decorator:: reframe.require_deps

.. deprecated:: 3.7.0
Please use the :func:`@require_deps <reframe.core.builtins.require_deps>` builtin decorator.


.. py:decorator:: reframe.required_version

See :func:`@reframe.core.decorators.required_version <reframe.core.decorators.required_version>`.


.. py:decorator:: reframe.run_after

.. deprecated:: 3.7.0
Please use the :func:`~reframe.core.builtins.run_after` built-in function


.. py:decorator:: reframe.run_before

.. deprecated:: 3.7.0
Please use the :func:`~reframe.core.builtins.run_before` built-in function


.. py:decorator:: reframe.simple_test

See :func:`@reframe.core.decorators.simple_test <reframe.core.decorators.simple_test>`.
Expand Down
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 = '3.13.0-dev.0'
VERSION = '4.0.0-dev.0'
INSTALL_PREFIX = os.path.normpath(
os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
)
Expand Down
38 changes: 0 additions & 38 deletions reframe/core/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import abc

import reframe.core.fields as fields
import reframe.core.warnings as warn
import reframe.utility as util
import reframe.utility.typecheck as typ

Expand Down Expand Up @@ -39,21 +38,6 @@ class ContainerPlatform(abc.ABC):
#: :default: :class:`None`
command = fields.TypedField(str, type(None))

_commands = fields.TypedField(typ.List[str])
#: The commands to be executed within the container.
#:
#: .. deprecated:: 3.5.0
#: Please use the `command` field instead.
#:
#: :type: :class:`list[str]`
#: :default: ``[]``
commands = fields.DeprecatedField(
_commands,
'The `commands` field is deprecated, please use the `command` field '
'to set the command to be executed by the container.',
fields.DeprecatedField.OP_SET, from_version='3.5.0'
)

#: Pull the container image before running.
#:
#: This does not have any effect for the `Singularity` container platform.
Expand Down Expand Up @@ -97,11 +81,6 @@ class ContainerPlatform(abc.ABC):
def __init__(self):
self.image = None
self.command = None

# NOTE: Here we set the target fields directly to avoid the deprecation
# warnings
self._commands = []

self.workdir = _STAGEDIR_MOUNT
self.mount_points = []
self.options = []
Expand Down Expand Up @@ -156,11 +135,6 @@ def create_from(cls, name, other):
new.options = other.options
new.pull_image = other.pull_image
new.workdir = other.workdir

# Update deprecated fields
with warn.suppress_deprecations():
new.commands = other.commands

return new

@property
Expand Down Expand Up @@ -193,10 +167,6 @@ def launch_command(self, stagedir):
return (f'docker run --rm {" ".join(run_opts)} '
f'{self.image} {self.command}')

if self.commands:
return (f"docker run --rm {' '.join(run_opts)} {self.image} "
f"bash -c '{'; '.join(self.commands)}'")

return f'docker run --rm {" ".join(run_opts)} {self.image}'


Expand Down Expand Up @@ -241,10 +211,6 @@ def launch_command(self, stagedir):
return (f'{self._command} run {" ".join(run_opts)} {self.image} '
f'{self.command}')

if self.commands:
return (f"{self._command} run {' '.join(run_opts)} {self.image} "
f"bash -c '{'; '.join(self.commands)}'")

return f'{self._command} run {" ".join(run_opts)} {self.image}'


Expand Down Expand Up @@ -296,10 +262,6 @@ def launch_command(self, stagedir):
return (f'singularity exec {" ".join(run_opts)} '
f'{self.image} {self.command}')

if self.commands:
return (f"singularity exec {' '.join(run_opts)} {self.image} "
f"bash -c '{'; '.join(self.commands)}'")

return f'singularity run {" ".join(run_opts)} {self.image}'


Expand Down
200 changes: 1 addition & 199 deletions reframe/core/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
# Decorators used for the definition of tests
#

__all__ = [
'parameterized_test', 'simple_test', 'required_version',
'require_deps', 'run_before', 'run_after'
]
__all__ = ['simple_test']


import collections
Expand All @@ -19,8 +16,6 @@
import traceback

import reframe.utility.osext as osext
import reframe.core.warnings as warn
import reframe.core.hooks as hooks
from reframe.core.exceptions import ReframeSyntaxError, SkipTestError, what
from reframe.core.fixtures import FixtureRegistry
from reframe.core.logging import getlogger, time_function
Expand Down Expand Up @@ -229,196 +224,3 @@ def simple_test(cls):
_register_test(cls, variant_num=n)

return cls


def parameterized_test(*inst):
'''Class decorator for registering multiple instantiations of a test class.

The decorated class must derive from
:class:`reframe.core.pipeline.RegressionTest`. This decorator is also
available directly under the :mod:`reframe` module.

:arg inst: The different instantiations of the test. Each instantiation
argument may be either a sequence or a mapping.

.. versionadded:: 2.13

.. note::
This decorator does not instantiate any test. It only registers them.
The actual instantiation happens during the loading phase of the test.

.. deprecated:: 3.6.0

Please use the :func:`~reframe.core.pipeline.RegressionTest.parameter`
built-in instead.

'''

warn.user_deprecation_warning(
'the @parameterized_test decorator is deprecated; '
'please use the parameter() built-in instead',
from_version='3.6.0'
)

def _do_register(cls):
if _validate_test(cls):
if not cls.param_space.is_empty():
raise ReframeSyntaxError(
f'{cls.__qualname__!r} is already a parameterized test'
)

for args in inst:
_register_parameterized_test(cls, args)

return cls

return _do_register


def required_version(*versions):
'''Class decorator for specifying the required ReFrame versions for the
following test.

If the test is not compatible with the current ReFrame version it will be
skipped.

:arg versions: A list of ReFrame version specifications that this test is
allowed to run. A version specification string can have one of the
following formats:

1. ``VERSION``: Specifies a single version.
2. ``{OP}VERSION``, where ``{OP}`` can be any of ``>``, ``>=``, ``<``,
``<=``, ``==`` and ``!=``. For example, the version specification
string ``'>=3.5.0'`` will allow the following test to be loaded only
by ReFrame 3.5.0 and higher. The ``==VERSION`` specification is the
equivalent of ``VERSION``.
3. ``V1..V2``: Specifies a range of versions.

You can specify multiple versions with this decorator, such as
``@required_version('3.5.1', '>=3.5.6')``, in which case the test will be
selected if *any* of the versions is satisfied, even if the versions
specifications are conflicting.

.. versionadded:: 2.13

.. versionchanged:: 3.5.0

Passing ReFrame version numbers that do not comply with the `semantic
versioning <https://semver.org/>`__ specification is deprecated.
Examples of non-compliant version numbers are ``3.5`` and ``3.5-dev0``.
These should be written as ``3.5.0`` and ``3.5.0-dev.0``.

.. deprecated:: 3.5.0
Please set the ``require_version`` parameter in the class definition
instead.

'''
warn.user_deprecation_warning(
"the '@required_version' decorator is deprecated; please set "
"the 'require_version' parameter in the class definition instead",
from_version='3.7.0'
)

if not versions:
raise ReframeSyntaxError('no versions specified')

conditions = [VersionValidator(v) for v in versions]

def _skip_tests(cls):
mod = inspect.getmodule(cls)
if not hasattr(mod, '__rfm_skip_tests'):
mod.__rfm_skip_tests = set()

if not hasattr(mod, '_rfm_test_registry'):
mod._rfm_test_registry = TestRegistry()

if not any(c.validate(osext.reframe_version()) for c in conditions):
getlogger().warning(
f"skipping incompatible test '{cls.__qualname__}': not valid "
f"for ReFrame version {osext.reframe_version().split('-')[0]}"
)
if cls in mod._rfm_test_registry:
mod._rfm_test_registry.skip(cls)
else:
mod.__rfm_skip_tests.add(cls)

return cls

return _skip_tests


# Valid pipeline stages that users can specify in the `run_before()` and
# `run_after()` decorators
_USER_PIPELINE_STAGES = (
'init', 'setup', 'compile', 'run', 'sanity', 'performance', 'cleanup'
)


def run_before(stage):
'''Decorator for attaching a test method to a pipeline stage.

.. deprecated:: 3.7.0
Please use the :func:`~reframe.core.pipeline.RegressionMixin.run_before`
built-in function.

'''
warn.user_deprecation_warning(
'using the @rfm.run_before decorator from the rfm module is '
'deprecated; please use the built-in decorator @run_before instead.',
from_version='3.7.0'
)
if stage not in _USER_PIPELINE_STAGES:
raise ReframeSyntaxError(
f'invalid pipeline stage specified: {stage!r}')

if stage == 'init':
raise ReframeSyntaxError('pre-init hooks are not allowed')

return hooks.attach_to('pre_' + stage)


def run_after(stage):
'''Decorator for attaching a test method to a pipeline stage.

.. deprecated:: 3.7.0
Please use the :func:`~reframe.core.pipeline.RegressionMixin.run_after`
built-in function.

'''
warn.user_deprecation_warning(
'using the @rfm.run_after decorator from the rfm module is '
'deprecated; please use the built-in decorator @run_after instead.',
from_version='3.7.0'
)
if stage not in _USER_PIPELINE_STAGES:
raise ReframeSyntaxError(
f'invalid pipeline stage specified: {stage!r}')

# Map user stage names to the actual pipeline functions if needed
if stage == 'init':
stage = '__init__'
elif stage == 'compile':
stage = 'compile_wait'
elif stage == 'run':
stage = 'run_wait'

return hooks.attach_to('post_' + stage)


def require_deps(fn):
'''Decorator to denote that a function will use the test dependencies.

.. versionadded:: 2.21

.. deprecated:: 3.7.0
Please use the
:func:`~reframe.core.pipeline.RegressionTest.require_deps` built-in
function.

'''
warn.user_deprecation_warning(
'using the @rfm.require_deps decorator from the rfm module is '
'deprecated; please use the built-in decorator @require_deps instead.',
from_version='3.7.0'
)
return hooks.require_deps(fn)
Loading