Since nf-test supports topics we can safely start ...
# hackathon-oct-2025-versions-topics-adoption
n
Since nf-test supports topics we can safely start removing the specific versions emits
🎉 1
m
might need to updated linting...
n
Ah didn't think of that! I'll check if it works
m
we need to keep it for the modules using template
m
yep, can make a specific lint exception for version.yml in the output
n
yeah linting gives an error when I removed the emit
l
Will it be snapshoted with process.out ? If so, all modules test will fail 🤔
n
nope you need to specifically snapshot the topics
m
so we need to add
snapshot(topics.version)
?
n
yes and
topics "versions"
at the top of the test file so that it actually checks for the versions topic
m
there goes the one line assert test 👋🏻 sad cowboy
l
Nooo 😭
n
you can also do
snapshot(process.out, topics).match()
👍 1
🤩 1
m
ah, nice! but we still need to add topics at the top?
n
yes there is no way to get all topic names codewise unfortunately
👍🏻 1
but that's just like
tag
so it shouldn't be a huge problem
we can add it to the modules template
m
yep, that's fine.
🎉 1
n
You can see an example from a test PR here: github.com/nf-cmgg/wisecondorx/blob/…/main.nf.test
m
and it doesn't do anything if you don't have topics, right?
n
yes you'll just get an empty map if you forget to add it
m
could we add the name of the topic to the snapshot. can get confusing otherwise with multiple topics captured: https://github.com/nf-core/seqinspector/blob/8c1e4a40e88325f1342ff067f00efb5949d62f00/modules/local/rundirparser/tests/main.nf.test.snap#L9-L11
n
You can snapshot all topics (
snapshot(topics).match()
) and that would show up as a dictionary with the topic name as key and the topic contents as value
👍🏻 1
👀 1
m
ah, the problem is that is is written as
Copy code
assert snapshot(
                topics.multiqc_files,
                topics.versions
            ).match()
?
n
Yes 😛
👍🏻 1
m
Oh, I can fix this
🙌 1
m
done in a upcoming comment 😉
🙌 1
m
thanks for the thourough reviewing @mashehu
merged that one too fast, now I have to do another one 😆
🤣 1