Skip to content

Commit b105b0e

Browse files
committed
Fix two minor issues
1. Rename variable due to existing variable with same name. 2. Specify parameter type as string. Signed-off-by: Emma Rogge <[email protected]>
1 parent a03cc40 commit b105b0e

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

plugins/nf-google/src/main/nextflow/cloud/google/batch/client/BatchConfig.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class BatchConfig implements ConfigScope {
148148
cpuPlatform = opts.cpuPlatform
149149
gcsfuseOptions = opts.gcsfuseOptions as List<String> ?: DEFAULT_GCSFUSE_OPTS
150150
installGpuDrivers = opts.installGpuDrivers as boolean
151-
logsBucket = validateLogsBucket(opts.logsBucket)
151+
logsBucket = validateLogsBucket(opts.logsBucket as String)
152152
maxSpotAttempts = opts.maxSpotAttempts != null ? opts.maxSpotAttempts as int : DEFAULT_MAX_SPOT_ATTEMPTS
153153
network = opts.network
154154
networkTags = opts.networkTags as List<String> ?: Collections.emptyList()

plugins/nf-google/src/test/nextflow/cloud/google/batch/GoogleBatchTaskHandlerTest.groovy

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,7 @@ class GoogleBatchTaskHandlerTest extends Specification {
661661

662662
def 'should create submit request with logs bucket PATH policy' () {
663663
given:
664+
def GCS_VOL = Volume.newBuilder().setGcs(GCS.newBuilder().setRemotePath('foo').build() ).build()
664665
def WORK_DIR = CloudStorageFileSystem.forBucket('foo').getPath('/scratch')
665666
def CONTAINER_IMAGE = 'ubuntu:22.1'
666667
def LOGS_BUCKET = 'gs://my-logs-bucket/logs'
@@ -673,6 +674,7 @@ class GoogleBatchTaskHandlerTest extends Specification {
673674
def exec = Mock(GoogleBatchExecutor) {
674675
getSession() >> session
675676
getBatchConfig() >> new BatchConfig([logsBucket: LOGS_BUCKET])
677+
getConfig() >> Mock(ExecutorConfig)
676678
isFusionEnabled() >> false
677679
}
678680

@@ -688,8 +690,9 @@ class GoogleBatchTaskHandlerTest extends Specification {
688690
}
689691
}
690692

693+
def LOGS_VOL = Volume.newBuilder().setGcs(GCS.newBuilder().setRemotePath('my-logs-bucket').build()).setMountPath('/mnt/disks/my-logs-bucket').build()
691694
def mounts = ['/mnt/disks/foo/scratch:/mnt/disks/foo/scratch:rw']
692-
def volumes = [ GCS_VOL ]
695+
def volumes = [ GCS_VOL, LOGS_VOL ]
693696
def launcher = new GoogleBatchLauncherSpecMock('bash .command.run', mounts, volumes)
694697

695698
def handler = Spy(new GoogleBatchTaskHandler(task, exec))
@@ -705,9 +708,9 @@ class GoogleBatchTaskHandlerTest extends Specification {
705708
req.getLogsPolicy().getLogsPath() == '/mnt/disks/my-logs-bucket/logs'
706709
and:
707710
def taskGroup = req.getTaskGroups(0)
708-
def volumes = taskGroup.getTaskSpec().getVolumesList()
709-
volumes.size() >= 2 // At least work dir volume and logs bucket volume
710-
def logsBucketVolume = volumes.find { it.getGcs().getRemotePath() == 'my-logs-bucket' }
711+
def taskVolumes = taskGroup.getTaskSpec().getVolumesList()
712+
taskVolumes.size() >= 2 // At least work dir volume and logs bucket volume
713+
def logsBucketVolume = taskVolumes.find { it.getGcs().getRemotePath() == 'my-logs-bucket' }
711714
logsBucketVolume != null
712715
logsBucketVolume.getMountPath() == '/mnt/disks/my-logs-bucket'
713716
}

0 commit comments

Comments
 (0)