This repository has been archived by the owner on Aug 20, 2024. It is now read-only.
forked from nextflow-io/nf-schema
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add tests for arrays in YAML/JSON. Add new test data.
- Loading branch information
Showing
7 changed files
with
372 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
plugins/nf-validation/src/testResources/correct_arrays.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
[ | ||
{ | ||
"field_1": [ | ||
"src/testResources/testDir/testFile.txt", | ||
"src/testResources/testDir2/testFile2.txt" | ||
], | ||
"field_2": [ | ||
"src/testResources/testDir", | ||
"src/testResources/testDir2" | ||
], | ||
"field_3": [ | ||
"src/testResources/testDir", | ||
"src/testResources/testDir2/testFile2.txt" | ||
], | ||
"field_4": [ | ||
"string1", | ||
"string2" | ||
], | ||
"field_5": [ | ||
25, | ||
26 | ||
], | ||
"field_6": [ | ||
25, | ||
26.5 | ||
], | ||
"field_7": [ | ||
false, | ||
true | ||
], | ||
"field_9": [ | ||
true | ||
] | ||
}, | ||
{ | ||
"field_4": [ | ||
"string1", | ||
"string2" | ||
], | ||
"field_5": [ | ||
25, | ||
26 | ||
], | ||
"field_6": [ | ||
25, | ||
26.5 | ||
] | ||
}, | ||
{ | ||
"field_4": [ | ||
"string1", | ||
"string2" | ||
], | ||
"field_5": [ | ||
25, | ||
26 | ||
], | ||
"field_6": [ | ||
25, | ||
26.5 | ||
], | ||
"field_11": [ | ||
[ | ||
"src/testResources/testDir/testFile.txt" | ||
], | ||
[ | ||
"src/testResources/testDir/testFile.txt", | ||
"src/testResources/testDir2/testFile2.txt" | ||
] | ||
] | ||
} | ||
] |
45 changes: 45 additions & 0 deletions
45
plugins/nf-validation/src/testResources/correct_arrays.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
- field_1: | ||
- src/testResources/testDir/testFile.txt | ||
- src/testResources/testDir2/testFile2.txt | ||
field_2: | ||
- src/testResources/testDir | ||
- src/testResources/testDir2 | ||
field_3: | ||
- src/testResources/testDir | ||
- src/testResources/testDir2/testFile2.txt | ||
field_4: | ||
- string1 | ||
- string2 | ||
field_5: | ||
- 25 | ||
- 26 | ||
field_6: | ||
- 25 | ||
- 26.5 | ||
field_7: | ||
- false | ||
- true | ||
field_9: | ||
- true | ||
- field_4: | ||
- string1 | ||
- string2 | ||
field_5: | ||
- 25 | ||
- 26 | ||
field_6: | ||
- 25 | ||
- 26.5 | ||
- field_4: | ||
- string1 | ||
- string2 | ||
field_5: | ||
- 25 | ||
- 26 | ||
field_6: | ||
- 25 | ||
- 26.5 | ||
field_11: | ||
- - src/testResources/testDir/testFile.txt | ||
- - src/testResources/testDir/testFile.txt | ||
- src/testResources/testDir2/testFile2.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
- field_1: | ||
- src/testResources/testDir/testFile.fasta | ||
- src/testResources/testDir2/testFile3.txt | ||
field_2: | ||
- src/testResources/testDir | ||
- src/testResources/testDir3 | ||
field_3: | ||
- src/testResources/testDir3 | ||
- src/testResources/testDir2/testFile3.txt | ||
field_4: | ||
- string2 | ||
- string2 | ||
- string1 | ||
field_5: | ||
- 25 | ||
- 25 | ||
- 27 | ||
- 28 | ||
field_6: | ||
- 25 | ||
- 25.0 | ||
field_7: | ||
- null | ||
- true | ||
field_9: | ||
- true | ||
- field_5: | ||
- 25 | ||
field_6: | ||
- 25 | ||
- 26.5 | ||
- field_4: 'abc' | ||
field_6: | ||
- 25 | ||
- 26.5 |
28 changes: 28 additions & 0 deletions
28
...ns/nf-validation/src/testResources/nextflow_schema_with_samplesheet_converter_arrays.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"$id": "https://raw.githubusercontent.com/nf-core/testpipeline/master/nextflow_schema.json", | ||
"title": "nf-core/testpipeline pipeline parameters", | ||
"description": "this is a test", | ||
"type": "object", | ||
"definitions": { | ||
"input_output_options": { | ||
"title": "Input/output options", | ||
"type": "object", | ||
"fa_icon": "fas fa-terminal", | ||
"description": "Define where the pipeline should find input data and save output data.", | ||
"required": ["input"], | ||
"properties": { | ||
"input": { | ||
"type": "string", | ||
"format": "file-path", | ||
"mimetype": "text/csv", | ||
"pattern": "^\\S+\\.csv$", | ||
"schema": "src/testResources/schema_input_with_arrays.json", | ||
"description": "Path to comma-separated file containing information about the samples in the experiment.", | ||
"help_text": "You will need to create a design file with information about the samples in your experiment before running the pipeline. Use this parameter to specify its location. It has to be a comma-separated file with 3 columns, and a header row. See [usage docs](https://nf-co.re/testpipeline/usage#samplesheet-input).", | ||
"fa_icon": "fas fa-file-csv" | ||
} | ||
} | ||
} | ||
} | ||
} |
102 changes: 102 additions & 0 deletions
102
plugins/nf-validation/src/testResources/schema_input_with_arrays.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"$id": "https://raw.githubusercontent.com/nextflow-io/nf-validation/master/plugins/nf-validation/src/testResources/schema_input.json", | ||
"title": "Samplesheet validation schema", | ||
"description": "Schema for the samplesheet used in this pipeline", | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"field_1": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"format": "file-path", | ||
"pattern": "^.*\\.txt$", | ||
"exists": true | ||
} | ||
}, | ||
"field_2": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"format": "directory-path", | ||
"exists": true | ||
} | ||
}, | ||
"field_3": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"format": "path", | ||
"exists": true | ||
} | ||
}, | ||
"field_4": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"uniqueItems": true | ||
}, | ||
"field_5": { | ||
"type": "array", | ||
"items": { | ||
"type": "integer" | ||
}, | ||
"minItems": 2, | ||
"maxItems": 3 | ||
}, | ||
"field_6": { | ||
"type": "array", | ||
"items": { | ||
"type": "number" | ||
}, | ||
"uniqueItems": true | ||
}, | ||
"field_7": { | ||
"type": "array", | ||
"items": { | ||
"type": "boolean" | ||
} | ||
}, | ||
"field_8": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"default": ["1", "2", "3"] | ||
}, | ||
"field_9": { | ||
"type": "array", | ||
"items": { | ||
"type": "boolean" | ||
}, | ||
"default": [false, true, false] | ||
}, | ||
"field_10": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"format": "file-path", | ||
"pattern": "^.*\\.txt$", | ||
"exists": true | ||
}, | ||
"default": ["src/testResources/testDir/testFile.txt"] | ||
}, | ||
"field_11": { | ||
"type": "array", | ||
"items": { | ||
"type": "array", | ||
"items": { | ||
"format": "file-path", | ||
"pattern": "^.*\\.txt$", | ||
"exists": true | ||
} | ||
}, | ||
"default": [["src/testResources/testDir/testFile.txt"]] | ||
} | ||
}, | ||
"required": ["field_4", "field_6"] | ||
} | ||
} |
Empty file.