Does nf-test cache input files? I feel for some of...
# nf-test
a
Does nf-test cache input files? I feel for some of my tests most of the time is spent downloading the data and, but it's not always possible to make the data smaller, so I'm wondering if there are other ways to speed up my tests
n
No every test has a different work directory so it needs to redownload the test files
😟 1
m
yeah, that's unfortunate for now
n
I do wonder if anything would break if all tests use the same work dir though, it shouldn't have any influence if
-resume
isn't used
maybe you could try adding an option with a work dir location to all tests
👍 1
m
you can't use resume in nf-test
but yeah, staging the files locally before the test might work, but then with sharding not all tests might use the same data
n
options "-work-dir $baseDir/.nf-test/work"
might do the trick. You just need to add it at the top of every test file
(untested though)
m
Interesting idea
🎉 1
a
Hmm, nf-test didn't like
$baseDir
, I tried with a relative path instead, but I get the following error message:
Copy code
Can only specify option -w once.
n
ah that's sad, seems like nf-test already adds the work dir option when running it 😕
not sure we can do much about this then until we change nf-test
a
Do you think it would be possible to solve this with a new nf-test plugin? I'm wondering if this would fall within their scope 🤔
n
no nf-test plugins are pretty limited in what they can actually do. Something like this is not possible AFAIK, but feel free to try if you want, I'd love to be wrong about this 😛
🙈 1
a
Too bad, I'll try to trim my test data more aggressively then, thanks for the help 🙂
n
Good luck, it might also be a good idea to create an issue about this if you want
👍 1
m
Same, for me plugins for nf-test won't have the same power as plugins for Nextflow
👍 1
a
There already was an issue about this 😄 https://github.com/askimed/nf-test/issues/76
🙌 1
j
One workaround is that you can write arbitrary Groovy in the setup block (e.g. https://github.com/sanger-tol/metagenomeassembly/blob/main/tests/default.nf.test). So you could have a global setup block which stages the files to a fixed location (somewhere inside the
.nf-test
directory, maybe), first checking to see if they exist there already. Would be pretty robust to sharding, assuming the shards are running on different instances?
👍 1