Skip to content

Commit 076eda0

Browse files
author
Vasileios Karakasis
authored
Merge branch 'master' into enhancement/add_logo_readme
2 parents 1ff9011 + d17ff88 commit 076eda0

File tree

11 files changed

+193
-132
lines changed

11 files changed

+193
-132
lines changed

config/cscs-ci.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class ReframeSettings:
172172
'prefix': '%(check_system)s/%(check_partition)s',
173173
'level': 'INFO',
174174
'format': (
175-
'%(asctime)s|reframe %(version)s|'
175+
'%(check_job_completion_time)s|reframe %(version)s|'
176176
'%(check_info)s|jobid=%(check_jobid)s|'
177177
'num_tasks=%(check_num_tasks)s|'
178178
'%(check_perf_var)s=%(check_perf_value)s|'
@@ -181,6 +181,7 @@ class ReframeSettings:
181181
'u=%(check_perf_upper_thres)s)|'
182182
'%(check_perf_unit)s'
183183
),
184+
'datefmt': '%FT%T%:z',
184185
'append': True
185186
}
186187
]

config/cscs-pbs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,15 @@ class ReframeSettings:
137137
'prefix': '%(check_system)s/%(check_partition)s',
138138
'level': 'INFO',
139139
'format': (
140-
'%(asctime)s|reframe %(version)s|'
140+
'%(check_job_completion_time)s|reframe %(version)s|'
141141
'%(check_info)s|jobid=%(check_jobid)s|'
142142
'num_tasks=%(check_num_tasks)s|'
143143
'%(check_perf_var)s=%(check_perf_value)s|'
144144
'ref=%(check_perf_ref)s '
145145
'(l=%(check_perf_lower_thres)s, '
146146
'u=%(check_perf_upper_thres)s)'
147147
),
148+
'datefmt': '%FT%T%:z',
148149
'append': True
149150
}
150151
]

config/cscs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ class ReframeSettings:
623623
'prefix': '%(check_system)s/%(check_partition)s',
624624
'level': 'INFO',
625625
'format': (
626-
'%(asctime)s|reframe %(version)s|'
626+
'%(check_job_completion_time)s|reframe %(version)s|'
627627
'%(check_info)s|jobid=%(check_jobid)s|'
628628
'num_tasks=%(check_num_tasks)s|'
629629
'%(check_perf_var)s=%(check_perf_value)s|'
@@ -632,6 +632,7 @@ class ReframeSettings:
632632
'u=%(check_perf_upper_thres)s)|'
633633
'%(check_perf_unit)s'
634634
),
635+
'datefmt': '%FT%T%:z',
635636
'append': True
636637
}
637638
]

config/tiger.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,15 @@ class ReframeSettings:
144144
'prefix': '%(check_system)s/%(check_partition)s',
145145
'level': 'INFO',
146146
'format': (
147-
'%(asctime)s|reframe %(version)s|'
147+
'%(check_job_completion_time)s|reframe %(version)s|'
148148
'%(check_info)s|jobid=%(check_jobid)s|'
149149
'%(check_perf_var)s=%(check_perf_value)s|'
150150
'ref=%(check_perf_ref)s '
151151
'(l=%(check_perf_lower_thres)s, '
152152
'u=%(check_perf_upper_thres)s)|'
153153
'%(check_perf_unit)s'
154154
),
155+
'datefmt': '%FT%T%:z',
155156
'append': True
156157
}
157158
]

reframe/core/pipeline.py

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ class RegressionTest(metaclass=RegressionTestMeta):
202202
#: taken.
203203
#:
204204
#: :type: :class:`str` or :class:`None`
205-
#: :default: ``'src'``
205+
#: :default: ``'src'`` if such a directory exists at the test level,
206+
#: otherwise ``None``
206207
#:
207208
#: .. note::
208209
#: .. versionchanged:: 2.9
@@ -211,6 +212,10 @@ class RegressionTest(metaclass=RegressionTestMeta):
211212
#:
212213
#: .. versionchanged:: 2.10
213214
#: Support for Git repositories was added.
215+
#:
216+
#: .. versionchanged:: 3.0
217+
#: Default value is now conditionally set to either ``'src'`` or
218+
#: :class:`None`.
214219
sourcesdir = fields.TypedField('sourcesdir', str, type(None))
215220

216221
#: The build system to be used for this test.
@@ -661,8 +666,13 @@ def __new__(cls, *args, **kwargs):
661666
itertools.chain(args, kwargs.values()))
662667
name += '_' + '_'.join(arg_names)
663668

