Don't execute cleanup on dry run#330
Conversation
|
Thanks! 🙏🏼 |
|
Hi @prototaxites what exceptions are thrown in the setup block? |
|
That should say exceptions thrown in the cleanup block... 🤦♂️ See https://github.com/sanger-tol/nf-core-modules/blob/main/subworkflows/sanger-tol/cram_map_illumina_hic/tests/main.nf.test for an example - in the I ended up fixing the function ( |
Yeah that's what I meant 😅, could you provide some small reproducible example? I want to be sure that this is not a deeper problem first |
|
main.nf.test: Testing the following dummy module: Normal run: Dry run: |
|
I haven’t checked the code closely for side effects yet, but it makes sense to me that cleanup behaves the same way as setup. |
Hi, thanks for the fantastic software!
We are running into a small problem with nf-test where we are including the cleanup block in tests. The cleanup block is always executed, which means that exceptions thrown in the block stop the dry run - we are running into this problem with this test (https://github.com/sanger-tol/nf-core-modules/blob/main/modules/sanger-tol/hiccramalign/minimap2align/tests/main.nf.test) where we are using some functions from nft-utils to cleanup a temporary modules library that is initialised in the
setupblock.This PR just moves the cleanup line into the section that checks if a dry run is being executed, which should side-step the problem. Not sure if this is the optimal way to do this, so happy to discuss :)