Skip to content

Commit 6de3eb6

Browse files
authored
Merge pull request #4841 from easybuilders/fix_fstring
Fix failing GitHub integration CI tests
2 parents 904b3ba + ca1b12d commit 6de3eb6

File tree

5 files changed

+50
-26
lines changed

5 files changed

+50
-26
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# should be EB_GCC, but OK for testing purposes
2+
easyblock = 'EB_toy'
3+
4+
name = 'GCC'
5+
version = '10.2.0'
6+
7+
homepage = 'https://gcc.gnu.org/'
8+
description = """The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada,
9+
as well as libraries for these languages (libstdc++, libgcj,...)."""
10+
11+
toolchain = SYSTEM
12+
13+
source_urls = [
14+
'http://ftpmirror.gnu.org/%(namelower)s/%(namelower)s-%(version)s', # GCC auto-resolving HTTP mirror
15+
'http://ftpmirror.gnu.org/gmp', # idem for GMP
16+
'http://ftpmirror.gnu.org/mpfr', # idem for MPFR
17+
'http://www.multiprecision.org/mpc/download', # MPC official
18+
]
19+
sources = [SOURCELOWER_TAR_GZ]
20+
21+
22+
# this bundle serves as a compiler-only toolchain, so it should be marked as compiler (important for HMNS)
23+
moduleclass = 'compiler'

test/framework/filetools.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,8 +2271,8 @@ def test_copy_dir(self):
22712271

22722272
ft.copy_dir(to_copy, target_dir, ignore=lambda src, names: [x for x in names if '6.4.0-2.28' in x])
22732273
self.assertExists(target_dir)
2274-
expected = ['GCC-4.6.3.eb', 'GCC-4.6.4.eb', 'GCC-4.8.2.eb', 'GCC-4.8.3.eb', 'GCC-4.9.2.eb', 'GCC-4.9.3-2.25.eb',
2275-
'GCC-4.9.3-2.26.eb', 'GCC-7.3.0-2.30.eb']
2274+
expected = ['GCC-10.2.0.eb', 'GCC-4.6.3.eb', 'GCC-4.6.4.eb', 'GCC-4.8.2.eb', 'GCC-4.8.3.eb', 'GCC-4.9.2.eb',
2275+
'GCC-4.9.3-2.25.eb', 'GCC-4.9.3-2.26.eb', 'GCC-7.3.0-2.30.eb']
22762276
self.assertEqual(sorted(os.listdir(target_dir)), expected)
22772277
# GCC-6.4.0-2.28.eb should not get copied, since it's specified as file too ignore
22782278
self.assertNotExists(os.path.join(target_dir, 'GCC-6.4.0-2.28.eb'))
@@ -2613,7 +2613,7 @@ def test_index_functions(self):
26132613
# test with specified path with and without trailing '/'s
26142614
for path in [test_ecs, test_ecs + '/', test_ecs + '//']:
26152615
index = ft.create_index(path)
2616-
self.assertEqual(len(index), 94)
2616+
self.assertEqual(len(index), 95)
26172617

