I'm having some trouble to create tests for my new...
# modules
m
I'm having some trouble to create tests for my new module (rtn/tna) as the tool errors out when the results are supposedly not biologically meaningful, and I haven't been able to make it work with the existing data. The tool is an R package and it already comes with some data that can be loaded in R from the package (e.g.
data(tnaData)
). My question is: Should I extract this test data into files and add to the test-datasets repo through a PR? Is it fine to test this module without using files, as the R package comes with data for testing it?
j
Depending on the size, I think yes you should copy it to test-datasets I don't really understand 'test this module without using files'. You need ot make sure the module is working, which is different from the R package itself is working
m
I don't really understand 'test this module without using files'.
It was a poor word of choices, sorry. I meant to use R code in the test to write the data inside the R package to files and then test it, without using the test-dataset repository at all.
So in the end, there are files being used. It's just that they're generated during the test, without test-datasets at all.
Should I go for this option or host them in test-datasets? The files are very small, by the way.
j
Ah I see, you could generate the test data on the fly yes
But ideally not with custom R code in a custom module
m
It would be in the test file the code to generate the files. What’s your opinion? Upload to test-datasets instead?
j
Do you have PR? Might be easier to evaluate (also with kids ATM so can't fully concentrate)
m
Yup. https://github.com/nf-core/modules/pull/5687 But the only test there is a stub test. The thing is that for the next tests, the package expects some meaningful results otherwise it errors out. That's why I need biologically sound data and I wasn't able to get it with the test-dataset. After multiple tests, it became clear I need to prepare some data for this module tests 😅
j
Yeah, if it's small I would jsut upload to test-datasets
in a folder under
delete_me
(as the input files seem very specific)
m
Ok. Thanks, @James Fellows Yates!
👍 1