Skip to content

Commit

Permalink
Merge pull request #75 from Aratz/nft-utils
Browse files Browse the repository at this point in the history
Set up nft-utils in tests
  • Loading branch information
Aratz authored Feb 13, 2025
2 parents 826a811 + 0372247 commit 80f0095
Show file tree
Hide file tree
Showing 9 changed files with 1,064 additions and 85 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Initial release of nf-core/seqinspector, created with the [nf-core](https://nf-c

### `Added`

- [#75](https://github.com/nf-core/seqinspector/pull/75) Set up nft-utils
- [#68](https://github.com/nf-core/seqinspector/pull/68) Add tool selector
- [#20](https://github.com/nf-core/seqinspector/pull/20) Use tags to generate group reports
- [#13](https://github.com/nf-core/seqinspector/pull/13) Generate reports per run, per project and per lane.
Expand Down
3 changes: 3 additions & 0 deletions nf-test.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ config {
configFile "tests/nextflow.config"
profile "test,docker"

plugins {
load "[email protected]"
}
}
12 changes: 12 additions & 0 deletions tests/.nftignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.DS_Store
multiqc/{global_report,group_reports/*}/multiqc_data/multiqc.log
multiqc/{global_report,group_reports/*}/multiqc_data/multiqc_data.json
multiqc/{global_report,group_reports/*}/multiqc_data/multiqc_general_stats.txt
multiqc/{global_report,group_reports/*}/multiqc_data/multiqc_software_versions.txt
multiqc/{global_report,group_reports/*}/multiqc_data/multiqc_sources.txt
multiqc/{global_report,group_reports/*}/multiqc_data/fastqc_top_overrepresented_sequences_table.txt
multiqc/{global_report,group_reports/*}/multiqc_plots/{svg,pdf,png}/*.{svg,pdf,png}
multiqc/{global_report,group_reports/*}/multiqc_report.html
pipeline_info/*.{html,json,txt,yml}
fastqscreen/*_screen.html
fastqc/*_fastqc.{html,zip}
90 changes: 76 additions & 14 deletions tests/MiSeq.main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,28 @@ nextflow_pipeline {
}

then {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = getAllFilesFromDir(
params.outdir,
relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']
)
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = getAllFilesFromDir(
params.outdir,
ignoreFile: 'tests/.nftignore'
)
assertAll(
{ assert workflow.success },
{ assert workflow.success},
{ assert snapshot(
path("$outputDir/multiqc/global_report/multiqc_data/multiqc_citations.txt"),
path("$outputDir/multiqc/global_report/multiqc_data/multiqc_fastqc.txt"),
path("$outputDir/multiqc/global_report/multiqc_data/multiqc_general_stats.txt"),
path("$outputDir/multiqc/global_report/multiqc_data/multiqc_fastq_screen.txt"),
).match()
}
// Number of successful tasks
workflow.trace.succeeded().size(),
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
removeNextflowVersion("$outputDir/pipeline_info/nf_core_seqinspector_software_mqc_versions.yml"),
// All stable path names, with a relative path
stable_name,
// All files with stable contents
stable_path
).match() }
)
}
}
Expand All @@ -38,15 +51,64 @@ nextflow_pipeline {
}

then {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = getAllFilesFromDir(
params.outdir,
relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']
)
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = getAllFilesFromDir(
params.outdir,
ignoreFile: 'tests/.nftignore'
)
assertAll(
{ assert workflow.success},
{ assert snapshot(
// Number of successful tasks
workflow.trace.succeeded().size(),
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
removeNextflowVersion("$outputDir/pipeline_info/nf_core_seqinspector_software_mqc_versions.yml"),
// All stable path names, with a relative path
stable_name,
// All files with stable contents
stable_path
).match() }
)
}
}

test("Miseq data test (skip all tools)") {
when {
config "./MiSeq.main.nf.test.config"
params {
outdir = "$outputDir"
skip_tools = "fastqc,fastqscreen,seqfu_stats,seqtk_sample"
}
}

then {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name = getAllFilesFromDir(
params.outdir,
relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']
)
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = getAllFilesFromDir(
params.outdir,
ignoreFile: 'tests/.nftignore'
)
assertAll(
{ assert workflow.success },
{ assert workflow.success},
{ assert snapshot(
path("$outputDir/multiqc/global_report/multiqc_data/multiqc_citations.txt"),
).match()
},
{
assert !path("$outputDir/multiqc/global_report/multiqc_data/multiqc_fastqc.txt").exists()
}
// Number of successful tasks
workflow.trace.succeeded().size(),
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
removeNextflowVersion("$outputDir/pipeline_info/nf_core_seqinspector_software_mqc_versions.yml"),
// All stable path names, with a relative path
stable_name,
// All files with stable contents
stable_path
).match() }
)
}
}
Expand Down
Loading

0 comments on commit 80f0095

Please sign in to comment.