@@ -56,6 +56,36 @@ def tearDown(self):
5656 easybuild .tools .build_log .EXPERIMENTAL = self .orig_experimental
5757 super (EasyStackTest , self ).tearDown ()
5858
59+ def test_easystack_basic (self ):
60+ """Test for basic easystack file."""
61+ topdir = os .path .dirname (os .path .abspath (__file__ ))
62+ test_easystack = os .path .join (topdir , 'easystacks' , 'test_easystack_basic.yaml' )
63+
64+ ec_fns , opts = parse_easystack (test_easystack )
65+ expected = [
66+ 'binutils-2.25-GCCcore-4.9.3.eb' ,
67+ 'binutils-2.26-GCCcore-4.9.3.eb' ,
68+ 'foss-2018a.eb' ,
69+ 'toy-0.0-gompi-2018a-test.eb' ,
70+ ]
71+ self .assertEqual (sorted (ec_fns ), sorted (expected ))
72+ self .assertEqual (opts , {})
73+
74+ def test_easystack_easyconfigs (self ):
75+ """Test for easystack file using 'easyconfigs' key."""
76+ topdir = os .path .dirname (os .path .abspath (__file__ ))
77+ test_easystack = os .path .join (topdir , 'easystacks' , 'test_easystack_easyconfigs.yaml' )
78+
79+ ec_fns , opts = parse_easystack (test_easystack )
80+ expected = [
81+ 'binutils-2.25-GCCcore-4.9.3.eb' ,
82+ 'binutils-2.26-GCCcore-4.9.3.eb' ,
83+ 'foss-2018a.eb' ,
84+ 'toy-0.0-gompi-2018a-test.eb' ,
85+ ]
86+ self .assertEqual (sorted (ec_fns ), sorted (expected ))
87+ self .assertEqual (opts , {})
88+
5989 def test_parse_fail (self ):
6090 """Test for clean error when easystack file fails to parse."""
6191 test_yml = os .path .join (self .test_prefix , 'test.yml' )
@@ -120,15 +150,17 @@ def test_easystack_versions(self):
120150 versions = ('1.2.3' , '1.2.30' , '2021a' , '1.2.3' )
121151 for version in versions :
122152 write_file (test_easystack , tmpl_easystack_txt + ' ' + version )
123- ec_fns , _ = parse_easystack (test_easystack )
153+ ec_fns , opts = parse_easystack (test_easystack )
124154 self .assertEqual (ec_fns , ['foo-%s.eb' % version ])
155+ self .assertEqual (opts , {})
125156
126157 # multiple versions as a list
127158 test_easystack_txt = tmpl_easystack_txt + " [1.2.3, 3.2.1]"
128159 write_file (test_easystack , test_easystack_txt )
129- ec_fns , _ = parse_easystack (test_easystack )
160+ ec_fns , opts = parse_easystack (test_easystack )
130161 expected = ['foo-1.2.3.eb' , 'foo-3.2.1.eb' ]
131162 self .assertEqual (sorted (ec_fns ), sorted (expected ))
163+ self .assertEqual (opts , {})
132164
133165 # multiple versions listed with more info
134166 test_easystack_txt = '\n ' .join ([
@@ -139,9 +171,10 @@ def test_easystack_versions(self):
139171 " versionsuffix: -foo" ,
140172 ])
141173 write_file (test_easystack , test_easystack_txt )
142- ec_fns , _ = parse_easystack (test_easystack )
174+ ec_fns , opts = parse_easystack (test_easystack )
143175 expected = ['foo-1.2.3.eb' , 'foo-2021a.eb' , 'foo-3.2.1-foo.eb' ]
144176 self .assertEqual (sorted (ec_fns ), sorted (expected ))
177+ self .assertEqual (opts , {})
145178
146179 # versions that get interpreted by YAML as float or int, single quotes required
147180 for version in ('1.2' , '123' , '3.50' , '100' , '2.44_01' ):
@@ -152,8 +185,9 @@ def test_easystack_versions(self):
152185
153186 # all is fine when wrapping the value in single quotes
154187 write_file (test_easystack , tmpl_easystack_txt + " '" + version + "'" )
155- ec_fns , _ = parse_easystack (test_easystack )
188+ ec_fns , opts = parse_easystack (test_easystack )
156189 self .assertEqual (ec_fns , ['foo-%s.eb' % version ])
190+ self .assertEqual (opts , {})
157191
158192 # one rotten apple in the basket is enough
159193 test_easystack_txt = tmpl_easystack_txt + " [1.2.3, %s, 3.2.1]" % version
@@ -179,9 +213,10 @@ def test_easystack_versions(self):
179213 " versionsuffix: -foo" ,
180214 ])
181215 write_file (test_easystack , test_easystack_txt )
182- ec_fns , _ = parse_easystack (test_easystack )
216+ ec_fns , opts = parse_easystack (test_easystack )
183217 expected = ['foo-1.2.3.eb' , 'foo-%s.eb' % version , 'foo-3.2.1-foo.eb' ]
184218 self .assertEqual (sorted (ec_fns ), sorted (expected ))
219+ self .assertEqual (opts , {})
185220
186221 # also check toolchain version that could be interpreted as a non-string value...
187222 test_easystack_txt = '\n ' .join ([
@@ -192,9 +227,10 @@ def test_easystack_versions(self):
192227 " versions: [1.2.3, '2.3']" ,
193228 ])
194229 write_file (test_easystack , test_easystack_txt )
195- ec_fns , _ = parse_easystack (test_easystack )
230+ ec_fns , opts = parse_easystack (test_easystack )
196231 expected = ['test-1.2.3-intel-2021.03.eb' , 'test-2.3-intel-2021.03.eb' ]
197232 self .assertEqual (sorted (ec_fns ), sorted (expected ))
233+ self .assertEqual (opts , {})
198234
199235
200236def suite ():
0 commit comments