Skip to content

Commit 536568c

Browse files
committed
Need to fixup testss
Signed-off-by: adamrtalbot <12817534+adamrtalbot@users.noreply.github.com>
1 parent ad07555 commit 536568c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

plugins/nf-azure/src/main/nextflow/cloud/azure/batch/AzBatchTaskHandler.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class AzBatchTaskHandler extends TaskHandler implements FusionAwareTask {
7171
}
7272

7373
void validateConfiguration() {
74-
if (!task.container && config.batch().requireContainer ) {
74+
if (!task.container && executor.config.batch().requireContainer ) {
7575
throw new ProcessUnrecoverableException("No container image specified for process $task.name -- Either specify the container to use in the process definition or with 'process.container' value in your config. You can disable this behaviour setting `azure.batch.requireContainer=false` in the nextflow config file")
7676
}
7777
}

plugins/nf-azure/src/test/nextflow/cloud/azure/batch/AzBatchTaskHandlerTest.groovy

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package nextflow.cloud.azure.batch
22

3+
import nextflow.cloud.azure.config.AzConfig
34
import nextflow.cloud.types.CloudMachineInfo
45
import nextflow.cloud.types.PriceModel
56
import nextflow.exception.ProcessUnrecoverableException
@@ -21,6 +22,9 @@ class AzBatchTaskHandlerTest extends Specification {
2122
def 'should validate config' () {
2223
when:
2324
def task = Mock(TaskRun) { getName() >> 'foo'; }
25+
def CONFIG = [batch: [requireContainer: false]]
26+
def exec = Mock(Executor) { getName() >> 'azurebatch' }
27+
processor.getExecutor() >> exec
2428
and:
2529
new AzBatchTaskHandler(task: task)
2630
.validateConfiguration()
@@ -41,8 +45,9 @@ class AzBatchTaskHandlerTest extends Specification {
4145
def 'should ignore missing container if disabled' () {
4246
when:
4347
def task = Mock(TaskRun) { getName() >> 'foo'; }
48+
def CONFIG = [batch: [requireContainer: false]]
4449
and:
45-
new AzBatchTaskHandler(task: task, config: new AzConfig([batch: [requireContainer: false]]))
50+
new AzBatchTaskHandler(task: task, config: new AzConfig(CONFIG))
4651
.validateConfiguration()
4752
then:
4853
noExceptionThrown()

0 commit comments

Comments
 (0)