From 426296588371209e879038a54dcc4db3f4c559fc Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 2 May 2024 12:31:45 +0100 Subject: [PATCH] Add tests for S3, AZ and GS storage --- .../validation/ValidateParametersTest.groovy | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/plugins/nf-schema/src/test/nextflow/validation/ValidateParametersTest.groovy b/plugins/nf-schema/src/test/nextflow/validation/ValidateParametersTest.groovy index 2a87fd82..b8885aec 100644 --- a/plugins/nf-schema/src/test/nextflow/validation/ValidateParametersTest.groovy +++ b/plugins/nf-schema/src/test/nextflow/validation/ValidateParametersTest.groovy @@ -674,6 +674,75 @@ class ValidateParametersTest extends Dsl2Spec{ !stdout } + def 'ignore validation of aws s3' () { + given: + def schema = Path.of('src/testResources/nextflow_schema_file_path_pattern.json').toAbsolutePath().toString() + def SCRIPT = """ + params.glob = 's3://src/testResources/correct.csv' + include { validateParameters } from 'plugin/nf-schema' + + validateParameters(parameters_schema: '$schema') + """ + + when: + def config = [:] + def result = new MockScriptRunner(config).setScript(SCRIPT).execute() + def stdout = capture + .toString() + .readLines() + .findResults {it.contains('WARN nextflow.validation.SchemaValidator') || it.startsWith('* --') ? it : null } + + then: + noExceptionThrown() + !stdout + } + + def 'ignore validation of azure blob storage' () { + given: + def schema = Path.of('src/testResources/nextflow_schema_file_path_pattern.json').toAbsolutePath().toString() + def SCRIPT = """ + params.glob = 'az://src/testResources/correct.csv' + include { validateParameters } from 'plugin/nf-schema' + + validateParameters(parameters_schema: '$schema') + """ + + when: + def config = [:] + def result = new MockScriptRunner(config).setScript(SCRIPT).execute() + def stdout = capture + .toString() + .readLines() + .findResults {it.contains('WARN nextflow.validation.SchemaValidator') || it.startsWith('* --') ? it : null } + + then: + noExceptionThrown() + !stdout + } + + def 'ignore validation of gcp cloud storage' () { + given: + def schema = Path.of('src/testResources/nextflow_schema_file_path_pattern.json').toAbsolutePath().toString() + def SCRIPT = """ + params.glob = 'gs://src/testResources/correct.csv' + include { validateParameters } from 'plugin/nf-schema' + + validateParameters(parameters_schema: '$schema') + """ + + when: + def config = [:] + def result = new MockScriptRunner(config).setScript(SCRIPT).execute() + def stdout = capture + .toString() + .readLines() + .findResults {it.contains('WARN nextflow.validation.SchemaValidator') || it.startsWith('* --') ? it : null } + + then: + noExceptionThrown() + !stdout + } + def 'correct validation of numbers with lenient mode' () { given: def schema = Path.of('src/testResources/nextflow_schema.json').toAbsolutePath().toString()