Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add nf-test tests and snapshots #323

Closed
wants to merge 14 commits into from
Prev Previous commit
Next Next commit
fix formatting
louperelo committed Nov 21, 2023
commit 0c8e7c1fdcf44c109a0102f6e9beee1139844279
2 changes: 1 addition & 1 deletion tests/lib/UTILS.groovy
Original file line number Diff line number Diff line change
@@ -35,4 +35,4 @@ class UTILS {
return outputFile
}
}
}
}
4 changes: 2 additions & 2 deletions tests/pipeline/test.nf.test
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ nextflow_pipeline {
{ assert new File("$outputDir/amp/macrel/sample_1/sample_1.prediction.gz").exists() },
{ assert snapshot(path("$outputDir/amp/macrel/sample_2/sample_2_log.txt"),
path("$outputDir/amp/macrel/sample_2/README.md")).match("amp_macrel_sample_2") },
{ assert new File("$outputDir/amp/macrel/sample_2/sample_2.all_orfs.faa.gz").exists() },
{ assert new File("$outputDir/amp/macrel/sample_2/sample_2.all_orfs.faa.gz").exists() },
{ assert new File("$outputDir/amp/macrel/sample_2/sample_2.prediction.gz").exists() },
{ assert snapshot(path("$outputDir/arg/abricate/").list()).match("arg_abricate") },
{ assert snapshot(path("$outputDir/arg/amrfinderplus/").list()).match("arg_amrfinderplus") },
@@ -53,7 +53,7 @@ nextflow_pipeline {
{ assert new File("$outputDir/reports/ampcombi/sample_2/sample_2_amp.faa").exists() },
{ assert new File("$outputDir/reports/ampcombi/sample_2/sample_2_ampcombi.csv").exists() },
{ assert new File("$outputDir/reports/ampcombi/sample_2/sample_2_diamond_matches.txt").exists() },
{ assert snapshot(path("$outputDir/reports/hamronization_summarize/hamronization_combined_report.tsv")).match("summary_hamronization") }
{ assert snapshot(path("$outputDir/reports/hamronization_summarize/hamronization_combined_report.tsv")).match("summary_hamronization") }
)
}

34 changes: 17 additions & 17 deletions tests/pipeline/test_all.nf.test
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ nextflow_pipeline {
run_bgc_screening = true
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/funcscan/samplesheet.csv'
}

}

