Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,8 @@ class ConfigBuilder {
.setBaseDir(baseDir)
.buildConfigObject()

// strip params
config.remove('params')
// strip secrets
SecretHelper.hideSecrets(config)
// compute config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2352,35 +2352,36 @@ class ConfigBuilderTest extends Specification {

def 'should return parsed config' () {
given:
def cmd = new CmdRun(profile: 'first', withTower: 'http://foo.com', launcher: new Launcher())
def base = Files.createTempDirectory('test')
base.resolve('nextflow.config').text = '''
def folder = Files.createTempDirectory('test')
def configFile = folder.resolve('nextflow.config')
configFile.text = '''
profiles {
first {
params {
foo = 'Hello world'
awsKey = 'xyz'
foo = 'Hello world'
awsKey = 'xyz'
}
process {
executor = { 'local' }
executor = 'local'
cpus = { 4 }
}
}
second {
params.none = 'Blah'
}
}
'''
and:
def launcher = new Launcher(options: new CliOptions(config: [configFile.toFile().canonicalPath]))
def cmd = new CmdRun(profile: 'first', withTower: 'http://foo.com', launcher: launcher)

when:
def txt = ConfigBuilder.resolveConfig(base, cmd)
def result = ConfigBuilder.resolveConfig(folder, cmd)
then:
txt == '''\
params {
foo = 'Hello world'
awsKey = '[secret]'
}

result == '''\
process {
executor = { 'local' }
executor = 'local'
cpus = { 4 }
}

outputFormat = 'text'
Expand All @@ -2393,7 +2394,7 @@ class ConfigBuilderTest extends Specification {
'''.stripIndent()

cleanup:
base?.deleteDir()
folder?.deleteDir()
}

def 'should merge profiles with conditions' () {
Expand Down Expand Up @@ -2428,7 +2429,7 @@ class ConfigBuilderTest extends Specification {
ext.args = '--quiet'
}
}
params{
params {
another = true
}
'''
Expand Down
Loading