Hi, I have a question regarding using regex in nf-...
# nf-test
s
Hi, I have a question regarding using regex in nf-test and would need a review please One of my pipeline level test failed for one file due to minor floating point differences: https://github.com/nf-core/metapep/pull/159#issuecomment-3422783773 This issue did not occur before the template update. There are several hypothetical options how to overcome this problem, like: • changing the python script to round digits • rounding digits in the nextflow process • adding this one failing file to the .nftignore (just for the time being to merge the template update) • check fewer lines to be exactly identical (https://github.com/nf-core/metapep/actions/runs/18655486121/job/53183478175?pr=159#step:4:725) • ... Since this is a template update only, I don't think it is appropriate to change the Nextflow process or script here. However, I was wondering if it is possible to check for matching lines based on regex. In my current test setup I (where all tests are passing) I am checking several lines for their content like this: lines[0] should contain "20495\t0.0664180848333571\t0"
Copy code
# testing with regex
assert lines[0].toString() =~ /20495\t0.066418084833357[0-9]\t0/
Is this a correct way of testing? Thanks for suggestions and help!
m
We add similar issues with @Famke Bäuerle
f
puh not sure if I remember this correctly
m
controlfreec, no?
the vcfs?
f
ah I mean we just assert then the vcf summary I think
m
yeah, but you went deep #down-the-rabbit-hole with that one
🫠 1