Add nf-test unit coverage for critical fgbio processes - #201
Draft
FerriolCalvet with Copilot wants to merge 4 commits into
Draft
FerriolCalvet with Copilot wants to merge 4 commits into
FerriolCalvet with Copilot wants to merge 4 commits into
Conversation
Open
Copilot
AI
changed the title
[WIP] Add unit tests for critical pipeline steps
Add nf-test unit coverage for critical fgbio processes
Jul 31, 2026
Member
|
@copilot can you expand the coverage to more modules? |
Add stub and real-execution (snapshot-based) unit tests for the modules directly affected by the fgbio -> fgumi migration (GroupReadsByUmi, CallDuplexConsensusReads, FilterConsensusReads, CollectDuplexSeqMetrics) plus previously untested ones (VarDict chain, ASMINUSXS), so regressions can be pinpointed to a single module instead of only being visible at the end of the full pipeline. Also fixes two pre-existing bugs found along the way (ASMINUSXS and CollectDuplexSeqMetrics stub blocks).
Member
|
Member
SummaryAdds process-level
New coverage
Real fixtures
./tests/test_data/modules/generate_real_fixtures.sh
nf-test test tests/modules/fgbio/*.nf.test tests/modules/local/*.nf.test --tag real_data --update-snapshot
tests/test_data/modules/publish_intermediates.config is an optional helper to force-publish the intermediate BAMs from a fresh end-to-end run, for generating fixtures from a specific pipeline version instead of the existing reference run.Test plan
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds process-level nf-test coverage for critical non-Python steps, starting with
groupreadsbyumi,callduplexconsensusreads, andfilterconsensusreads. It also establishes reusable module-test infrastructure so additional process tests can be added with minimal friction.Process-level unit tests (nf-test)
FGBIO_GROUPREADSBYUMIFGBIO_CALLDUPLEXCONSENSUSREADSFGBIO_FILTERCONSENSUSREADSFGBIO_COLLECTDUPLEXSEQMETRICSStub support for targeted critical modules
stub:blocks to the three requested critical process modules so unit tests can run in isolated mode without full runtime inputs/tooling.versions.yml.Module test scaffolding
tests/modules/nextflow.configfor local, self-contained process test execution.tests/test_data/modules/fgbio/for deterministic module tests.Documentation updates
tests/README.mdwith new module-test layout and direct commands for running process-level nf-test suites.nextflow_process { script "../../../modules/nf-core/fgbio/groupreadsbyumi/main.nf" process "FGBIO_GROUPREADSBYUMI" test("stub run emits grouped BAM and histogram") { options "-stub" when { process { """ input[0] = [[id: 'B5'], file(params.module_testdata_base + '/B5.tagged.bam', checkIfExists: true)] input[1] = 'paired' """ } } then { assert process.out.bam[0][1].name == 'B5_umi-grouped.bam' assert process.out.histogram[0][1].name == 'B5_umi_histogram.txt' } } }