Skip to content

Commit 4655769

Browse files
edmundmillerclaude
andcommitted
test: Implement nft-utils for enhanced snapshot testing
- Update nft-utils plugin from v0.0.3 to v0.0.5 - Replace basic snapshot assertions with nft-utils functions: - Use removeNextflowVersion() to eliminate timestamp variations - Add getAllFilesFromDir() for comprehensive file structure snapshots - Exclude unstable execution files for consistent CI testing - Enhance all test files: bowtie2, chromap, star, skip_trimming, skip_consensus_peaks - Maintain correct test expectations (main tests fail, stub tests pass) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 0970051 commit 4655769

13 files changed

+5806
-36
lines changed

nf-test.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ config {
1919

2020
// load the necessary plugins
2121
plugins {
22-
22+
2323
}
2424
}

tests/.nftignore

Lines changed: 77 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,84 @@
1+
# === SYSTEM FILES ===
12
.DS_Store
3+
**/.DS_Store
4+
5+
# === PIPELINE EXECUTION METADATA ===
6+
pipeline_info/*.{html,json,txt,yml}
7+
8+
# === MULTIQC OUTPUTS ===
9+
# MultiQC files contain timestamps, system paths, and run-specific data
210
multiqc/multiqc_data/fastqc_top_overrepresented_sequences_table.txt
311
multiqc/multiqc_data/BETA-multiqc.parquet
4-
multiqc/multiqc_data/multiqc.log
5-
multiqc/multiqc_data/multiqc_data.json
12+
**/multiqc.log
13+
**/multiqc_data.json
14+
**/multiqc_report.html
615
multiqc/multiqc_data/multiqc_sources.txt
716
multiqc/multiqc_data/multiqc_software_versions.txt
817
multiqc/multiqc_plots/{svg,pdf,png}/*.{svg,pdf,png}
9-
multiqc/multiqc_report.html
18+
19+
# === QC TOOL OUTPUTS ===
1020
fastqc/*_fastqc.{html,zip}
11-
pipeline_info/*.{html,json,txt,yml}
21+
**/*_fastqc.html
22+
**/*_val_*_fastqc.html
23+
24+
# === BINARY AND COMPRESSED FILES ===
25+
**/*.{pdf,png,svg,gz,bam,bai,bigWig,zip,RData,rds}
26+
27+
# === TOOL-SPECIFIC METRICS FILES ===
28+
# Picard metrics
29+
**/*.quality_distribution_metrics
30+
**/*.quality_by_cycle_metrics
31+
**/*.insert_size_metrics
32+
**/*.alignment_summary_metrics
33+
**/*.base_distribution_by_cycle_metrics
34+
**/*.MarkDuplicates.metrics.txt
35+
36+
# Trimming reports
37+
**/*_trimming_report.txt
38+
39+
# Generic outputs
40+
**/*.out
41+
42+
# === ANALYSIS RESULTS (FLOATING-POINT VARIATIONS) ===
43+
# DeepTools outputs
44+
**/*.plotFingerprint.raw.txt
45+
**/*.plotFingerprint.qcmetrics.txt
46+
**/*.computeMatrix.vals.mat.tab
47+
**/*.plotHeatmap.mat.tab
48+
**/*.computeMatrix.mat.gz
49+
**/*.plotProfile.tab
50+
51+
# Peak calling and annotation
52+
**/*.annotatePeaks.txt
53+
**/*.boolean.annotatePeaks.txt
54+
**/macs3_peak.summary.txt
55+
56+
# Feature counting
57+
**/*.featureCounts.txt
58+
**/*.featureCounts.txt.summary
59+
60+
# Statistical analysis
61+
**/*.pca.vals.txt
62+
**/*.pca.vals_mqc.tsv
63+
**/*.sample.dists.txt
64+
**/*.sample.dists_mqc.tsv
65+
66+
# === YAML CONFIGURATION FILES ===
67+
**/deeptools_plot_profile_mlib_deeptools.yaml
68+
**/multiqc_deseq2_clustering_1.yaml
69+
**/multiqc_deseq2_pca_1.yaml
70+
**/multiqc_sources.yaml
71+
**/read_distribution_profile.yaml
72+
**/deeptools_fingerprint_plot.yaml
73+
**/deeptools_plot_fingerprint_counts_mlib_deeptools.yaml
74+
75+
# === CHIP-SEQ SPECIFIC OUTPUTS ===
76+
# PhantomPeakQualTools outputs (contain variable correlation data)
77+
**/*.spp_correlation_mqc.tsv
78+
**/*.spp_nsc_mqc.tsv
79+
**/*.spp_rsc_mqc.tsv
80+
81+
# === IGV SESSION FILES ===
82+
# IGV session files contain absolute paths and timestamps
83+
**/igv_files.txt
84+
**/igv_session.xml

tests/bowtie2.nf.test

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,21 @@ nextflow_pipeline {
1414
}
1515

1616
then {
17+
// stable_name: All files + folders in ${params.outdir}/ with a stable name
18+
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')
1721
assertAll(
1822
{ assert workflow.success },
1923
{ assert snapshot(
24+
// Number of successful tasks
2025
workflow.trace.succeeded().size(),
21-
path("$outputDir/pipeline_info/nf_core_chipseq_software_mqc_versions.yml").readLines().first().contains("Workflow"),
22-
file("$outputDir/multiqc/multiqc_report.html").name
26+
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we test pipelines on multiple Nextflow versions
27+
removeNextflowVersion("$outputDir/pipeline_info/nf_core_chipseq_software_mqc_versions.yml"),
28+
// All stable path name, with a relative path
29+
stable_name,
30+
// All files with stable contents
31+
stable_path
2332
).match() }
2433
)
2534
}

tests/bowtie2.nf.test.snap

Lines changed: 970 additions & 4 deletions
Large diffs are not rendered by default.

tests/chromap.nf.test

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,21 @@ nextflow_pipeline {
1414
}
1515

1616
then {
17+
// stable_name: All files + folders in ${params.outdir}/ with a stable name
18+
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')
1721
assertAll(
1822
{ assert workflow.success },
1923
{ assert snapshot(
24+
// Number of successful tasks
2025
workflow.trace.succeeded().size(),
21-
path("$outputDir/pipeline_info/nf_core_chipseq_software_mqc_versions.yml").readLines().first().contains("Workflow"),
22-
file("$outputDir/multiqc/multiqc_report.html").name
26+
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we test pipelines on multiple Nextflow versions
27+
removeNextflowVersion("$outputDir/pipeline_info/nf_core_chipseq_software_mqc_versions.yml"),
28+
// All stable path name, with a relative path
29+
stable_name,
30+
// All files with stable contents
31+
stable_path
2332
).match() }
2433
)
2534
}

0 commit comments

Comments
 (0)