@@ -1927,7 +1927,7 @@ def test_github_from_pr(self):
19271927
19281928 # make sure that *only* these modules are listed, no others
19291929 regex = re .compile (r"^ \* \[.\] .*/(?P<filepath>.*) \(module: (?P<module>.*)\)$" , re .M )
1930- self .assertTrue (sorted (regex .findall (outtxt )), sorted (modules ))
1930+ self .assertEqual (sorted (x [ 1 ] for x in regex .findall (outtxt )), sorted (x [ 1 ] for x in modules ))
19311931
19321932 pr_tmpdir = os .path .join (tmpdir , r'eb-\S{6,8}' , 'files_pr6424' )
19331933 regex = re .compile (r"Extended list of robot search paths with \['%s'\]:" % pr_tmpdir , re .M )
@@ -1962,12 +1962,12 @@ def test_github_from_pr(self):
19621962
19631963 # make sure that *only* these modules are listed, no others
19641964 regex = re .compile (r"^ \* \[.\] .*/(?P<filepath>.*) \(module: (?P<module>.*)\)$" , re .M )
1965- self .assertTrue (sorted (regex .findall (outtxt )), sorted (modules ))
1965+ self .assertEqual (sorted (x [ 1 ] for x in regex .findall (outtxt )), sorted (x [ 1 ] for x in modules ))
19661966
19671967 for pr in ('12150' , '12366' ):
19681968 pr_tmpdir = os .path .join (tmpdir , r'eb-\S{6,8}' , 'files_pr%s' % pr )
19691969 regex = re .compile (r"Extended list of robot search paths with .*%s.*:" % pr_tmpdir , re .M )
1970- self .assertTrue (regex .search (outtxt ), "Found pattern %s in %s" % (regex .pattern , outtxt ))
1970+ self .assertTrue (regex .search (outtxt ), "Found pattern '%s' in: %s" % (regex .pattern , outtxt ))
19711971
19721972 except URLError as err :
19731973 print ("Ignoring URLError '%s' in test_from_pr" % err )
@@ -2144,6 +2144,50 @@ def test_from_commit(self):
21442144 print ("Ignoring URLError '%s' in test_from_commit" % err )
21452145 shutil .rmtree (tmpdir )
21462146
2147+ easyblock_template = '\n ' .join ([
2148+ "from easybuild.framework.easyblock import EasyBlock" ,
2149+ "class %s(EasyBlock):" ,
2150+ " pass" ,
2151+ ])
2152+
2153+ # create fake custom easyblock for CMake that is required by easyconfig used in test below
2154+ easyblock_file = os .path .join (self .test_prefix , 'easyblocks' , 'cmake.py' )
2155+ write_file (easyblock_file , easyblock_template % 'EB_CMake' )
2156+
2157+ # also test with an easyconfig that requires additional easyconfigs to resolve dependencies,
2158+ # cfr. https://github.com/easybuilders/easybuild-framework/issues/4540;
2159+ # using commit that adds CMake-3.18.4.eb (which requires ncurses-6.2.eb),
2160+ # see https://github.com/easybuilders/easybuild-easyconfigs/pull/13156
2161+ test_commit = '41eee3fe2e5102f52319481ca8dde16204dab590'
2162+ args = [
2163+ '--from-commit=%s' % test_commit ,
2164+ '--dry-run' ,
2165+ '--tmpdir=%s' % tmpdir ,
2166+ '--include-easyblocks=' + os .path .join (self .test_prefix , 'easyblocks' , '*.py' ),
2167+ ]
2168+ try :
2169+ outtxt = self .eb_main (args , logfile = dummylogfn , raise_error = True )
2170+ modules = [
2171+ (tmpdir , 'ncurses/6.2' ),
2172+ (tmpdir , 'CMake/3.18.4' ),
2173+ ]
2174+ for path_prefix , module in modules :
2175+ ec_fn = "%s.eb" % '-' .join (module .split ('/' ))
2176+ path = '.*%s' % os .path .dirname (path_prefix )
2177+ regex = re .compile (r"^ \* \[.\] %s.*%s \(module: %s\)$" % (path , ec_fn , module ), re .M )
2178+ self .assertTrue (regex .search (outtxt ), "Found pattern %s in %s" % (regex .pattern , outtxt ))
2179+
2180+ # make sure that *only* these modules are listed, no others
2181+ regex = re .compile (r"^ \* \[.\] .*/(?P<filepath>.*) \(module: (?P<module>.*)\)$" , re .M )
2182+ self .assertEqual (sorted (x [1 ] for x in regex .findall (outtxt )), sorted (x [1 ] for x in modules ))
2183+
2184+ pr_tmpdir = os .path .join (tmpdir , r'eb-\S{6,8}' , 'files_commit_%s' % test_commit )
2185+ regex = re .compile (r"Extended list of robot search paths with \['%s'\]:" % pr_tmpdir , re .M )
2186+ self .assertTrue (regex .search (outtxt ), "Found pattern %s in %s" % (regex .pattern , outtxt ))
2187+ except URLError as err :
2188+ print ("Ignoring URLError '%s' in test_from_commit" % err )
2189+ shutil .rmtree (tmpdir )
2190+
21472191 # must be run after test for --list-easyblocks, hence the '_xxx_'
21482192 # cleaning up the imported easyblocks is quite difficult...
21492193 def test_xxx_include_easyblocks_from_commit (self ):
0 commit comments