33from pathlib import Path
44from typing import Dict , List , Union
55
6- from nf_core .utils import load_tools_config , run_cmd
6+ from nf_core .utils import load_tools_config
77
88log = logging .getLogger (__name__ )
99
@@ -124,26 +124,6 @@ def nf_test_content(self) -> Dict[str, List[str]]:
124124 # Content of nextflow.config file
125125 conf_fn = Path (self .wf_path , "tests" , "nextflow.config" )
126126
127- # Get the CPU, memory and time values defined in the test profile configuration.
128- cmd = f"config -profile test -flat { self .wf_path } "
129- result = run_cmd ("nextflow" , cmd )
130- config_values = {"cpus" : "4" , "memory" : "15.GB" , "time" : "1.h" }
131- if result is not None :
132- stdout , _ = result
133- for config_line in stdout .splitlines ():
134- ul = config_line .decode ("utf-8" )
135- try :
136- k , v = ul .split (" = " , 1 )
137- if k == "cpus" :
138- config_values ["cpus" ] = v .strip ("'\" " )
139- elif k == "memory" :
140- config_values ["memory" ] = v .strip ("'\" " )
141- elif k == "time" :
142- config_values ["time" ] = v .strip ("'\" " )
143- except ValueError :
144- log .debug (f"Couldn't find key=value config pair:\n { ul } " )
145- pass
146-
147127 config_checks : Dict [str , Dict [str , str ]] = {
148128 "modules_testdata_base_path" : {
149129 "pattern" : "modules_testdata_base_path" ,
@@ -153,18 +133,6 @@ def nf_test_content(self) -> Dict[str, List[str]]:
153133 "pattern" : "pipelines_testdata_base_path" ,
154134 "description" : "`pipelines_testdata_base_path`" ,
155135 },
156- "cpus" : {
157- "pattern" : f"cpus: *[\" ']?{ config_values ['cpus' ]} [\" ']?" ,
158- "description" : f"correct CPU resource limits. Should be { config_values ['cpus' ]} " ,
159- },
160- "memory" : {
161- "pattern" : f"memory: *[\" ']?{ config_values ['memory' ]} [\" ']?" ,
162- "description" : f"correct memory resource limits. Should be { config_values ['memory' ]} " ,
163- },
164- "time" : {
165- "pattern" : f"time: *[\" ']?{ config_values ['time' ]} [\" ']?" ,
166- "description" : f"correct time resource limits. Should be { config_values ['time' ]} " ,
167- },
168136 }
169137
170138 if nf_test_content_conf is None or str (conf_fn .relative_to (self .wf_path )) not in nf_test_content_conf :
0 commit comments