Skip to content

Commit cb3347e

Browse files
committed
update all tests to template
1 parent 4d71dd7 commit cb3347e

15 files changed

Lines changed: 273 additions & 615 deletions

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### `Fixed`
1313

14-
- [#893](https://github.com/nf-core/ampliseq/pull/893) - Template update for nf-core/tools version 3.3.1
14+
- [#893](https://github.com/nf-core/ampliseq/pull/893),[#894](https://github.com/nf-core/ampliseq/pull/894) - Template update for nf-core/tools version 3.3.1
1515

1616
### `Dependencies`
1717

tests/default.nf.test

Lines changed: 31 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -16,114 +16,45 @@ nextflow_pipeline {
1616
then {
1717
// stable_name: All files + folders in ${params.outdir}/ with a stable name
1818
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
19-
// stable_path: All files in ${params.outdir}/ with stable content
20-
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
19+
20+
assert workflow.success
2121
assertAll(
22-
{ assert workflow.success},
23-
/* New syntax, is not satisfied
2422
{ assert snapshot(
2523
// Number of successful tasks
2624
workflow.trace.succeeded().size(),
2725
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we test pipelines on multiple Nextflow versions
28-
removeNextflowVersion("$outputDir/pipeline_info/nf_core_ampliseq_software_mqc_versions.yml"),
26+
removeNextflowVersion("$outputDir/pipeline_info/software_versions.yml"),
2927
// All stable path name, with a relative path
3028
stable_name,
31-
// All files with stable contents
32-
stable_path
29+
// Manually chosen files for content checks
30+
path("$outputDir/overall_summary.tsv"),
31+
path("$outputDir/asv_length_filter/").list(),
32+
path("$outputDir/barrnap/ASV_seqs.ssu.fasta"),
33+
path("$outputDir/barrnap/ASV_table.ssu.tsv"),
34+
path("$outputDir/barrnap/rrna.arc.gff"),
35+
path("$outputDir/barrnap/rrna.bac.gff"),
36+
path("$outputDir/barrnap/rrna.euk.gff"),
37+
path("$outputDir/barrnap/stats.ssu.tsv"),
38+
path("$outputDir/barrnap/rrna.mito.gff"),
39+
path("$outputDir/cutadapt/cutadapt_summary.tsv"),
40+
path("$outputDir/dada2/ASV_seqs.fasta"),
41+
path("$outputDir/dada2/ASV_table.tsv"),
42+
path("$outputDir/dada2/ref_taxonomy.gtdb_R07-RS207.txt"),
43+
path("$outputDir/dada2/DADA2_stats.tsv"),
44+
path("$outputDir/dada2/DADA2_table.rds"),
45+
path("$outputDir/dada2/DADA2_table.tsv"),
46+
path("$outputDir/input/Samplesheet.tsv"),
47+
path("$outputDir/input/Metadata.tsv"),
48+
path("$outputDir/multiqc/multiqc_data/multiqc_fastqc.txt"),
49+
path("$outputDir/multiqc/multiqc_data/multiqc_general_stats.txt"),
50+
path("$outputDir/multiqc/multiqc_data/multiqc_cutadapt.txt"),
51+
path("$outputDir/SBDI/dna.tsv"),
52+
path("$outputDir/SBDI/emof.tsv"),
53+
path("$outputDir/SBDI/event.tsv"),
54+
path("$outputDir/vsearch_cluster/ASV_post_clustering_filtered.fna"),
55+
path("$outputDir/vsearch_cluster/ASV_post_clustering_filtered.stats.tsv"),
56+
path("$outputDir/vsearch_cluster/ASV_post_clustering_filtered.table.tsv"),
3357
).match() }
34-
*/
35-
// Old syntax, provisionally used
36-
{ assert new File("$outputDir/pipeline_info/software_versions.yml").exists() },
37-
{ assert snapshot(path("$outputDir/overall_summary.tsv")).match("overall_summary_tsv") },
38-
{ assert snapshot(path("$outputDir/asv_length_filter/").list()).match("asv_length_filter") },
39-
{ assert snapshot(path("$outputDir/barrnap/ASV_seqs.ssu.fasta"),
40-
path("$outputDir/barrnap/ASV_table.ssu.tsv"),
41-
path("$outputDir/barrnap/rrna.arc.gff"),
42-
path("$outputDir/barrnap/rrna.bac.gff"),
43-
path("$outputDir/barrnap/rrna.euk.gff"),
44-
path("$outputDir/barrnap/stats.ssu.tsv"),
45-
path("$outputDir/barrnap/rrna.mito.gff")).match("barrnap") },
46-
{ assert new File("$outputDir/barrnap/summary.tsv").exists() },
47-
{ assert snapshot(path("$outputDir/cutadapt/cutadapt_summary.tsv")).match("cutadapt") },
48-
{ assert new File("$outputDir/cutadapt/assignTaxonomy.cutadapt.log").exists() },
49-
{ assert new File("$outputDir/cutadapt/sampleID_1a.trimmed.cutadapt.log").exists() },
50-
{ assert new File("$outputDir/cutadapt/sampleID_1.trimmed.cutadapt.log").exists() },
51-
{ assert new File("$outputDir/cutadapt/sampleID_2a.trimmed.cutadapt.log").exists() },
52-
{ assert new File("$outputDir/cutadapt/sampleID_2.trimmed.cutadapt.log").exists() },
53-
{ assert snapshot(path("$outputDir/dada2/ASV_seqs.fasta"),
54-
path("$outputDir/dada2/ASV_table.tsv"),
55-
path("$outputDir/dada2/ref_taxonomy.gtdb_R07-RS207.txt"),
56-
path("$outputDir/dada2/DADA2_stats.tsv"),
57-
path("$outputDir/dada2/DADA2_table.rds"),
58-
path("$outputDir/dada2/DADA2_table.tsv")).match("dada2") },
59-
{ assert new File("$outputDir/dada2/ASV_tax.gtdb_R07-RS207.tsv").exists() },
60-
{ assert new File("$outputDir/dada2/ASV_tax_species.gtdb_R07-RS207.tsv").exists() },
61-
{ assert new File("$outputDir/fastqc/sampleID_1_1_fastqc.html").exists() },
62-
{ assert new File("$outputDir/fastqc/sampleID_1_2_fastqc.html").exists() },
63-
{ assert new File("$outputDir/fastqc/sampleID_1a_1_fastqc.html").exists() },
64-
{ assert new File("$outputDir/fastqc/sampleID_1a_2_fastqc.html").exists() },
65-
{ assert new File("$outputDir/fastqc/sampleID_2_1_fastqc.html").exists() },
66-
{ assert new File("$outputDir/fastqc/sampleID_2_2_fastqc.html").exists() },
67-
{ assert new File("$outputDir/fastqc/sampleID_2a_1_fastqc.html").exists() },
68-
{ assert new File("$outputDir/fastqc/sampleID_2a_2_fastqc.html").exists() },
69-
{ assert snapshot(path("$outputDir/input/Samplesheet.tsv"),
70-
path("$outputDir/input/Metadata.tsv")).match("input") },
71-
{ assert snapshot(path("$outputDir/multiqc/multiqc_data/multiqc_fastqc.txt"),
72-
path("$outputDir/multiqc/multiqc_data/multiqc_general_stats.txt"),
73-
path("$outputDir/multiqc/multiqc_data/multiqc_cutadapt.txt")).match("multiqc") },
74-
{ assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-2.tsv").exists() },
75-
{ assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-3.tsv").exists() },
76-
{ assert new File("$outputDir/qiime2/abundance_tables/abs-abund-table-4.tsv").exists() },
77-
{ assert new File("$outputDir/qiime2/abundance_tables/count_table_filter_stats.tsv").exists() },
78-
{ assert new File("$outputDir/qiime2/abundance_tables/filtered-table.qza").exists() },
79-
{ assert new File("$outputDir/qiime2/abundance_tables/feature-table.biom").exists() },
80-
{ assert new File("$outputDir/qiime2/abundance_tables/feature-table.tsv").exists() },
81-
{ assert new File("$outputDir/qiime2/input/rep-seqs.qza").exists() },
82-
{ assert new File("$outputDir/qiime2/input/table.qza").exists() },
83-
{ assert new File("$outputDir/qiime2/input/taxonomy.qza").exists() },
84-
{ assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-2.tsv").exists() },
85-
{ assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-3.tsv").exists() },
86-
{ assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-4.tsv").exists() },
87-
{ assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-ASV.tsv").exists() },
88-
{ assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-ASV_with-DADA2-tax.tsv").exists() },
89-
{ assert new File("$outputDir/qiime2/rel_abundance_tables/rel-table-ASV_with-QIIME2-tax.tsv").exists() },
90-
{ assert new File("$outputDir/qiime2/representative_sequences/descriptive_stats.tsv").exists() },
91-
{ assert new File("$outputDir/qiime2/representative_sequences/filtered-sequences.qza").exists() },
92-
{ assert new File("$outputDir/qiime2/representative_sequences/rep-seq.fasta").exists() },
93-
{ assert new File("$outputDir/qiime2/representative_sequences/seven_number_summary.tsv").exists() },
94-
{ assert new File("$outputDir/qiime2/taxonomy/GTGYCAGCMGCCGCGGTAA-GGACTACNVGGGTWTCTAAT-classifier.qza").exists() },
95-
{ assert new File("$outputDir/qiime2/taxonomy/ref_taxonomy.txt").exists() },
96-
{ assert new File("$outputDir/qiime2/taxonomy/taxonomy.tsv").exists() },
97-
{ assert new File("$outputDir/qiime2/ancombc/da_barplot/Category-badpairwise10-ASV/index.html").exists() },
98-
{ assert new File("$outputDir/qiime2/ancombc/da_barplot/Category-badpairwise10-level-2/index.html").exists() },
99-
{ assert new File("$outputDir/qiime2/ancombc/da_barplot/Category-badpairwise10-level-3/index.html").exists() },
100-
{ assert new File("$outputDir/qiime2/ancombc/da_barplot/Category-badpairwise10-level-4/index.html").exists() },
101-
{ assert new File("$outputDir/qiime2/ancombc/da_barplot/Category-mix8-ASV/index.html").exists() },
102-
{ assert new File("$outputDir/qiime2/ancombc/da_barplot/Category-mix8-level-2/index.html").exists() },
103-
{ assert new File("$outputDir/qiime2/ancombc/da_barplot/Category-mix8-level-3/index.html").exists() },
104-
{ assert new File("$outputDir/qiime2/ancombc/da_barplot/Category-mix8-level-4/index.html").exists() },
105-
{ assert new File("$outputDir/qiime2/ancombc/da_barplot/Category-treatment1-ASV/index.html").exists() },
106-
{ assert new File("$outputDir/qiime2/ancombc/da_barplot/Category-treatment1-level-2/index.html").exists() },
107-
{ assert new File("$outputDir/qiime2/ancombc/da_barplot/Category-treatment1-level-3/index.html").exists() },
108-
{ assert new File("$outputDir/qiime2/ancombc/da_barplot/Category-treatment1-level-4/index.html").exists() },
109-
{ assert new File("$outputDir/qiime2/ancombc/differentials/Category-treatment1-level-4/index.html").exists() },
110-
{ assert new File("$outputDir/qiime2/ancombc_formula/da_barplot/Category-treatment1-ASV/index.html").exists() },
111-
{ assert new File("$outputDir/qiime2/ancombc_formula/differentials/Category-treatment1-ASV/index.html").exists() },
112-
{ assert new File("$outputDir/qiime2/ancombc_formula/da_barplot/Category-treatment1-level-4/index.html").exists() },
113-
{ assert new File("$outputDir/qiime2/ancombc_formula/differentials/Category-treatment1-level-4/index.html").exists() },
114-
{ assert snapshot(path("$outputDir/SBDI/dna.tsv"),
115-
path("$outputDir/SBDI/emof.tsv"),
116-
path("$outputDir/SBDI/event.tsv")).match("SBDI") },
117-
{ assert new File("$outputDir/SBDI/annotation.tsv").exists() },
118-
{ assert new File("$outputDir/SBDI/asv-table.tsv").exists() },
119-
{ assert new File("$outputDir/summary_report/summary_report.html").exists() },
120-
{ assert new File("$outputDir/phyloseq/dada2_phyloseq.rds").exists() },
121-
{ assert new File("$outputDir/phyloseq/qiime2_phyloseq.rds").exists() },
122-
{ assert new File("$outputDir/treesummarizedexperiment/dada2_TreeSummarizedExperiment.rds").exists() },
123-
{ assert new File("$outputDir/treesummarizedexperiment/qiime2_TreeSummarizedExperiment.rds").exists() },
124-
{ assert snapshot(path("$outputDir/vsearch_cluster/ASV_post_clustering_filtered.fna"),
125-
path("$outputDir/vsearch_cluster/ASV_post_clustering_filtered.stats.tsv"),
126-
path("$outputDir/vsearch_cluster/ASV_post_clustering_filtered.table.tsv")).match("vsearch_cluster") }
12758
)
12859
}
12960
}

tests/doubleprimers.nf.test

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,35 @@ nextflow_pipeline {
1616
then {
1717
// stable_name: All files + folders in ${params.outdir}/ with a stable name
1818
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
19-
// stable_path: All files in ${params.outdir}/ with stable content
20-
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
19+
20+
assert workflow.success
2121
assertAll(
22-
{ assert workflow.success},
23-
/* New syntax, is not satisfied
2422
{ assert snapshot(
2523
// Number of successful tasks
2624
workflow.trace.succeeded().size(),
2725
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we test pipelines on multiple Nextflow versions
28-
removeNextflowVersion("$outputDir/pipeline_info/nf_core_ampliseq_software_mqc_versions.yml"),
26+
removeNextflowVersion("$outputDir/pipeline_info/software_versions.yml"),
2927
// All stable path name, with a relative path
3028
stable_name,
31-
// All files with stable contents
32-
stable_path
29+
// Manually chosen files for content checks
30+
path("$outputDir/overall_summary.tsv"),
31+
path("$outputDir/barrnap/rrna.arc.gff"),
32+
path("$outputDir/barrnap/rrna.bac.gff"),
33+
path("$outputDir/barrnap/rrna.euk.gff"),
34+
path("$outputDir/barrnap/rrna.mito.gff"),
35+
path("$outputDir/cutadapt/cutadapt_summary.tsv"),
36+
path("$outputDir/dada2/ASV_seqs.fasta"),
37+
path("$outputDir/dada2/ASV_table.tsv"),
38+
path("$outputDir/dada2/DADA2_stats.tsv"),
39+
path("$outputDir/dada2/DADA2_table.rds"),
40+
path("$outputDir/dada2/DADA2_table.tsv"),
41+
path("$outputDir/input/Samplesheet_double_primer.tsv"),
42+
path("$outputDir/kraken2/ASV_tax.greengenes.kraken2.classifiedreads.txt"),
43+
path("$outputDir/kraken2/ASV_tax.greengenes.kraken2.complete.tsv"),
44+
path("$outputDir/kraken2/ASV_tax.greengenes.kraken2.tsv"),
45+
path("$outputDir/multiqc/multiqc_data/multiqc_general_stats.txt"),
46+
path("$outputDir/multiqc/multiqc_data/multiqc_cutadapt.txt")
3347
).match() }
34-
*/
35-
// Old syntax, provisionally used
36-
{ assert new File("$outputDir/pipeline_info/software_versions.yml").exists() },
37-
{ assert snapshot(path("$outputDir/overall_summary.tsv")).match("overall_summary_tsv") },
38-
{ assert snapshot(path("$outputDir/barrnap/rrna.arc.gff"),
39-
path("$outputDir/barrnap/rrna.bac.gff"),
40-
path("$outputDir/barrnap/rrna.euk.gff"),
41-
path("$outputDir/barrnap/rrna.mito.gff")).match("barrnap") },
42-
{ assert new File("$outputDir/barrnap/summary.tsv").exists() },
43-
{ assert snapshot(path("$outputDir/cutadapt/cutadapt_summary.tsv")).match("cutadapt") },
44-
{ assert snapshot(path("$outputDir/dada2/ASV_seqs.fasta"),
45-
path("$outputDir/dada2/ASV_table.tsv"),
46-
path("$outputDir/dada2/DADA2_stats.tsv"),
47-
path("$outputDir/dada2/DADA2_table.rds"),
48-
path("$outputDir/dada2/DADA2_table.tsv")).match("dada2") },
49-
{ assert snapshot(path("$outputDir/input/Samplesheet_double_primer.tsv")).match("input") },
50-
{ assert new File("$outputDir/qiime2/abundance_tables/feature-table.tsv").exists() },
51-
{ assert new File("$outputDir/phyloseq/kraken2_phyloseq.rds").exists() },
52-
{ assert new File("$outputDir/treesummarizedexperiment/kraken2_TreeSummarizedExperiment.rds").exists() },
53-
{ assert snapshot(path("$outputDir/kraken2/ASV_tax.greengenes.kraken2.classifiedreads.txt"),
54-
path("$outputDir/kraken2/ASV_tax.greengenes.kraken2.complete.tsv"),
55-
path("$outputDir/kraken2/ASV_tax.greengenes.kraken2.tsv")).match("kraken2") },
56-
{ assert snapshot(path("$outputDir/multiqc/multiqc_data/multiqc_general_stats.txt"),
57-
path("$outputDir/multiqc/multiqc_data/multiqc_cutadapt.txt")).match("multiqc") },
58-
{ assert new File("$outputDir/summary_report/summary_report.html").exists() }
5948
)
6049
}
6150
}

0 commit comments

Comments
 (0)