26182618
expected = [
26192619
os.path.join('b', 'bzip2', 'bzip2-1.0.6-GCC-4.9.2.eb'),
@@ -2663,7 +2663,7 @@ def test_index_functions(self):
26632663
regex = re.compile(r"^== found valid index for %s, so using it\.\.\.$" % ecs_dir)
26642664
self.assertTrue(regex.match(stdout.strip()), "Pattern '%s' matches with: %s" % (regex.pattern, stdout))
26652665

2666-
self.assertEqual(len(index), 25)
2666+
self.assertEqual(len(index), 26)
26672667
for fn in expected:
26682668
self.assertIn(fn, index)
26692669

@@ -2693,7 +2693,7 @@ def test_index_functions(self):
26932693
regex = re.compile(r"^== found valid index for %s, so using it\.\.\.$" % ecs_dir)
26942694
self.assertTrue(regex.match(stdout.strip()), "Pattern '%s' matches with: %s" % (regex.pattern, stdout))
26952695

2696-
self.assertEqual(len(index), 25)
2696+
self.assertEqual(len(index), 26)
26972697
for fn in expected:
26982698
self.assertIn(fn, index)
26992699

test/framework/github.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,9 @@ def test_github_fetch_easyblocks_from_pr(self):
413413
all_ebs_pr3674 = ['llvm.py']
414414

415415
# PR with more than one easyblock
416-
all_ebs_pr3596 = ['wps.py', 'wrf.py']
416+
all_ebs_pr1949 = ['configuremake.py', 'rpackage.py']
417417

418-
for pr, all_ebs in [(1964, all_ebs_pr1964), (3674, all_ebs_pr3674), (3596, all_ebs_pr3596)]:
418+
for pr, all_ebs in [(1964, all_ebs_pr1964), (3674, all_ebs_pr3674), (1949, all_ebs_pr1949)]:
419419
try:
420420
tmpdir = os.path.join(self.test_prefix, 'pr%s' % pr)
421421
with self.mocked_stdout_stderr():

test/framework/options.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3933,7 +3933,7 @@ def test_github_xxx_include_easyblocks_from_pr(self):
39333933

39343934
args = [
39353935
'--include-easyblocks=%s/*.py' % self.test_prefix, # this shouldn't interfere
3936-
'--include-easyblocks-from-pr=3399', # a PR for CMakeMake easyblock
3936+
'--include-easyblocks-from-pr=3677', # a PR for CMakeMake easyblock
39373937
'--list-easyblocks=detailed',
39383938
'--unittest-file=%s' % self.logfile,
39393939
'--github-user=%s' % GITHUB_TEST_ACCOUNT,
@@ -3947,7 +3947,7 @@ def test_github_xxx_include_easyblocks_from_pr(self):
39473947
logtxt = read_file(self.logfile)
39483948

39493949
self.assertFalse(stderr)
3950-
self.assertEqual(stdout, "== easyblock cmakemake.py included from PR #3399\n")
3950+
self.assertEqual(stdout, "== easyblock cmakemake.py included from PR #3677\n")
39513951

39523952
# easyblock included from pr is found
39533953
path_pattern = os.path.join(self.test_prefix, '.*', 'included-easyblocks-.*', 'easybuild', 'easyblocks')
@@ -3977,7 +3977,7 @@ def test_github_xxx_include_easyblocks_from_pr(self):
39773977
# including the same easyblock twice should work and give priority to the one from the PR
39783978
args = [
39793979
'--include-easyblocks=%s/*.py' % self.test_prefix,
3980-
'--include-easyblocks-from-pr=3399',
3980+
'--include-easyblocks-from-pr=3677',
39813981
'--list-easyblocks=detailed',
39823982
'--unittest-file=%s' % self.logfile,
39833983
'--github-user=%s' % GITHUB_TEST_ACCOUNT,
@@ -3991,9 +3991,9 @@ def test_github_xxx_include_easyblocks_from_pr(self):
39913991
logtxt = read_file(self.logfile)
39923992

39933993
expected = "WARNING: One or more easyblocks included from multiple locations: "
3994-
expected += "cmakemake.py (the one(s) from PR #3399 will be used)"
3994+
expected += "cmakemake.py (the one(s) from PR #3677 will be used)"
39953995
self.assertEqual(stderr.strip(), expected)
3996-
self.assertEqual(stdout, "== easyblock cmakemake.py included from PR #3399\n")
3996+
self.assertEqual(stdout, "== easyblock cmakemake.py included from PR #3677\n")
39973997

39983998
# easyblock included from pr is found
39993999
path_pattern = os.path.join(self.test_prefix, '.*', 'included-easyblocks-.*', 'easybuild', 'easyblocks')
@@ -4027,8 +4027,8 @@ def test_github_xxx_include_easyblocks_from_pr(self):
40274027
write_file(self.logfile, '')
40284028

40294029
args = [
4030-
'--from-pr=22227', # PR for Togl easyconfig
4031-
'--include-easyblocks-from-pr=3563,3634', # PRs for ConfigureMake and GROMACS easyblock
4030+
'--from-pr=22589', # PR for DIAMOND easyconfig
4031+
'--include-easyblocks-from-pr=3677,3674', # PRs for CMakeMake and LLVM easyblock
40324032
'--unittest-file=%s' % self.logfile,
40334033
'--github-user=%s' % GITHUB_TEST_ACCOUNT,
40344034
'--extended-dry-run',
@@ -4042,27 +4042,27 @@ def test_github_xxx_include_easyblocks_from_pr(self):
40424042
logtxt = read_file(self.logfile)
40434043

40444044
self.assertFalse(stderr)
4045-
self.assertEqual(stdout, "== easyblock configuremake.py included from PR #3563\n" +
4046-
"== easyblock gromacs.py included from PR #3634\n")
4045+
self.assertEqual(stdout, "== easyblock cmakemake.py included from PR #3677\n" +
4046+
"== easyblock llvm.py included from PR #3674\n")
40474047

40484048
# easyconfig from pr is found
4049-
ec_pattern = os.path.join(self.test_prefix, '.*', 'files_pr22227', 't', 'Togl',
4050-
'Togl-2.0-GCCcore-13.3.0.eb')
4049+
ec_pattern = os.path.join(self.test_prefix, '.*', 'files_pr22589', 'd', 'DIAMOND',
4050+
'DIAMOND-2.1.11-GCC-13.3.0.eb')
40514051
ec_regex = re.compile(r"Parsing easyconfig file %s" % ec_pattern, re.M)
40524052
self.assertTrue(ec_regex.search(logtxt), "Pattern '%s' found in: %s" % (ec_regex.pattern, logtxt))
40534053

40544054
# easyblock included from pr is found
40554055
eb_regex = re.compile(
4056-
r"Derived full easyblock module path for ConfigureMake: easybuild.easyblocks.generic.configuremake", re.M)
4056+
r"Derived full easyblock module path for CMakeMake: easybuild.easyblocks.generic.cmakemake", re.M)
40574057
self.assertTrue(eb_regex.search(logtxt), "Pattern '%s' found in: %s" % (eb_regex.pattern, logtxt))
40584058

40594059
# easyblock is found via get_easyblock_class
4060-
klass = get_easyblock_class('ConfigureMake')
4060+
klass = get_easyblock_class('CMakeMake')
40614061
self.assertTrue(issubclass(klass, EasyBlock), "%s is an EasyBlock derivative class" % klass)
40624062

40634063
# 'undo' import of easyblocks
4064-
del sys.modules['easybuild.easyblocks.gromacs']
4065-
del sys.modules['easybuild.easyblocks.generic.configuremake']
4064+
del sys.modules['easybuild.easyblocks.llvm']
4065+
del sys.modules['easybuild.easyblocks.generic.cmakemake']
40664066
sys.path[:] = orig_local_sys_path
40674067
import easybuild.easyblocks
40684068
reload(easybuild.easyblocks)
@@ -4856,7 +4856,7 @@ def test_github_new_update_pr(self):
48564856
self.assertTrue(regex.search(txt), "Pattern '%s' found in: %s" % (regex.pattern, txt))
48574857

48584858
# modifying an existing easyconfig requires a custom PR title
4859-
gcc_ec = os.path.join(test_ecs, 'g', 'GCC', 'GCC-4.9.2.eb')
4859+
gcc_ec = os.path.join(test_ecs, 'g', 'GCC', 'GCC-10.2.0.eb')
48604860
self.assertExists(gcc_ec)
48614861

48624862
args = [
@@ -5103,7 +5103,7 @@ def test_github_new_pr_delete(self):
51035103

51045104
regexs = [
51055105
r"^== fetching branch 'develop' from https://github.com/easybuilders/easybuild-easyconfigs.git...",
5106-
r'title: "delete {ec_name}"',
5106+
rf'title: "delete {ec_name}"',
51075107
r"1 file(s?) changed,( 0 insertions\(\+\),)? [0-9]+ deletions\(-\)",
51085108
]
51095109
self._assert_regexs(regexs, txt)

test/framework/tweak.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ def test_find_matching_easyconfigs(self):
8080
self.assertTrue(len(ecs) == 1 and ecs[0].endswith('/%s-%s.eb' % (name, installver)))
8181

8282
ecs = find_matching_easyconfigs('GCC', '*', [test_easyconfigs_path])
83-
gccvers = ['4.6.3', '4.6.4', '4.8.2', '4.8.3', '4.9.2', '4.9.3-2.25', '4.9.3-2.26', '6.4.0-2.28', '7.3.0-2.30']
83+
gccvers = ['10.2.0', '4.6.3', '4.6.4', '4.8.2', '4.8.3', '4.9.2', '4.9.3-2.25',
84+
'4.9.3-2.26', '6.4.0-2.28', '7.3.0-2.30']
8485
self.assertEqual(len(ecs), len(gccvers))
8586
ecs_basename = [os.path.basename(ec) for ec in ecs]
8687
for gccver in gccvers:
@@ -127,7 +128,7 @@ def test_obtain_ec_for(self):
127128
}
128129
(generated, ec_file) = obtain_ec_for(specs, [test_easyconfigs_path])
129130
self.assertFalse(generated)
130-
self.assertEqual(os.path.basename(ec_file), 'GCC-7.3.0-2.30.eb')
131+
self.assertEqual(os.path.basename(ec_file), 'GCC-10.2.0.eb')
131132

132133
# generate non-existing easyconfig
133134
change_dir(self.test_prefix)

0 commit comments

Comments
 (0)