lindenb / jvarkit

Java utilities for Bioinformatics
https://jvarkit.readthedocs.io/
Other
476 stars 131 forks source link

Test AssertionError #213

Open jamdodot opened 1 year ago

jamdodot commented 1 year ago

Subject of the issue

I get a lot of this kind of test errors
for example pubmeddump

test01 (Lindenbaum CloneIt)
java.lang.AssertionError: expected [0] but found [-1]
    at com.github.lindenb.jvarkit.tools.pubmed.PubmedDumpTest.dumpAsXml(PubmedDumpTest.java:29)
    at com.github.lindenb.jvarkit.tools.pubmed.PubmedDumpTest.test01(PubmedDumpTest.java:40)
    at com.github.lindenb.jvarkit.tools.tests.MiniTestNG.doWork(MiniTestNG.java:77)
    at com.github.lindenb.jvarkit.tools.tests.MiniTestNG.main(MiniTestNG.java:87)
... Removed 28 stack frames

call stack is:

dumpAsXml()
PubmedDump().instanceMain(new String[] {
        "-o",out.toString(),
        query
        }),0);
-->

src/main/java/com/github/lindenb/jvarkit/util/jcommander/Launcher.java
public int instanceMain(final String args[]) 

-->
src/main/java/com/github/lindenb/jvarkit/util/jcommander/Launcher.java
parseArgs
getJCommander().parse
return Status.EXIT_FAILURE;  

-->
src/main/java/com/github/lindenb/jvarkit/util/jcommander/Launcher.java
instanceMain()
case EXIT_FAILURE: return -1;

It looks like getJCommander().parse has some problem. https://github.com/lindenb/jvarkit/blob/45c42a8bcc6024cec2e427a2afec0f242b9fbf05/src/main/java/com/github/lindenb/jvarkit/util/jcommander/Launcher.java#L518

there is a problem with the input parameters of instanceMain? How can I pass the test case here?

Your environment

lindenb commented 1 year ago

it's because I've not updated the tests while I changed the tool (my bad).

jamdodot commented 1 year ago

okkk , what do I need to change to make the test pass?