then {
@@ -39,7 +39,7 @@ nextflow_pipeline {
{ assert new File("$outputDir/amp/macrel/sample_1/sample_1.prediction.gz").exists() },
{ assert snapshot(path("$outputDir/amp/macrel/sample_2/sample_2_log.txt"),
path("$outputDir/amp/macrel/sample_2/README.md")).match("amp_macrel_sample_2") },
{ assert new File("$outputDir/amp/macrel/sample_2/sample_2.all_orfs.faa.gz").exists() },
{ assert new File("$outputDir/amp/macrel/sample_2/sample_2.all_orfs.faa.gz").exists() },
{ assert new File("$outputDir/amp/macrel/sample_2/sample_2.prediction.gz").exists() },
{ assert snapshot(path("$outputDir/arg/abricate/").list()).match("arg_abricate") },
{ assert snapshot(path("$outputDir/arg/amrfinderplus/").list()).match("arg_amrfinderplus") },
@@ -79,21 +79,21 @@ nextflow_pipeline {
{ assert snapshot(path("$outputDir/bgc/antismash/sample_2/css").list()).match("bgc_antismash_css") },
{ assert snapshot(path("$outputDir/bgc/antismash/sample_2/images").list()).match("bgc_antismash_images") },
{ assert snapshot(path("$outputDir/bgc/deepbgc/sample_1/README.txt"),
path("$outputDir/bgc/deepbgc/sample_1/wastewater_metagenome_contigs_1.bgc.gbk"),
path("$outputDir/bgc/deepbgc/sample_1/wastewater_metagenome_contigs_1.pfam.tsv"),
path("$outputDir/bgc/deepbgc/sample_1/evaluation/wastewater_metagenome_contigs_1.bgc.png"),
path("$outputDir/bgc/deepbgc/sample_1/evaluation/wastewater_metagenome_contigs_1.score.png"),
path("$outputDir/bgc/deepbgc/sample_2/README.txt"),
path("$outputDir/bgc/deepbgc/sample_2/wastewater_metagenome_contigs_2.bgc.gbk"),
path("$outputDir/bgc/deepbgc/sample_2/wastewater_metagenome_contigs_2.pfam.tsv"),
path("$outputDir/bgc/deepbgc/sample_2/evaluation/wastewater_metagenome_contigs_2.bgc.png"),
path("$outputDir/bgc/deepbgc/sample_2/evaluation/wastewater_metagenome_contigs_2.score.png")).match("bgc_deepbgc") },
path("$outputDir/bgc/deepbgc/sample_1/wastewater_metagenome_contigs_1.bgc.gbk"),
path("$outputDir/bgc/deepbgc/sample_1/wastewater_metagenome_contigs_1.pfam.tsv"),
path("$outputDir/bgc/deepbgc/sample_1/evaluation/wastewater_metagenome_contigs_1.bgc.png"),
path("$outputDir/bgc/deepbgc/sample_1/evaluation/wastewater_metagenome_contigs_1.score.png"),
path("$outputDir/bgc/deepbgc/sample_2/README.txt"),
path("$outputDir/bgc/deepbgc/sample_2/wastewater_metagenome_contigs_2.bgc.gbk"),
path("$outputDir/bgc/deepbgc/sample_2/wastewater_metagenome_contigs_2.pfam.tsv"),
path("$outputDir/bgc/deepbgc/sample_2/evaluation/wastewater_metagenome_contigs_2.bgc.png"),
path("$outputDir/bgc/deepbgc/sample_2/evaluation/wastewater_metagenome_contigs_2.score.png")).match("bgc_deepbgc") },
{ assert snapshot(path("$outputDir/bgc/gecco/sample_1/wastewater_metagenome_contigs_1.clusters.tsv"),
path("$outputDir/bgc/gecco/sample_1/wastewater_metagenome_contigs_1.features.tsv"),
path("$outputDir/bgc/gecco/sample_1/wastewater_metagenome_contigs_1.genes.tsv"),
path("$outputDir/bgc/gecco/sample_2/wastewater_metagenome_contigs_2.clusters.tsv"),
path("$outputDir/bgc/gecco/sample_2/wastewater_metagenome_contigs_2.features.tsv"),
path("$outputDir/bgc/gecco/sample_2/wastewater_metagenome_contigs_2.genes.tsv"),).match("bgc_gecco") },
path("$outputDir/bgc/gecco/sample_1/wastewater_metagenome_contigs_1.features.tsv"),
path("$outputDir/bgc/gecco/sample_1/wastewater_metagenome_contigs_1.genes.tsv"),
path("$outputDir/bgc/gecco/sample_2/wastewater_metagenome_contigs_2.clusters.tsv"),
path("$outputDir/bgc/gecco/sample_2/wastewater_metagenome_contigs_2.features.tsv"),
path("$outputDir/bgc/gecco/sample_2/wastewater_metagenome_contigs_2.genes.tsv"),).match("bgc_gecco") },
{ assert snapshot(path("$outputDir/arg/hamronization/").list()).match("arg_hamronization") },
{ assert snapshot(path("$outputDir/multiqc/multiqc_data/multiqc_citations.txt"),
path("$outputDir/multiqc/multiqc_data/multiqc_sources.txt")).match("multiqc") },
@@ -105,7 +105,7 @@ nextflow_pipeline {
{ assert new File("$outputDir/reports/ampcombi/sample_2/sample_2_ampcombi.csv").exists() },
{ assert new File("$outputDir/reports/ampcombi/sample_2/sample_2_diamond_matches.txt").exists() },
{ assert snapshot(path("$outputDir/reports/hamronization_summarize/hamronization_combined_report.tsv")).match("summary_hamronization") },
{ assert new File("$outputDir/reports/combgc/combgc_complete_summary.tsv").exists() }
{ assert new File("$outputDir/reports/combgc/combgc_complete_summary.tsv").exists() }
)
}

