File tree Expand file tree Collapse file tree
test/groovy/nextflow/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -406,7 +406,7 @@ class CmdRun extends CmdBase implements HubOptions {
406406 final isTowerEnabled = config. navigate(' tower.enabled' ) as Boolean
407407 final isDataEnabled = config. navigate(" lineage.enabled" ) as Boolean
408408 if ( isTowerEnabled || isDataEnabled || log. isTraceEnabled() )
409- runner. session. resolvedConfig = ConfigBuilder . resolveConfig(scriptFile. parent, this )
409+ runner. session. resolvedConfig = ConfigBuilder . resolveConfig(scriptFile. parent, this , cliParams )
410410 // note config files are collected during the build process
411411 // this line should be after `ConfigBuilder#build`
412412 runner. session. configFiles = builder. parsedConfigFiles
Original file line number Diff line number Diff line change @@ -919,13 +919,14 @@ class ConfigBuilder {
919919 }
920920 }
921921
922- static String resolveConfig (Path baseDir , CmdRun cmdRun ) {
922+ static String resolveConfig (Path baseDir , CmdRun cmdRun , Map cliParams ) {
923923
924924 final config = new ConfigBuilder ()
925925 .setShowClosures(true )
926926 .setStripSecrets(true )
927927 .setOptions(cmdRun. launcher. options)
928928 .setCmdRun(cmdRun)
929+ .setCliParams(cliParams)
929930 .setBaseDir(baseDir)
930931 .buildConfigObject()
931932
Original file line number Diff line number Diff line change @@ -2410,9 +2410,9 @@ class ConfigBuilderTest extends Specification {
24102410
24112411 def ' should return parsed config' () {
24122412 given :
2413- def cmd = new CmdRun (profile : ' first' , withTower : ' http://foo.com' , launcher : new Launcher ())
24142413 def base = Files . createTempDirectory(' test' )
2415- base. resolve(' nextflow.config' ). text = '''
2414+ def configFile = base. resolve(' nextflow.config' )
2415+ configFile. text = '''
24162416 profiles {
24172417 first {
24182418 params {
@@ -2422,25 +2422,31 @@ class ConfigBuilderTest extends Specification {
24222422 process {
24232423 executor = { 'local' }
24242424 }
2425+ outputDir = params.outdir
24252426 }
24262427 second {
24272428 params.none = 'Blah'
24282429 }
24292430 }
24302431 '''
24312432 when :
2432- def txt = ConfigBuilder . resolveConfig(base, cmd)
2433+ def opt = new CliOptions (config : [configFile. toFile(). canonicalPath])
2434+ def cmd = new CmdRun (profile : ' first' , withTower : ' http://foo.com' , launcher : new Launcher (options : opt))
2435+ def cliParams = [foo : ' Hola' , outdir : ' output_folder' ]
2436+ def txt = ConfigBuilder . resolveConfig(base, cmd, cliParams)
24332437 then :
24342438 txt == ''' \
24352439 params {
2436- foo = 'Hello world '
2440+ foo = 'Hola '
24372441 awsKey = '[secret]'
2442+ outdir = 'output_folder'
24382443 }
24392444
24402445 process {
24412446 executor = { 'local' }
24422447 }
24432448
2449+ outputDir = 'output_folder'
24442450 workDir = 'work'
24452451
24462452 tower {
You can’t perform that action at this time.
0 commit comments