File tree Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -2278,3 +2278,22 @@ def test_workspace_no_empty_workloads(request):
22782278 data = f .read ()
22792279 assert "basic:" not in data
22802280 assert "workloads: {}" not in data
2281+
2282+
2283+ def test_no_inherit_active_workspace_variants (request ):
2284+ workspace1_name = f"{ request .node .name } _1"
2285+ workspace2_name = f"{ request .node .name } _2"
2286+
2287+ global_args = ["-w" , workspace1_name ]
2288+
2289+ workspace ("create" , workspace1_name )
2290+ config ("add" , "variants:package_manager:spack" , global_args = global_args )
2291+ config ("add" , "variants:workflow_manager:slurm" , global_args = global_args )
2292+
2293+ workspace ("create" , workspace2_name , global_args = global_args )
2294+
2295+ with ramble .workspace .read (workspace2_name ) as ws2 :
2296+ with open (ws2 .config_file_path ) as f :
2297+ data = f .read ()
2298+ assert "spack" not in data
2299+ assert "slurm" not in data
Original file line number Diff line number Diff line change @@ -602,10 +602,17 @@ def _default_config_yaml(self):
602602
603603 # Construct string for default variants
604604 variant_string = ""
605- variant_dict = ramble .config .get ("variants" )
606- variant_defs = []
607605
608- for var , val in variant_dict .items ():
606+ all_variants = {}
607+ for scope in ramble .config .scopes ():
608+ if "workspace" not in scope :
609+ variant_dict = ramble .config .get ("variants" , scope = scope )
610+
611+ for var , val in variant_dict .items ():
612+ all_variants [var ] = val
613+
614+ variant_defs = []
615+ for var , val in all_variants .items ():
609616 variant_defs .append (f" { var } : { val } " )
610617
611618 if variant_defs :
You can’t perform that action at this time.
0 commit comments