Skip to content

Commit 6e4a0e2

Browse files
author
Vasileios Karakasis
committed
Add unit test to reproduce bug GH-2477
1 parent cec5eee commit 6e4a0e2

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

unittests/resources/checks_unlisted/externalvars.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,33 @@
33
import reframe.utility.typecheck as typ
44

55

6+
class Bacon(rfm.RunOnlyRegressionTest):
7+
bacon = variable(int, value=-1)
8+
executable = 'echo'
9+
sanity_patterns = sn.assert_true(1)
10+
11+
12+
class Eggs(rfm.RunOnlyRegressionTest):
13+
eggs = fixture(Bacon)
14+
executable = 'echo'
15+
sanity_patterns = sn.assert_true(1)
16+
17+
618
@rfm.simple_test
719
class external_x(rfm.RunOnlyRegressionTest):
820
valid_systems = ['*']
921
valid_prog_environs = ['*']
1022
foo = variable(int, value=1)
1123
ham = variable(typ.Bool, value=False)
24+
spam = fixture(Eggs)
1225
executable = 'echo'
1326

1427
@sanity_function
1528
def assert_foo(self):
1629
return sn.all([
1730
sn.assert_eq(self.foo, 3),
18-
sn.assert_true(self.ham)
31+
sn.assert_true(self.ham),
32+
sn.assert_eq(self.spam.eggs.bacon, 10)
1933
])
2034

2135

unittests/test_cli.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -837,10 +837,13 @@ def test_detect_host_topology_file(run_reframe, tmp_path):
837837
def test_external_vars(run_reframe):
838838
returncode, stdout, stderr = run_reframe(
839839
checkpath=['unittests/resources/checks_unlisted/externalvars.py'],
840-
more_options=['-S', 'external_x.foo=3', '-S', 'external_y.foo=2',
841-
'-S', 'foolist=3,4', '-S', 'bar=@none',
840+
more_options=['-S', 'external_x.foo=3',
842841
'-S', 'external_x.ham=true',
843-
'-S', 'external_y.baz=false']
842+
'-S', 'external_x.spam.eggs.bacon=10',
843+
'-S', 'external_y.foo=2',
844+
'-S', 'external_y.baz=false',
845+
'-S', 'foolist=3,4',
846+
'-S', 'bar=@none']
844847
)
845848
assert 'Traceback' not in stdout
846849
assert 'Ran 2/2 test case(s)' in stdout

0 commit comments

Comments
 (0)