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

Commit

Permalink
fix: make tests use correct input file for yaml and json tests. Ensur…
Browse files Browse the repository at this point in the history
…e that boolean values in json/yaml are not treated as null before casting
  • Loading branch information
awgymer committed Dec 21, 2023
1 parent 40ffe27 commit 8f02b26
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ class SamplesheetConverter {
def List<String> metaNames = field['value']['meta'] as List<String>
if(metaNames) {
for(name : metaNames) {
meta[name] = (input != '' && input) ?
meta[name] = (input != '' && input != null) ?
castToNFType(input, field) :
field['value']['default'] != null ?
castToNFType(field['value']['default'], field) :
null
}
}
else {
def inputVal = (input != '' && input) ?
def inputVal = (input != '' && input != null) ?
castToNFType(input, field) :
field['value']['default'] != null ?
castToNFType(field['value']['default'], field) :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class SamplesheetConverterTest extends Dsl2Spec{
def SCRIPT_TEXT = '''
include { fromSamplesheet } from 'plugin/nf-validation'
params.input = 'src/testResources/correct.csv'
params.input = 'src/testResources/correct.tsv'
workflow {
Channel.fromSamplesheet("input", parameters_schema:"src/testResources/nextflow_schema_with_samplesheet_converter.json").view()
Expand All @@ -142,7 +142,7 @@ class SamplesheetConverterTest extends Dsl2Spec{
def SCRIPT_TEXT = '''
include { fromSamplesheet } from 'plugin/nf-validation'
params.input = 'src/testResources/correct.csv'
params.input = 'src/testResources/correct.yaml'
workflow {
Channel.fromSamplesheet("input", parameters_schema:"src/testResources/nextflow_schema_with_samplesheet_converter.json").view()
Expand Down
2 changes: 1 addition & 1 deletion plugins/nf-validation/src/testResources/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"type": "string",
"format": "path",
"exists": true
},
},
"field_10": {
"type": "string",
"unique": true
Expand Down

0 comments on commit 8f02b26

Please sign in to comment.