modules icon indicating copy to clipboard operation
modules copied to clipboard

added nf-tests for crisprcleanr/normalize module

Open LeonHornich opened this issue 1 year ago • 7 comments

Added nf-tests to modules/nf-core/crisprcleanr/normalize module

Added:

  • crisprcleanr/normalize/tests subfolder containing main.nf.test, main.nf.test.snap and tags.yml

test runs successfully using nf-test test --tag crisprcleanr_normalize --profile dockerusing docker

LeonHornich avatar Jun 03 '24 09:06 LeonHornich

Hi, i am new to this and have mostly been following the bytesize talk. How do i add stub tests? I have found https://nf-co.re/docs/tutorials/nf-core_components/components but I am still a bit clueless. Thank you for your help

LeonHornich avatar Jun 03 '24 10:06 LeonHornich

To add a stub test, copy the test and add a line options "-stub" above the when. But the module itself is missing a stub, so that'd need adding too. A stub is some code that doesn't actually do anything in the module except produce the expected output files, but allows you to check that the modules are plugged together in the pipeline end-to-end. There isn't a stub here at the moment, so it'd be good to add one.

SPPearce avatar Jun 03 '24 11:06 SPPearce

@LeonHornich , do you need a hand to finish this off?

SPPearce avatar Aug 14 '24 09:08 SPPearce

@LeonHornich , do you need a hand to finish this off?

Hey, sorry for the inconvenience. I forgot about this PR and got busy with other work. I want to understand the implementation, so i'll give it a try soon. In case i need help i'll let you know @SPPearce

LeonHornich avatar Aug 14 '24 09:08 LeonHornich

One snapshot per test should be enough - you can directly assert the whole output :)

I just pushed the changes, let's see. In https://github.com/nf-core/modules/pull/5740/commits/797104e150065f0cb01e72f37a986fefbb75d0b1 i changed the stub test and encountered failing checks on github. That's why i decided to change it in https://github.com/nf-core/modules/pull/5740/commits/96d5e11fc74c90d08f88f4d97858151c0a4039b6 . But maybe the originally failing checks where not because of the stub assertions but because of the assertions for the main module tests

LeonHornich avatar Aug 29 '24 09:08 LeonHornich

If anyone wants to help or play around with it feel free to do so. Maybe there is something in the stub that i am not aware of that causes the tests to fail

LeonHornich avatar Aug 29 '24 09:08 LeonHornich

I think the snap file has to be updated by running nf-core modules test crisprcleanr/normalize -u locally and pushed to this PR - then the tests should succeed :)

famosab avatar Aug 29 '24 11:08 famosab

Let's get this in.

SPPearce avatar Jan 08 '25 09:01 SPPearce