Skip to content

Commit 0a21974

Browse files
author
Theofilos Manitaras
committed
Address PR comments
1 parent 841a08a commit 0a21974

File tree

3 files changed

+15
-33
lines changed

3 files changed

+15
-33
lines changed

docs/migration_2_to_3.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ Pipeline methods and hooks
6565

6666
ReFrame 2.20 introduced a new powerful mechanism for attaching arbitrary functions hooks at the different pipeline stages.
6767
This mechanism provides an easy way to configure and extend the functionality of a test, eliminating essentially the need to override pipeline stages for this purpose.
68-
ReFrame 3.0 deprecates the old practice of overriding pipeline stage methods in favor of using pipeline hooks.
69-
From ReFrame 3.4, overriding pipeline stage methods is no longer allowed.
68+
ReFrame 3.0 deprecates the old practice of overriding pipeline stage methods in favor of using pipeline hooks and ReFrame 3.4 disables that by default.
7069
In the old syntax, it was quite common to override the ``setup()`` method, in order to configure your test based on the current programming environment or the current system partition.
7170
The following is a typical example of that:
7271

@@ -94,7 +93,7 @@ Alternatively, this example could have been written as follows:
9493
self.build_system.cflags = ['-qopenmp']
9594
9695
97-
This syntax is no longer valid and a ``ReframeSyntaxError`` is raised.
96+
This syntax is no longer valid and it will raise a deprecation warning for ReFrame versions >= 3.0 and a reframe syntax error for versions >=3.4.
9897
Rewriting this using pipeline hooks is quite straightforward and leads to nicer and more intuitive code:
9998

10099
.. code:: python
@@ -112,7 +111,7 @@ However, you can't attach this function *before* the "setup" phase, because the
112111

113112
.. warning::
114113
.. versionchanged:: 3.4
115-
Overriding a pipeline stage method is no longer allowed and a ``ReframeSyntaxError`` is raised.
114+
Overriding a pipeline stage method is no longer allowed and a reframe syntax error is raised.
116115

117116

118117
--------------------------------
@@ -130,7 +129,7 @@ In this case, all you have to do is mark your test class as "special", and ReFra
130129
super().setup(partition, environ, **job_opts)
131130
132131
133-
If you try to override the ``setup()`` method in any of the subclasses of ``MyExtendedTest``, will again result in a ``ReframeSyntaxError``, which a desired behavior since the subclasses should be normal tests.
132+
If you try to override the ``setup()`` method in any of the subclasses of ``MyExtendedTest``, it will again result in a reframe syntax error, which is a desired behavior since the subclasses should be normal tests.
134133

135134

136135
Getting schedulers and launchers by name

reframe/core/pipeline.py

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import reframe.utility.sanity as sn
3131
import reframe.utility.typecheck as typ
3232
import reframe.utility.udeps as udeps
33-
from reframe.core.backends import (getlauncher, getscheduler)
33+
from reframe.core.backends import getlauncher, getscheduler
3434
from reframe.core.buildsystems import BuildSystemField
3535
from reframe.core.containers import ContainerPlatformField
3636
from reframe.core.deferrable import _DeferredExpression
@@ -1093,8 +1093,7 @@ def setup(self, partition, environ, **job_opts):
10931093
more details.
10941094
10951095
.. versionchanged:: 3.4
1096-
Overriding this method directly unless you are in
1097-
special test. See `here
1096+
Overriding this method directly in no longer allowed. See `here
10981097
<migration_2_to_3.html#force-override-a-pipeline-method>`__ for
10991098
more details.
11001099
@@ -1140,8 +1139,7 @@ def compile(self):
11401139
more details.
11411140
11421141
.. versionchanged:: 3.4
1143-
Overriding this method directly unless you are in
1144-
special test. See `here
1142+
Overriding this method directly in no longer allowed. See `here
11451143
<migration_2_to_3.html#force-override-a-pipeline-method>`__ for
11461144
more details.
11471145
@@ -1243,8 +1241,7 @@ def compile_wait(self):
12431241
more details.
12441242
12451243
.. versionchanged:: 3.4
1246-
Overriding this method directly unless you are in
1247-
special test. See `here
1244+
Overriding this method directly in no longer allowed. See `here
12481245
<migration_2_to_3.html#force-override-a-pipeline-method>`__ for
12491246
more details.
12501247
@@ -1272,8 +1269,7 @@ def run(self):
12721269
more details.
12731270
12741271
.. versionchanged:: 3.4
1275-
Overriding this method directly unless you are in
1276-
special test. See `here
1272+
Overriding this method directly in no longer allowed. See `here
12771273
<migration_2_to_3.html#force-override-a-pipeline-method>`__ for
12781274
more details.
12791275
@@ -1384,8 +1380,7 @@ def run_complete(self):
13841380
13851381
13861382
.. versionchanged:: 3.4
1387-
Overriding this method directly unless you are in
1388-
special test. See `here
1383+
Overriding this method directly in no longer allowed. See `here
13891384
<migration_2_to_3.html#force-override-a-pipeline-method>`__ for
13901385
more details.
13911386
@@ -1420,13 +1415,10 @@ def run_wait(self):
14201415
more details.
14211416
14221417
.. versionchanged:: 3.4
1423-
Overriding this method directly unless you are in
1424-
special test. See `here
1418+
Overriding this method directly in no longer allowed. See `here
14251419
<migration_2_to_3.html#force-override-a-pipeline-method>`__ for
14261420
more details.
14271421
1428-
1429-
14301422
'''
14311423
self._job.wait()
14321424

@@ -1469,13 +1461,10 @@ def check_sanity(self):
14691461
more details.
14701462
14711463
.. versionchanged:: 3.4
1472-
Overriding this method directly unless you are in
1473-
special test. See `here
1464+
Overriding this method directly in no longer allowed. See `here
14741465
<migration_2_to_3.html#force-override-a-pipeline-method>`__ for
14751466
more details.
14761467
1477-
1478-
14791468
'''
14801469
if rt.runtime().get_option('general/0/trap_job_errors'):
14811470
sanity_patterns = [
@@ -1510,13 +1499,10 @@ def check_performance(self):
15101499
more details.
15111500
15121501
.. versionchanged:: 3.4
1513-
Overriding this method directly unless you are in
1514-
special test. See `here
1502+
Overriding this method directly in no longer allowed. See `here
15151503
<migration_2_to_3.html#force-override-a-pipeline-method>`__ for
15161504
more details.
15171505
1518-
1519-
15201506
'''
15211507
if self.perf_patterns is None:
15221508
return
@@ -1636,13 +1622,10 @@ def cleanup(self, remove_files=False):
16361622
more details.
16371623
16381624
.. versionchanged:: 3.4
1639-
Overriding this method directly unless you are in
1640-
special test. See `here
1625+
Overriding this method directly in no longer allowed. See `here
16411626
<migration_2_to_3.html#force-override-a-pipeline-method>`__ for
16421627
more details.
16431628
1644-
1645-
16461629
'''
16471630
aliased = os.path.samefile(self._stagedir, self._outputdir)
16481631
if aliased:

unittests/test_loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pytest
88

99
import reframe as rfm
10-
from reframe.core.exceptions import (NameConflictError, ReframeSyntaxError)
10+
from reframe.core.exceptions import NameConflictError, ReframeSyntaxError
1111
from reframe.frontend.loader import RegressionCheckLoader
1212

1313

0 commit comments

Comments
 (0)