664-
obj._rfm_init(name,
665-
os.path.abspath(os.path.dirname(inspect.getfile(cls))))
669+
# Determine the prefix
670+
try:
671+
prefix = cls._rfm_custom_prefix
672+
except AttributeError:
673+
prefix = os.path.abspath(os.path.dirname(inspect.getfile(cls)))
674+
675+
obj._rfm_init(name, prefix)
666676
return obj
667677

668678
def __init__(self):
@@ -706,10 +716,11 @@ def _rfm_init(self, name=None, prefix=None):
706716
self.local = False
707717

708718
# Static directories of the regression check
709-
if prefix is not None:
710-
self._prefix = os.path.abspath(prefix)
711-
712-
self.sourcesdir = 'src'
719+
self._prefix = os.path.abspath(prefix)
720+
if os.path.isdir(os.path.join(self._prefix, 'src')):
721+
self.sourcesdir = 'src'
722+
else:
723+
self.sourcesdir = None
713724

714725
# Output patterns
715726
self.sanity_patterns = None

reframe/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,15 @@ class ReframeSettings:
8686
'prefix': '%(check_system)s/%(check_partition)s',
8787
'level': 'INFO',
8888
'format': (
89-
'%(asctime)s|reframe %(version)s|'
89+
'%(check_job_completion_time)s|reframe %(version)s|'
9090
'%(check_info)s|jobid=%(check_jobid)s|'
9191
'%(check_perf_var)s=%(check_perf_value)s|'
9292
'ref=%(check_perf_ref)s '
9393
'(l=%(check_perf_lower_thres)s, '
9494
'u=%(check_perf_upper_thres)s)|'
9595
'%(check_perf_unit)s'
9696
),
97+
'datefmt': '%FT%T%:z',
9798
'append': True
9899
}
99100
]

schemas/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,15 @@
166166
'prefix': '%(check_system)s/%(check_partition)s',
167167
'level': 'info',
168168
'format': (
169-
'%(asctime)s|reframe %(version)s|'
169+
'%(check_job_completion_time)s|reframe %(version)s|'
170170
'%(check_info)s|jobid=%(check_jobid)s|'
171171
'%(check_perf_var)s=%(check_perf_value)s|'
172172
'ref=%(check_perf_ref)s '
173173
'(l=%(check_perf_lower_thres)s, '
174174
'u=%(check_perf_upper_thres)s)|'
175175
'%(check_perf_unit)s'
176176
),
177+
'datefmt': '%FT%T%:z',
177178
'append': True
178179
}
179180
]

tutorial/config/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,14 @@ class ReframeSettings:
120120
'prefix': '%(check_system)s/%(check_partition)s',
121121
'level': 'INFO',
122122
'format': (
123-
'%(asctime)s|reframe %(version)s|'
123+
'%(check_job_completion_time)s|reframe %(version)s|'
124124
'%(check_info)s|jobid=%(check_jobid)s|'
125125
'%(check_perf_var)s=%(check_perf_value)s|'
126126
'ref=%(check_perf_ref)s '
127127
'(l=%(check_perf_lower_thres)s, '
128128
'u=%(check_perf_upper_thres)s)'
129129
),
130+
'datefmt': '%FT%T%:z',
130131
'append': True
131132
}
132133
]

unittests/fixtures.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,16 @@ def partition_with_scheduler(name=None, skip_partitions=['kesch:pn']):
8686
def has_sane_modules_system():
8787
return not isinstance(rt.runtime().modules_system.backend,
8888
modules.NoModImpl)
89+
90+
91+
def custom_prefix(prefix):
92+
'''Assign a custom prefix to a test.
93+
94+
This is useful in unit tests when we want to create tests on-the-fly and
95+
associate them with existing resources.'''
96+
97+
def _set_prefix(cls):
98+
cls._rfm_custom_prefix = prefix
99+
return cls
100+
101+
return _set_prefix

unittests/resources/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,15 @@ class ReframeSettings:
154154
'prefix': '%(check_system)s/%(check_partition)s',
155155
'level': 'INFO',
156156
'format': (
157-
'%(asctime)s|reframe %(version)s|'
157+
'%(check_job_completion_time)s|reframe %(version)s|'
158158
'%(check_info)s|jobid=%(check_jobid)s|'
159159
'%(check_perf_var)s=%(check_perf_value)s|'
160160
'ref=%(check_perf_ref)s '
161161
'(l=%(check_perf_lower_thres)s, '
162162
'u=%(check_perf_upper_thres)s)|'
163163
'%(check_perf_unit)s'
164164
),
165+
'datefmt': '%FT%T%:z',
165166
'append': True
166167
}
167168
]

0 commit comments

Comments
 (0)