fix(modules): replace invalid touch .gz stubs with valid gzip#11312
Conversation
|
@nf-core-bot fix linting |
Fixes nf-core#5409. Replaces `touch filename.gz` with `echo '' | gzip > filename.gz` in stub blocks for 8 modules. Empty files created by `touch` are not valid gzip and cause `EOFException` in nf-test snapshot assertions. Modules fixed: - bowtie2/align (unmapped .fastq.gz stubs) - gatk4/haplotypecaller - metamdbg/asm - pharokka/installdatabases - popscle/freemuxlet - rastair/methylkit - staramr/search - vt/decomposeblocksub
6cf2e08 to
d02fd2f
Compare
CI Lint Failures — Pre-existing, Unrelated to This PRThe 4 remaining lint failures are pre-existing issues on
These modules already fail The 4 modules that only had the stub issue ( |
| create_unmapped = save_unaligned ? "echo '' | gzip > ${prefix}.unmapped.fastq.gz" : "" | ||
| } else { | ||
| create_unmapped = save_unaligned ? "touch ${prefix}.unmapped_1.fastq.gz && touch ${prefix}.unmapped_2.fastq.gz" : "" | ||
| create_unmapped = save_unaligned ? "echo '' | gzip > ${prefix}.unmapped_1.fastq.gz && echo '' | gzip > ${prefix}.unmapped_2.fastq.gz" : "" |
There was a problem hiding this comment.
| create_unmapped = save_unaligned ? "echo '' | gzip > ${prefix}.unmapped_1.fastq.gz && echo '' | gzip > ${prefix}.unmapped_2.fastq.gz" : "" | |
| create_unmapped = save_unaligned ? "echo | gzip > ${prefix}.unmapped_1.fastq.gz && echo | gzip > ${prefix}.unmapped_2.fastq.gz" : "" |
FYI: just echo | gzip is enough :) but as is is fine
There was a problem hiding this comment.
Thanks for pointing that out! I had templated echo "" uniformly in my local AST mutation script to be overly cautious, but I agree your suggestion is much cleaner. I'm going to go ahead and make those updates. Brb!
There was a problem hiding this comment.
Updated! All 8 modules now use echo | gzip > with the quotes dropped, as suggested. Pushed as a new commit.
Separately, while building the AST mutation script for this fix, my analysis also flagged ~44 additional modules that are completely missing stub: blocks entirely. I'm tracking that work under 4570 to keep this PR scoped strictly to the touch .gz → echo | gzip fix.
|
I think you either need to swap the failed modules to topics as well here or @mashehu overwrites and merges :D |
|
i can force merge, once @famosab suggestions have been accepted |
|
I think we are good to go @mashehu |
Description
Fixes #5409. Replaces
touch filename.gzwithecho '' | gzip > filename.gzin stub blocks for 8 modules. Empty files created bytouchare not valid gzip and causeEOFExceptionin nf-test snapshot assertions.After this PR,
git grep -cP "touch .*\.gz(\\s+.*)*$" -- 'modules/'returns zero matches across the entire repository.Modules Fixed
bowtie2/align— unmapped.fastq.gzstubs (supplementary to PR Updated a bunch of modules that failed nf-test because of the generation of compressed files using touch #7978)gatk4/haplotypecallermetamdbg/asmpharokka/installdatabasespopscle/freemuxletrastair/methylkitstaramr/searchvt/decomposeblocksubFix Pattern
PR Checklist
touch filename.gzreplaced withecho '' | gzip > filename.gznf-core modules test --updateif requested