@@ -6605,6 +6605,49 @@ def test_easystack_opts(self):
66056605 self .assertTrue (build_option ('force' ))
66066606 self .assertEqual (build_option ('robot' ), [robot_paths , self .test_prefix ])
66076607
6608+ def test_easystack_easyconfigs_cache (self ):
6609+ """
6610+ Test for easystack file that specifies same easyconfig twice,
6611+ but from a different location.
6612+ """
6613+ topdir = os .path .abspath (os .path .dirname (__file__ ))
6614+ libtoy_ec = os .path .join (topdir , 'easyconfigs' , 'test_ecs' , 'l' , 'libtoy' , 'libtoy-0.0.eb' )
6615+ toy_ec = os .path .join (topdir , 'easyconfigs' , 'test_ecs' , 't' , 'toy' , 'toy-0.0.eb' )
6616+
6617+ test_ec = os .path .join (self .test_prefix , 'toy-0.0.eb' )
6618+ test_ec_txt = read_file (toy_ec )
6619+ test_ec_txt += "\n dependencies = [('libtoy', '0.0')]"
6620+ write_file (test_ec , test_ec_txt )
6621+
6622+ test_subdir = os .path .join (self .test_prefix , 'deps' )
6623+ mkdir (test_subdir , parents = True )
6624+ copy_file (libtoy_ec , test_subdir )
6625+
6626+ test_es_txt = '\n ' .join ([
6627+ "easyconfigs:" ,
6628+ " - toy-0.0" ,
6629+ " - toy-0.0:" ,
6630+ " options:" ,
6631+ " robot: %s:%s" % (test_subdir , self .test_prefix ),
6632+ ])
6633+ test_es_path = os .path .join (self .test_prefix , 'test.yml' )
6634+ write_file (test_es_path , test_es_txt )
6635+
6636+ args = [
6637+ '--experimental' ,
6638+ '--easystack' , test_es_path ,
6639+ '--dry-run' ,
6640+ '--robot=%s' % self .test_prefix ,
6641+ ]
6642+ stdout = self .eb_main (args , do_build = True , raise_error = True , redo_init_config = False )
6643+
6644+ # check whether libtoy-0.0.eb comes from 2nd
6645+ regex = re .compile (r"^ \* \[ \] %s" % libtoy_ec , re .M )
6646+ self .assertTrue (regex .search (stdout ), "Pattern '%s' should be found in: %s" % (regex .pattern , stdout ))
6647+
6648+ regex = re .compile (r"^ \* \[ \] %s" % os .path .join (test_subdir , 'libtoy-0.0.eb' ), re .M )
6649+ self .assertTrue (regex .search (stdout ), "Pattern '%s' should be found in: %s" % (regex .pattern , stdout ))
6650+
66086651 def test_set_up_configuration (self ):
66096652 """Tests for set_up_configuration function."""
66106653
0 commit comments