-
Notifications
You must be signed in to change notification settings - Fork 117
Closed
Description
I think it is useful for flexible tests since it avoids caveats like the following:
import reframe as rfm
import reframe.utility.sanity as sn
@rfm.simple_test
class HostnameCheck(rfm.RunOnlyRegressionTest):
def __init__(self):
super().__init__()
self.valid_systems = ['daint', 'dom']
self.valid_prog_environs = ['PrgEnv-cray']
self.executable = 'hostname'
self.sourcesdir = None
self.num_tasks = 0
self.sanity_patterns = sn.assert_eq(
self.num_tasks_assigned,
sn.count(sn.findall(r'nid\d+', self.stdout))
)
@property
@sn.sanity_function
def num_tasks_assigned(self):
return self.job.num_tasksThe test passes fine, but it's missing the num_tasks_per_node = 1, which would have been caught easily if I could replace count with count_uniq:
nid00000
nid00000
nid00000
nid00000
nid00000
nid00000
nid00000
nid00000
nid00001
nid00001
nid00001
nid00001
nid00001
nid00001
nid00001