Skip to content

Commit 64ca7d8

Browse files
committed
Add test for PR 4848 testing modification of preconfigopts
Apply this patch directly to the code without #4848 makes it fail with AssertionError: 'FOO=bar ' != '' - FOO=bar +
1 parent e246ee8 commit 64ca7d8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/framework/easyblock.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,8 @@ def test_handle_iterate_opts(self):
11871187
self.assertEqual(eb.cfg.iterating, True)
11881188
self.assertEqual(eb.cfg.iterate_options, ['configopts'])
11891189
self.assertEqual(eb.cfg['configopts'], "--opt1 --anotheropt")
1190+
# mimic easyblock that changes this in-place
1191+
eb.cfg['preconfigopts'] = "FOO=bar "
11901192
self.assertEqual(eb.iter_opts, expected_iter_opts)
11911193

11921194
# when next iteration is start, iteration index gets bumped
@@ -1198,6 +1200,8 @@ def test_handle_iterate_opts(self):
11981200
self.assertEqual(stdout, "== starting iteration #1 ...\n")
11991201
self.assertEqual(eb.cfg.iterating, True)
12001202
self.assertEqual(eb.cfg.iterate_options, ['configopts'])
1203+
# preconfigopts should have been restored (https://github.com/easybuilders/easybuild-framework/pull/4848)
1204+
self.assertEqual(eb.cfg['preconfigopts'], "")
12011205
self.assertEqual(eb.cfg['configopts'], "--opt2")
12021206
self.assertEqual(eb.iter_opts, expected_iter_opts)
12031207

0 commit comments

Comments
 (0)