So I found a wierd thing when trying to test a loc...
# nf-test
j
So I found a wierd thing when trying to test a local module in a pipeline, and @Evangelos Karatzas and I don't understand the behaviour. So I've written a local module under
modules/local/<name>/
and it has it's own independent tests. Yet when I run
nf-test test --tag summarisepydamage --profile test,docker --verbose --debug --update-snapshot
or
nf-test test --tag modules/local/summarisepydamage/tests/main.nf --profile test,docker --verbose --debug --update-snapshot
The test 'fails' because it doesn't get
meta.id
from the test input itself, but rather it appears
nf-test
is importing
conf/modules.config
and applying the pipeline-level
withName
customisation there...
n
So this is a quite common issue. nf-test will use your pipeline configuration to test everything as closely as possible. You can fix this by prepending the subworkflow name to each process in the
modules.config
file. I've done something similar in this config: https://github.com/nf-cmgg/smallvariants/blob/main/conf/modules.config
this 1
e
I love this!!! Prepending everything with full subworkflow paths would also make configs pipeline-chaining ready, in case of mega-pipelines
🎉 2
j
I have to admit that's a bit annoying if you want to re-use a module in multiple places with the same settings (so essentially duplicate or very complkciatd
withName:
, but I see the logic... maybe something to add to linting/warning/guidelines? @Evangelos Karatzas want to propose this in #C043UU89KKQ for feedback
👍 1
n
In that case I use this pattern:
^PIPELINE_NAME.*MODULE_NAME$
. This will apply the same settings to all processes but only if they are run by the pipeline
👍 2
e
Nicolas which is your main pipeline so I can have for reference 😛
a
I personally add
(.*:)?
to the start of
withName
regexes because it allows for the subworkflows or parent workflow to change depth (ie workflow chaining) and for the names to still work properly
🙌 1
n
`SMALLVARIANTS`in this case
⭐ 1