Skip to content

Commit ce962e8

Browse files
authored
Fix resolution of -with-tower with TOWER_API_ENDPOINT (#7045)
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
1 parent 6d04c9e commit ce962e8

4 files changed

Lines changed: 24 additions & 8 deletions

File tree

modules/nextflow/src/main/groovy/nextflow/config/ConfigBuilder.groovy

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,6 @@ class ConfigBuilder {
718718
config.tower.enabled = true
719719
if( cmdRun.withTower != '-' )
720720
config.tower.endpoint = cmdRun.withTower
721-
else if( !config.tower.endpoint )
722-
config.tower.endpoint = 'https://api.cloud.seqera.io'
723721
}
724722

725723
// -- set wave options
@@ -729,8 +727,6 @@ class ConfigBuilder {
729727
config.wave.enabled = true
730728
if( cmdRun.withWave != '-' )
731729
config.wave.endpoint = cmdRun.withWave
732-
else if( !config.wave.endpoint )
733-
config.wave.endpoint = 'https://wave.seqera.io'
734730
}
735731

736732
// -- set fusion options

modules/nextflow/src/test/groovy/nextflow/config/ConfigBuilderTest.groovy

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,7 @@ class ConfigBuilderTest extends Specification {
854854
then: // command line should override the config file
855855
config.trace instanceof Map
856856
config.trace.enabled
857+
!config.trace.file
857858
}
858859

859860
def 'should set session report options' () {
@@ -909,6 +910,7 @@ class ConfigBuilderTest extends Specification {
909910
then:
910911
config.report instanceof Map
911912
config.report.enabled
913+
!config.report.file
912914
}
913915

914916

@@ -965,6 +967,7 @@ class ConfigBuilderTest extends Specification {
965967
then:
966968
config.dag instanceof Map
967969
config.dag.enabled
970+
!config.dag.file
968971
}
969972

970973
def 'should set session weblog options' () {
@@ -1083,6 +1086,7 @@ class ConfigBuilderTest extends Specification {
10831086
then:
10841087
config.timeline instanceof Map
10851088
config.timeline.enabled
1089+
!config.timeline.file
10861090
}
10871091

10881092
def 'should set tower options' () {
@@ -1129,7 +1133,7 @@ class ConfigBuilderTest extends Specification {
11291133
then:
11301134
config.tower instanceof Map
11311135
config.tower.enabled
1132-
config.tower.endpoint == 'https://api.cloud.seqera.io'
1136+
!config.tower.endpoint
11331137
}
11341138

11351139
def 'should set wave options' () {
@@ -1176,7 +1180,7 @@ class ConfigBuilderTest extends Specification {
11761180
then:
11771181
config.wave instanceof Map
11781182
config.wave.enabled
1179-
config.wave.endpoint == 'https://wave.seqera.io'
1183+
!config.wave.endpoint
11801184
}
11811185

11821186
def 'should set cloudcache options' () {
@@ -2352,9 +2356,9 @@ class ConfigBuilderTest extends Specification {
23522356

23532357
def 'should return parsed config' () {
23542358
given:
2355-
def cmd = new CmdRun(profile: 'first', withTower: 'http://foo.com', launcher: new Launcher())
23562359
def base = Files.createTempDirectory('test')
2357-
base.resolve('nextflow.config').text = '''
2360+
def configFile = base.resolve('nextflow.config')
2361+
configFile.text = '''
23582362
profiles {
23592363
first {
23602364
params {
@@ -2371,6 +2375,8 @@ class ConfigBuilderTest extends Specification {
23712375
}
23722376
'''
23732377
when:
2378+
def opt = new CliOptions(config: [configFile.toFile().canonicalPath])
2379+
def cmd = new CmdRun(profile: 'first', withTower: 'http://foo.com', launcher: new Launcher(options: opt))
23742380
def txt = ConfigBuilder.resolveConfig(base, cmd)
23752381
then:
23762382
txt == '''\

plugins/nf-tower/src/test/io/seqera/tower/plugin/TowerConfigTest.groovy

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ import spock.lang.Specification
2424
*/
2525
class TowerConfigTest extends Specification {
2626

27+
def 'should use default endpoint when not specified'() {
28+
when:
29+
def config = new TowerConfig([:], [TOWER_API_ENDPOINT: 'https://example.com'])
30+
then:
31+
config.endpoint == 'https://example.com'
32+
33+
when:
34+
config = new TowerConfig([:], [:])
35+
then:
36+
config.endpoint == 'https://api.cloud.seqera.io'
37+
}
38+
2739
def 'should use default timeout values when not specified'() {
2840
when:
2941
def config = new TowerConfig([:], [:])

plugins/nf-wave/src/main/io/seqera/wave/plugin/config/WaveConfig.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ import nextflow.util.Duration
4242
@ToString(includeNames = true, includePackage = false, includeFields = true, useGetters = false)
4343
@CompileStatic
4444
class WaveConfig implements ConfigScope {
45+
4546
final private static String DEF_ENDPOINT = 'https://wave.seqera.io'
47+
4648
final private static List<String> DEF_STRATEGIES = List.of('container','dockerfile','conda')
4749

4850
final BuildOpts build

0 commit comments

Comments
 (0)