30 changes: 14 additions & 16 deletions tests/pipeline/test_bgc.nf.test
Original file line number Diff line number Diff line change
@@ -25,7 +25,6 @@ nextflow_pipeline {
{ assert new File("$outputDir/bgc/antismash/sample_1/wastewater_metagenome_contigs_1.json").exists() },
{ assert snapshot(path("$outputDir/bgc/antismash/sample_1/css").list()).match("bgc_antismash_css") },
{ assert snapshot(path("$outputDir/bgc/antismash/sample_1/images").list()).match("bgc_antismash_images") },

{ assert new File("$outputDir/bgc/antismash/sample_2/NODE_6_length_23263_cov_4.891675.region001.gbk").exists() },
{ assert new File("$outputDir/bgc/antismash/sample_2/NODE_5815_length_1804_cov_1.983419.region001.gbk").exists() },
{ assert new File("$outputDir/bgc/antismash/sample_2/NODE_21026_length_1024_cov_1.925697.region001.gbk").exists() },
@@ -35,23 +34,22 @@ nextflow_pipeline {
{ assert snapshot(path("$outputDir/bgc/antismash/sample_2/css").list()).match("bgc_antismash_css") },
{ assert snapshot(path("$outputDir/bgc/antismash/sample_2/images").list()).match("bgc_antismash_images") },
{ assert snapshot(path("$outputDir/bgc/deepbgc/sample_1/README.txt"),
path("$outputDir/bgc/deepbgc/sample_1/wastewater_metagenome_contigs_1.bgc.gbk"),
path("$outputDir/bgc/deepbgc/sample_1/wastewater_metagenome_contigs_1.pfam.tsv"),
path("$outputDir/bgc/deepbgc/sample_1/evaluation/wastewater_metagenome_contigs_1.bgc.png"),
path("$outputDir/bgc/deepbgc/sample_1/evaluation/wastewater_metagenome_contigs_1.score.png"),
path("$outputDir/bgc/deepbgc/sample_2/README.txt"),
path("$outputDir/bgc/deepbgc/sample_2/wastewater_metagenome_contigs_2.bgc.gbk"),
path("$outputDir/bgc/deepbgc/sample_2/wastewater_metagenome_contigs_2.pfam.tsv"),
path("$outputDir/bgc/deepbgc/sample_2/evaluation/wastewater_metagenome_contigs_2.bgc.png"),
path("$outputDir/bgc/deepbgc/sample_2/evaluation/wastewater_metagenome_contigs_2.score.png")).match("bgc_deepbgc") },
path("$outputDir/bgc/deepbgc/sample_1/wastewater_metagenome_contigs_1.bgc.gbk"),
path("$outputDir/bgc/deepbgc/sample_1/wastewater_metagenome_contigs_1.pfam.tsv"),
path("$outputDir/bgc/deepbgc/sample_1/evaluation/wastewater_metagenome_contigs_1.bgc.png"),
path("$outputDir/bgc/deepbgc/sample_1/evaluation/wastewater_metagenome_contigs_1.score.png"),
path("$outputDir/bgc/deepbgc/sample_2/README.txt"),
path("$outputDir/bgc/deepbgc/sample_2/wastewater_metagenome_contigs_2.bgc.gbk"),
path("$outputDir/bgc/deepbgc/sample_2/wastewater_metagenome_contigs_2.pfam.tsv"),
path("$outputDir/bgc/deepbgc/sample_2/evaluation/wastewater_metagenome_contigs_2.bgc.png"),
path("$outputDir/bgc/deepbgc/sample_2/evaluation/wastewater_metagenome_contigs_2.score.png")).match("bgc_deepbgc") },
{ assert snapshot(path("$outputDir/bgc/gecco/sample_1/wastewater_metagenome_contigs_1.clusters.tsv"),
path("$outputDir/bgc/gecco/sample_1/wastewater_metagenome_contigs_1.features.tsv"),
path("$outputDir/bgc/gecco/sample_1/wastewater_metagenome_contigs_1.genes.tsv"),
path("$outputDir/bgc/gecco/sample_2/wastewater_metagenome_contigs_2.clusters.tsv"),
path("$outputDir/bgc/gecco/sample_2/wastewater_metagenome_contigs_2.features.tsv"),
path("$outputDir/bgc/gecco/sample_2/wastewater_metagenome_contigs_2.genes.tsv"),).match("bgc_gecco") },
path("$outputDir/bgc/gecco/sample_1/wastewater_metagenome_contigs_1.features.tsv"),
path("$outputDir/bgc/gecco/sample_1/wastewater_metagenome_contigs_1.genes.tsv"),
path("$outputDir/bgc/gecco/sample_2/wastewater_metagenome_contigs_2.clusters.tsv"),
path("$outputDir/bgc/gecco/sample_2/wastewater_metagenome_contigs_2.features.tsv"),
path("$outputDir/bgc/gecco/sample_2/wastewater_metagenome_contigs_2.genes.tsv"),).match("bgc_gecco") },
{ assert new File("$outputDir/reports/combgc/combgc_complete_summary.tsv").exists() },

)
}