whcih I'm taking from: <https://nf-co.re/docs/cont...
# nf-test
m
so you're doing a modules/worfklow test?
j
Module
I've just open the PR: v
s
j
That's not really helping me though is it?
My issue is
file
or path` does not seem to be working on alist of files
It's not the csv file itsel
s
you need to properly invoke path() to files I think
j
What do you mean?
I gues tried:
Copy code
file(process.out.summary_tables[0][1]).name,
                        file(process.out.figures[0][1]).name,
and got
Copy code
groovy.lang.MissingMethodException: No signature of method: static com.askimed.nf.test.lang.extensions.GlobalMethods.file() is applicable for argument types: (ArrayList) values: [[/home/james/git/jfy133/nf-core-modules/.nf-test/tests/8306e8bf75f7060a1bfdaa04f95ebc4b/work/93/c36b4a15ed089b7907f8092efffb82/data_tables/Bdb.csv, ...]]
s
try
.collect()
before .list
and println
path(process.out.summary_tables.get(0).get(1))
to debug
j
But I mean the example here doesn't use
collect()
?
Ah wait theexampel doesn't match the actual module
Teh contents of the channel looks like:
Copy code
[[[id:test, single_end:false], [/home/james/git/jfy133/nf-core-modules/.nf-test/tests/66dc8e269d3139ec4bfa2b871ea09e8f/work/48/a129f499f406ff2e35784897934864/data_tables/Bdb.csv, /home/james/git/jfy133/nf-core-modules/.nf-test/tests/66dc8e269d3139ec4bfa2b871ea09e8f/work/48/a129f499f406ff2e35784897934864/data_tables/Cdb.csv, /home/james/git/jfy133/nf-core-modules/.nf-test/tests/66dc8e269d3139ec4bfa2b871ea09e8f/work/48/a129f499f406ff2e35784897934864/data_tables/Mdb.csv, /home/james/git/jfy133/nf-core-modules/.nf-test/tests/66dc8e269d3139ec4bfa2b871ea09e8f/work/48/a129f499f406ff2e35784897934864/data_tables/Ndb.csv, /home/james/git/jfy133/nf-core-modules/.nf-test/tests/66dc8e269d3139ec4bfa2b871ea09e8f/work/48/a129f499f406ff2e35784897934864/data_tables/Sdb.csv, /home/james/git/jfy133/nf-core-modules/.nf-test/tests/66dc8e269d3139ec4bfa2b871ea09e8f/work/48/a129f499f406ff2e35784897934864/data_tables/Wdb.csv, /home/james/git/jfy133/nf-core-modules/.nf-test/tests/66dc8e269d3139ec4bfa2b871ea09e8f/work/48/a129f499f406ff2e35784897934864/data_tables/Widb.csv, /home/james/git/jfy133/nf-core-modules/.nf-test/tests/66dc8e269d3139ec4bfa2b871ea09e8f/work/48/a129f499f406ff2e35784897934864/data_tables/genomeInformation.csv]]]
s
what u c with this
Copy code
println path(process.out.summary_tables[0][0][1])
j
I just got to:
Copy code
println(process.out.summary_tables.get(0).get(1))
which gives me
Copy code
[/home/james/git/jfy133/nf-core-modules/.nf-test/tests/66dc8e269d3139ec4bfa2b871ea09e8f/work/3a/92334bebf905f24fe45f6b4a1555e4/data_tables/Bdb.csv, /home/james/git/jfy133/nf-core-modules/.nf-test/tests/66dc8e269d3139ec4bfa2b871ea09e8f/work/3a/92334bebf905f24fe45f6b4a1555e4/data_tables/Cdb.csv, /home/james/git/jfy133/nf-core-modules/.nf-test/tests/66dc8e269d3139ec4bfa2b871ea09e8f/work/3a/92334bebf905f24fe45f6b4a1555e4/data_tables/Mdb.csv, /home/james/git/jfy133/nf-core-modules/.nf-test/tests/66dc8e269d3139ec4bfa2b871ea09e8f/work/3a/92334bebf905f24fe45f6b4a1555e4/data_tables/Ndb.csv, /home/james/git/jfy133/nf-core-modules/.nf-test/tests/66dc8e269d3139ec4bfa2b871ea09e8f/work/3a/92334bebf905f24fe45f6b4a1555e4/data_tables/Sdb.csv, /home/james/git/jfy133/nf-core-modules/.nf-test/tests/66dc8e269d3139ec4bfa2b871ea09e8f/work/3a/92334bebf905f24fe45f6b4a1555e4/data_tables/Wdb.csv, /home/james/git/jfy133/nf-core-modules/.nf-test/tests/66dc8e269d3139ec4bfa2b871ea09e8f/work/3a/92334bebf905f24fe45f6b4a1555e4/data_tables/Widb.csv, /home/james/git/jfy133/nf-core-modules/.nf-test/tests/66dc8e269d3139ec4bfa2b871ea09e8f/work/3a/92334bebf905f24fe45f6b4a1555e4/data_tables/genomeInformation.csv]
Copy code
println(process.out.summary_tables.get(0).get(1).get(0))
Gives me
Copy code
/home/james/git/jfy133/nf-core-modules/.nf-test/tests/66dc8e269d3139ec4bfa2b871ea09e8f/work/84/f0b27ec8c6fab08a377995a1068928/data_tables/Bdb.csv
If I wrap then
get(0).get(1)
in a
path
then yeah I get 'can't apply to a ArrayList
s
println path(process.out.summary_tables.get(0).get(1)).collect()
j
Nope:
Copy code
groovy.lang.MissingMethodException: No signature of method: static [com.askimed.nf](http://com.askimed.nf).test.lang.extensions.GlobalMethods.path() is applicable for argument types: (ArrayList) values: [[/home/james/git/jfy133/nf-core-modules/.nf-test/tests/66dc8e269d3139ec4bfa2b871ea09e8f/work/da/a4e8d724e090c9cd5f963db4eb4db8/data_tables/Bdb.csv, ...]]
Copy code
println(process.out.summary_tables.get(0).get(1).collect{file(it).listFiles()})
Get's me
Copy code
[null, null, null, null, null, null, null, null]
m
sorry went MIA deep #down-the-rabbit-hole
s
Copy code
assertAll(
        { assert process.success },
        { assert snapshot(
            process.out.summary_tables[0][1].collect { file(it).name }.sort(),
            process.out.figures[0][1].collect { file(it).name }.sort(),
            process.out.fastas,
            path(process.out.log[0][1]).readLines().last().contains('Finished the dereplicate operation'),
            ).match() }
        )
remove the
.name
and you ll get md5 of the csv's
j
That's the problem - md5sums are variable 😬
That's why I'm trying to get the
name
But I'll try your system
Still not @Sateesh_Peri
Copy code
groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.name() is applicable for argument types: () values: []
  Possible solutions: take(int), take(int), max(), any(), max(groovy.lang.Closure), any(groovy.lang.Closure)
Ah n owait
Let me check it wasn't the print ln I had before
OK it was that then
I guessm y problem was always that I had
path
or
file
wrapped around it
(and when I had tried removing those I must have had something else wrong that threw me off)
I'll make a PR to fix the docs - and thank you for being patient with me @Sateesh_Peri 😅
(been a month and a half since I nextflow coded)
(let alone modules)
s
plz update in the nf-test-guide PR....lets get rid of that separate assertions doc....examples are in a chapter in the guide and lets update with all working examples
party this 1
m
Agreeing with this idea
j
OK!
Maybe you should de-pin that page if it's not good
s
ya was planning to once we get this guide live
j
Also @Sateesh_Peri I switched
.name
out with
.csv.sortRows()
and actuaylly that does work 🎉
So you were right all along 😬
s
.name also works for me with the code pasted above...anyway yay
j
Sorry to clarify: name also worked
But made it even better as you suggested originall
y
s
plugins mctestface
party this 1
m
Plugins have been the plans all along
To be fair, I think we should even invest more time of actual dev in nf-test itself
s
yup I think we should reach out and ask how we can help.....releases have stalled for a while
party this 1
m
I know have rights on the plugins repo, so I have a bit of a foot in already 😉
s
I reached out . we should discuss who has time to contribute and in what capacity
👍 1