Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle : running a single test ? #984

Closed
lindenb opened this issue Sep 15, 2017 · 4 comments
Closed

Gradle : running a single test ? #984

lindenb opened this issue Sep 15, 2017 · 4 comments
Labels

Comments

@lindenb
Copy link
Contributor

lindenb commented Sep 15, 2017

not a real issue: I'm trying to run a single test with gradle but i cannot find the correct command-line. I've tried :

./gradlew -Dtest.single=htsjdk.variant.vcf.VCFEncoderTest test

but it doesn't work. (is it possible to run such test ?)

Can someone please update the wiki https://github.com/samtools/htsjdk/wiki/Writing-tests-in-HTSJDK with the instruction to run a single test ?

thanks !


Why ? I'm working behind a strong firewall, it takes a very long time before gradle raises a ' java.net.ConnectException' for the tests requiring a connection.

ParsingUtilsTest:
[TestNG] Running:
  Command line suite

- testFTPDoesExist *** FAILED ***
  java.lang.AssertionError: expected [true] but found [false]
  at org.testng.Assert.fail(Assert.java:94)
  at org.testng.Assert.failNotEquals(Assert.java:496)
  at org.testng.Assert.assertEquals(Assert.java:125)
  at org.testng.Assert.assertEquals(Assert.java:288)

@lbergelson
Copy link
Member

@lindenb What you're doing is what I would expect to work. It looks like the change to add scala tests broke this functionality. There's an issue in the scala test plugin we're using that matches this problem, but it hasn't had any resolution. (maiflai/gradle-scalatest#28) I'll comment there and see if the developer can help us.

I don't see a great workaround yet, other than running tests in your IDE which should let you run one at a time. Or maybe invoking TestNG directly, there must be a way to do that, but I don't know how. I would probably disable the test that's causing you pain manually in any case. (although even with no slow test 4 minutes to run the whole test suite makes iterating painful...) Maybe we can make it timeout faster as well.

I think to fix this we're probably going to have to re-visit our integration of the scala-test plugin, this issue has some suggestions for having a mixed scala / java test suite in a way that sounds like it makes more sense for the project.
maiflai/gradle-scalatest#14

And this pr to the plugin seems like it is pushing in a direction that works better for us.
maiflai/gradle-scalatest#47

Sorry I don't have a better solution, I always run my tests in intellij when I'm developing so I didn't notice this was broken.

@lbergelson lbergelson added the bug label Sep 15, 2017
@lindenb
Copy link
Contributor Author

lindenb commented Sep 15, 2017

@lbergelson thanks for your quick response. :-)

@lbergelson
Copy link
Member

Quick response, but we'll see how long the fix takes :/

It's funny that you noticed this today, we opened broadinstitute/picard#924 a few days ago which is the identical problem, but completely different cause. Issues have been coming in groups lately.

@lbergelson
Copy link
Member

I took a look at fixing this, and it seems like we can separate out the scalatest and java tests and run each independently which will let the java test filtering work correctly.

It causes other problems that I haven't figured out how to solve yet, specifically I can't figure out how to get coverage collection to work for the scalatests. if anyone has any thoughts they can check it out here: https://github.com/samtools/htsjdk/tree/lb_changing_scalatest_stuff

lbergelson added a commit that referenced this issue Nov 9, 2018
* The existing examples of how to run single tests are broken, updating
them with working examples.
* Resolves #984
lbergelson added a commit that referenced this issue Nov 13, 2018
* The existing examples of how to run single tests are broken, updating
them with working examples.
* Resolves #984
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants