-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from maxulysse/getAllFilesFromDir
Add getAllFilesFromDir function
- Loading branch information
Showing
7 changed files
with
133 additions
and
2 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
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,23 @@ | ||
workflow { | ||
|
||
def trace_timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss') | ||
|
||
ch_stable_content = Channel.of( | ||
""" | ||
I HAVE STABLE CONTENT | ||
""".stripIndent().trim()) | ||
.collectFile(storeDir: "${params.outdir}/stable", name: 'stable_content.txt', sort: true, newLine: true) | ||
|
||
ch_stable_name = Channel.of( | ||
""" | ||
I DO NOT HAVE STABLE CONTENT | ||
${trace_timestamp} | ||
""".stripIndent().trim()) | ||
.collectFile(storeDir: "${params.outdir}/stable", name: 'stable_name.txt', sort: true, newLine: true) | ||
|
||
ch_unstable_name = Channel.of( | ||
""" | ||
I DO NOT HAVE STABLE NAME | ||
""".stripIndent().trim()) | ||
.collectFile(storeDir: "${params.outdir}/not_stable", name: "${trace_timestamp}.txt", sort: true, newLine: true) | ||
} |
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,24 @@ | ||
nextflow_pipeline { | ||
|
||
name "Test getAllFilesFromDir" | ||
script "./main.nf" | ||
tag "getAllFilesFromDir" | ||
|
||
test("getAllFilesFromDir") { | ||
when { | ||
params { | ||
outdir = "$outputDir" | ||
} | ||
} | ||
|
||
then { | ||
def timestamp = [/.*\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}.*/] | ||
def stable_name = getAllFilesFromDir(params.outdir, false, timestamp) | ||
def stable_content = getAllFilesFromDir(params.outdir, false, timestamp + [/stable_name\.txt/] ) | ||
assert snapshot( | ||
stable_name*.name, | ||
stable_content | ||
).match() | ||
} | ||
} | ||
} |
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,18 @@ | ||
{ | ||
"getAllFilesFromDir": { | ||
"content": [ | ||
[ | ||
"stable_content.txt", | ||
"stable_name.txt" | ||
], | ||
[ | ||
"stable_content.txt:md5,f6d73f703cda1c725ea78369a6c3a48d" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.9.0", | ||
"nextflow": "24.04.4" | ||
}, | ||
"timestamp": "2024-09-30T10:55:42.424751" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
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,16 @@ | ||
{ | ||
"removeNextflowVersion": { | ||
"content": [ | ||
{ | ||
"Workflow": { | ||
"Pipeline": "1.0.0" | ||
} | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.9.0", | ||
"nextflow": "24.04.4" | ||
}, | ||
"timestamp": "2024-09-27T19:17:42.066036" | ||
} | ||
} |