Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
Add tests ignoring for az/s3/gs paths
Browse files Browse the repository at this point in the history
  • Loading branch information
adamrtalbot committed Jul 5, 2024
1 parent e50417e commit f70cecc
Showing 1 changed file with 66 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,72 @@ class PluginExtensionMethodsTest extends Dsl2Spec{
!stdout
}

def 'should ignore s3 path' () {
given:
def schema = Path.of('src/testResources/nextflow_schema_file_path_pattern.json').toAbsolutePath().toString()
def SCRIPT_TEXT = """
params.glob = 's3://fake/path'
include { validateParameters } from 'plugin/nf-validation'
validateParameters(parameters_schema: '$schema')
"""

when:
dsl_eval(SCRIPT_TEXT)
def stdout = capture
.toString()
.readLines()
.findResults {it.contains('WARN nextflow.validation.SchemaValidator') || it.startsWith('* --') ? it : null }

then:
noExceptionThrown()
!stdout
}

def 'should ignore az path' () {
given:
def schema = Path.of('src/testResources/nextflow_schema_file_path_pattern.json').toAbsolutePath().toString()
def SCRIPT_TEXT = """
params.glob = 'az://fake/path'
include { validateParameters } from 'plugin/nf-validation'
validateParameters(parameters_schema: '$schema')
"""

when:
dsl_eval(SCRIPT_TEXT)
def stdout = capture
.toString()
.readLines()
.findResults {it.contains('WARN nextflow.validation.SchemaValidator') || it.startsWith('* --') ? it : null }

then:
noExceptionThrown()
!stdout
}

def 'should ignore gs path' () {
given:
def schema = Path.of('src/testResources/nextflow_schema_file_path_pattern.json').toAbsolutePath().toString()
def SCRIPT_TEXT = """
params.glob = 'gs://fake/path'
include { validateParameters } from 'plugin/nf-validation'
validateParameters(parameters_schema: '$schema')
"""

when:
dsl_eval(SCRIPT_TEXT)
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()
Expand Down

0 comments on commit f70cecc

Please sign in to comment.