Skip to content

Commit bda7909

Browse files
author
Vasileios Karakasis
committed
Merge branch 'feat/module-collections' of github.com:vkarak/reframe into feat/module-collections
2 parents a8f57b0 + a81ba52 commit bda7909

File tree

5 files changed

+56
-9
lines changed

5 files changed

+56
-9
lines changed

JenkinsfileDeploy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ def tag = env.TAG_NAME
22
def version = tag.substring(1) // Remove the first character of the tag which is 'v'
33
def machines = '[dom daint tsa]' // To be included in the PR title
44
def reviewersPR = 'teojgo,vkarak' // The Github usernames requested for review
5-
def ebTemplate = '3.1-dev0' // The eb recipe of ReFrame to use as template
5+
def ebTemplate = '3.3-dev0' // The eb recipe of ReFrame to use as template
66

77
stage('Deploy Tests') {
88
node('daint') {

reframe/core/pipeline.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,8 @@ def _copy_to_stagedir(self, path):
10951095
self.logger.debug(f'Symlinking files: {self.readonly_files}')
10961096
try:
10971097
osext.copytree_virtual(
1098-
path, self._stagedir, self.readonly_files, dirs_exist_ok=True
1098+
path, self._stagedir, self.readonly_files, symlinks=True,
1099+
dirs_exist_ok=True
10991100
)
11001101
except (OSError, ValueError, TypeError) as e:
11011102
raise PipelineError('copying of files failed') from e

reframe/frontend/cli.py

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,25 @@
3333
from reframe.frontend.printer import PrettyPrinter
3434

3535

36-
def format_check(check, detailed=False):
36+
def format_check(check, check_deps, detailed=False):
3737
def fmt_list(x):
3838
if not x:
3939
return '<none>'
4040

4141
return ', '.join(x)
4242

43+
def fmt_deps():
44+
no_deps = True
45+
lines = []
46+
for t, deps in check_deps:
47+
for d in deps:
48+
lines.append(f'- {t} -> {d}')
49+
50+
if lines:
51+
return '\n '.join(lines)
52+
else:
53+
return '<none>'
54+
4355
location = inspect.getfile(type(check))
4456
if not detailed:
4557
return f'- {check.name} (found in {location!r})'
@@ -52,7 +64,6 @@ def fmt_list(x):
5264
node_alloc_scheme = f'flexible (minimum {-check.num_tasks} task(s))'
5365

5466
check_info = {
55-
'Dependencies': fmt_list([d[0] for d in check.user_deps()]),
5667
'Description': check.descr,
5768
'Environment modules': fmt_list(check.modules),
5869
'Location': location,
@@ -64,14 +75,18 @@ def fmt_list(x):
6475
},
6576
'Tags': fmt_list(check.tags),
6677
'Valid environments': fmt_list(check.valid_prog_environs),
67-
'Valid systems': fmt_list(check.valid_systems)
78+
'Valid systems': fmt_list(check.valid_systems),
79+
'Dependencies (conceptual)': fmt_list(
80+
[d[0] for d in check.user_deps()]
81+
),
82+
'Dependencies (actual)': fmt_deps()
6883
}
6984
lines = [f'- {check.name}:']
7085
for prop, val in check_info.items():
7186
lines.append(f' {prop}:')
7287
if isinstance(val, dict):
7388
for k, v in val.items():
74-
lines.append(f' {k}: {v}')
89+
lines.append(f' - {k}: {v}')
7590
else:
7691
lines.append(f' {val}')
7792

@@ -88,9 +103,19 @@ def format_env(envvars):
88103
return ret
89104

90105

91-
def list_checks(checks, printer, detailed=False):
106+
def list_checks(testcases, printer, detailed=False):
92107
printer.info('[List of matched checks]')
93-
printer.info('\n'.join(format_check(c, detailed) for c in checks))
108+
109+
# Collect dependencies per test
110+
deps = {}
111+
for t in testcases:
112+
deps.setdefault(t.check.name, [])
113+
deps[t.check.name].append((t, t.deps))
114+
115+
checks = set(t.check for t in testcases)
116+
printer.info(
117+
'\n'.join(format_check(c, deps[c.name], detailed) for c in checks)
118+
)
94119
printer.info(f'Found {len(checks)} check(s)')
95120

96121

@@ -715,7 +740,7 @@ def print_infoline(param, value):
715740
# Act on checks
716741
success = True
717742
if options.list or options.list_detailed:
718-
list_checks(checks_matched, printer, options.list_detailed)
743+
list_checks(testcases, printer, options.list_detailed)
719744
elif options.run:
720745
# Setup the execution policy
721746
if options.exec_policy == 'serial':
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hello.sh

unittests/test_pipeline.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,26 @@ def __init__(self):
217217
_run(test, *local_exec_ctx)
218218

219219

220+
def test_run_only_preserve_symlinks(local_exec_ctx):
221+
@fixtures.custom_prefix('unittests/resources/checks')
222+
class MyTest(rfm.RunOnlyRegressionTest):
223+
def __init__(self):
224+
self.executable = './hello.sh.link'
225+
self.executable_opts = ['Hello, World!']
226+
self.local = True
227+
self.valid_prog_environs = ['*']
228+
self.valid_systems = ['*']
229+
self.sanity_patterns = sn.assert_found(
230+
r'Hello, World\!', self.stdout
231+
)
232+
233+
@rfm.run_after('run')
234+
def check_symlinks(self):
235+
assert os.path.islink(os.path.join(self.stagedir, 'hello.sh.link'))
236+
237+
_run(MyTest(), *local_exec_ctx)
238+
239+
220240
def test_compile_only_failure(local_exec_ctx):
221241
@fixtures.custom_prefix('unittests/resources/checks')
222242
class MyTest(rfm.CompileOnlyRegressionTest):

0 commit comments

Comments
 (0)