Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion reframe/core/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ def pipeline_hooks(cls):
#:
#: ::
#:
#: self.sanity_patterns = sn.assert_found(r'.*', self.stdout)
#: self.sanity_patterns = sn.assert_true(1)
sanity_patterns = variable(_DeferredExpression, type(None), value=None)

#: Patterns for verifying the performance of this test.
Expand Down
3 changes: 2 additions & 1 deletion reframe/frontend/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def _validate_check(self, check):

name = type(check).__name__
checkfile = os.path.relpath(inspect.getfile(type(check)))
required_attrs = ['valid_systems', 'valid_prog_environs']
required_attrs = ['sanity_patterns',
'valid_systems', 'valid_prog_environs']
for attr in required_attrs:
if getattr(check, attr) is None:
getlogger().warning(
Expand Down
2 changes: 2 additions & 0 deletions unittests/resources/checks/bad/invalid_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
# SPDX-License-Identifier: BSD-3-Clause

import reframe as rfm
import reframe.utility.sanity as sn


@rfm.simple_test
class SomeTest(rfm.RegressionTest):
def __init__(self):
self.valid_systems = []
self.valid_prog_environs = []
self.sanity_patterns = sn.assert_true(1)


class NotATest:
Expand Down
2 changes: 2 additions & 0 deletions unittests/resources/checks/emptycheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
# SPDX-License-Identifier: BSD-3-Clause

import reframe as rfm
import reframe.utility.sanity as sn


@rfm.simple_test
class EmptyTest(rfm.RegressionTest):
def __init__(self):
self.valid_systems = []
self.valid_prog_environs = []
self.sanity_patterns = sn.assert_true(1)
2 changes: 2 additions & 0 deletions unittests/resources/checks/frontend_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ class TestWithGenerator(rfm.RunOnlyRegressionTest):
def __init__(self):
self.valid_systems = ['*']
self.valid_prog_environs = ['*']
self.sanity_patterns = sn.assert_true(1)

def foo():
yield True
Expand All @@ -257,6 +258,7 @@ class TestWithFileObject(rfm.RunOnlyRegressionTest):
def __init__(self):
self.valid_systems = ['*']
self.valid_prog_environs = ['*']
self.sanity_patterns = sn.assert_true(1)
with open(__file__) as fp:
pass

Expand Down
2 changes: 2 additions & 0 deletions unittests/resources/checks_unlisted/good.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#

import reframe as rfm
import reframe.utility.sanity as sn

# We just import this individually for testing purposes
from reframe.core.pipeline import RegressionTest
Expand All @@ -17,6 +18,7 @@ class _Base(RegressionTest):
def __init__(self):
self.valid_systems = ['*']
self.valid_prog_environs = ['*']
self.sanity_patterns = sn.assert_true(1)


@rfm.parameterized_test(*((x, y) for x in range(3) for y in range(2)))
Expand Down
2 changes: 2 additions & 0 deletions unittests/resources/checks_unlisted/kbd_interrupt.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#

import reframe as rfm
import reframe.utility.sanity as sn


@rfm.simple_test
Expand All @@ -21,6 +22,7 @@ def __init__(self):
self.valid_systems = ['*']
self.valid_prog_environs = ['*']
self.tags = {self.name}
self.sanity_patterns = sn.assert_true(1)

@rfm.run_before('setup')
def raise_keyboard_interrupt(self):
Expand Down