Skip to content

Commit 80f0095

Browse files
authored
Merge pull request #75 from Aratz/nft-utils
Set up nft-utils in tests
2 parents 826a811 + 0372247 commit 80f0095

File tree

9 files changed

+1064
-85
lines changed

9 files changed

+1064
-85
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Initial release of nf-core/seqinspector, created with the [nf-core](https://nf-c
99

1010
### `Added`
1111

12+
- [#75](https://github.com/nf-core/seqinspector/pull/75) Set up nft-utils
1213
- [#68](https://github.com/nf-core/seqinspector/pull/68) Add tool selector
1314
- [#20](https://github.com/nf-core/seqinspector/pull/20) Use tags to generate group reports
1415
- [#13](https://github.com/nf-core/seqinspector/pull/13) Generate reports per run, per project and per lane.

nf-test.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ config {
55
configFile "tests/nextflow.config"
66
profile "test,docker"
77

8+
plugins {
9+
10+
}
811
}

tests/.nftignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.DS_Store
2+
multiqc/{global_report,group_reports/*}/multiqc_data/multiqc.log
3+
multiqc/{global_report,group_reports/*}/multiqc_data/multiqc_data.json
4+
multiqc/{global_report,group_reports/*}/multiqc_data/multiqc_general_stats.txt
5+
multiqc/{global_report,group_reports/*}/multiqc_data/multiqc_software_versions.txt
6+
multiqc/{global_report,group_reports/*}/multiqc_data/multiqc_sources.txt
7+
multiqc/{global_report,group_reports/*}/multiqc_data/fastqc_top_overrepresented_sequences_table.txt
8+
multiqc/{global_report,group_reports/*}/multiqc_plots/{svg,pdf,png}/*.{svg,pdf,png}
9+
multiqc/{global_report,group_reports/*}/multiqc_report.html
10+
pipeline_info/*.{html,json,txt,yml}
11+
fastqscreen/*_screen.html
12+
fastqc/*_fastqc.{html,zip}

tests/MiSeq.main.nf.test

Lines changed: 76 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,28 @@ nextflow_pipeline {
1515
}
1616

1717
then {
18+
// stable_name: All files + folders in ${params.outdir}/ with a stable name
19+
def stable_name = getAllFilesFromDir(
20+
params.outdir,
21+
relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']
22+
)
23+
// stable_path: All files in ${params.outdir}/ with stable content
24+
def stable_path = getAllFilesFromDir(
25+
params.outdir,
26+
ignoreFile: 'tests/.nftignore'
27+
)
1828
assertAll(
19-
{ assert workflow.success },
29+
{ assert workflow.success},
2030
{ assert snapshot(
21-
path("$outputDir/multiqc/global_report/multiqc_data/multiqc_citations.txt"),
22-
path("$outputDir/multiqc/global_report/multiqc_data/multiqc_fastqc.txt"),
23-
path("$outputDir/multiqc/global_report/multiqc_data/multiqc_general_stats.txt"),
24-
path("$outputDir/multiqc/global_report/multiqc_data/multiqc_fastq_screen.txt"),
25-
).match()
26-
}
31+
// Number of successful tasks
32+
workflow.trace.succeeded().size(),
33+
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
34+
removeNextflowVersion("$outputDir/pipeline_info/nf_core_seqinspector_software_mqc_versions.yml"),
35+
// All stable path names, with a relative path
36+
stable_name,
37+
// All files with stable contents
38+
stable_path
39+
).match() }
2740
)
2841
}
2942
}
@@ -38,15 +51,64 @@ nextflow_pipeline {
3851
}
3952

4053
then {
54+
// stable_name: All files + folders in ${params.outdir}/ with a stable name
55+
def stable_name = getAllFilesFromDir(
56+
params.outdir,
57+
relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']
58+
)
59+
// stable_path: All files in ${params.outdir}/ with stable content
60+
def stable_path = getAllFilesFromDir(
61+
params.outdir,
62+
ignoreFile: 'tests/.nftignore'
63+
)
64+
assertAll(
65+
{ assert workflow.success},
66+
{ assert snapshot(
67+
// Number of successful tasks
68+
workflow.trace.succeeded().size(),
69+
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
70+
removeNextflowVersion("$outputDir/pipeline_info/nf_core_seqinspector_software_mqc_versions.yml"),
71+
// All stable path names, with a relative path
72+
stable_name,
73+
// All files with stable contents
74+
stable_path
75+
).match() }
76+
)
77+
}
78+
}
79+
80+
test("Miseq data test (skip all tools)") {
81+
when {
82+
config "./MiSeq.main.nf.test.config"
83+
params {
84+
outdir = "$outputDir"
85+
skip_tools = "fastqc,fastqscreen,seqfu_stats,seqtk_sample"
86+
}
87+
}
88+
89+
then {
90+
// stable_name: All files + folders in ${params.outdir}/ with a stable name
91+
def stable_name = getAllFilesFromDir(
92+
params.outdir,
93+
relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']
94+
)
95+
// stable_path: All files in ${params.outdir}/ with stable content
96+
def stable_path = getAllFilesFromDir(
97+
params.outdir,
98+
ignoreFile: 'tests/.nftignore'
99+
)
41100
assertAll(
42-
{ assert workflow.success },
101+
{ assert workflow.success},
43102
{ assert snapshot(
44-
path("$outputDir/multiqc/global_report/multiqc_data/multiqc_citations.txt"),
45-
).match()
46-
},
47-
{
48-
assert !path("$outputDir/multiqc/global_report/multiqc_data/multiqc_fastqc.txt").exists()
49-
}
103+
// Number of successful tasks
104+
workflow.trace.succeeded().size(),
105+
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
106+
removeNextflowVersion("$outputDir/pipeline_info/nf_core_seqinspector_software_mqc_versions.yml"),
107+
// All stable path names, with a relative path
108+
stable_name,
109+
// All files with stable contents
110+
stable_path
111+
).match() }
50112
)
51113
}
52114
}

0 commit comments

Comments
 (0)