-
Notifications
You must be signed in to change notification settings - Fork 23
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
Individual Process Testing Where You can Use another process' output as input for the next one #70
Comments
Couldn't you just write a test workflow that channels all the outputs between the processes and perform a test on this workflow? :) |
Thank you for your response @nvnieuwk but, I would like to re-open this issue if possible to get more insights. ping @lukfor @seppinho
Example of Dependent module test: include { ABRICATE_RUN } from '../../../../../modules/nf-core/abricate/run/main.nf'
include { ABRICATE_SUMMARY } from '../../../../../modules/nf-core/abricate/summary/main.nf'
workflow test_abricate_summary {
inputs = [
tuple([ id:'test1', single_end:false ], // meta map
file(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true)),
tuple([ id:'test2', single_end:false ],
file(params.test_data['haemophilus_influenzae']['genome']['genome_fna_gz'], checkIfExists: true))
]
ABRICATE_RUN ( Channel.fromList(inputs) )
ABRICATE_SUMMARY (
ABRICATE_RUN.out.report.collect{ meta, report -> report }.map{ report -> [[ id: 'test_summary'], report]}
)
}
Ideal solution: nf-test nextflow_process {
name "Test Process ABRICATE_SUMMARY"
script "modules/nf-core/abricate/summary/main.nf"
process "ABRICATE_SUMMARY"
depends "ABRICATE_RUN" // requires the test file to be present & runs it before executing the current one
test("ABRICATE_SUMMARY") {
when {
params {
// define parameters here. Example:
// outdir = "tests/results"
}
process {
"""
// define inputs of the process here. Example:
input[0] = ABRICATE_RUN.out.report.collect{ meta, report -> report }.map{ report -> [[ id: 'test_summary'], report]}
"""
}
}
then {
assert process.success
assert snapshot(process.out).match()
}
}
} I would be interested to hear your thoughts on the feasabilty of the idea proposed or if you have any other ways we can tackle dependent modules. Thanks a ton for all your work ❤️ |
Good point, we're looking into that to find a solution that fits within the nf-test concept |
hello @seppinho checking in to see the status of this issue and if there is any way I could help? |
I wanted to follow up on this issue. This particular issue is critical for its adoption in nf-core. We have a hackathon coming up in October, and it would greatly benefit from having this feature implemented. Could we get an update on any progress or a tentative timeline? Your assistance will significantly impact our productivity during the hackathon. Thanks for your hard work and understanding. |
Thanks @sateeshperi ! Quite a few nf-core/modules use chained processes in this way to overcome the need to generate intermediate test data files. Be awesome to have this implemented natively in nf-test. |
With PR #127, it is now possible to specify processes in the setup method that need to be executed before the For example, the following testcase for the
The full example can be found here: https://github.com/askimed/nf-test/tree/features/dependencies/test-data/process/abricate/summary/tests and more details in PR #127 Happy to hear your feedback! @sateeshperi @drpatelh @emiller88 @nvnieuwk @maxulysse 🚀 |
works like a charm @lukfor Thanks for the
|
So I am grateful for the recent updates to nf-test. I can now get multiple process tests even if they are in the same file. I know there's pipeline tests, which I've ran successfully, but my team prefers multiple process tests specifically. I was wondering if there's a way to access the outputs of other processes like how it would be done on regular nextflow. Example: flye(guppy_ch.fastq). Can the tests emit outputs too? And can those inputs be passed as input?
The text was updated successfully, but these errors were encountered: