-
Notifications
You must be signed in to change notification settings - Fork 596
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
Splitting out gatk-testUtils as a separate artifact #5112
Conversation
build.gradle
Outdated
@@ -325,6 +336,12 @@ dependencies { | |||
// Required for SV Discovery machine learning | |||
compile group: 'biz.k11i', name: 'xgboost-predictor', version: '0.3.0' | |||
|
|||
testUtilsCompile sourceSets.main.output | |||
testUtilsCompile 'org.testng:testng:' + testNGVersion //compile instead of testCompile because it is needed for test infrastructure that needs to be packaged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to update this comment...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@jamesemery @cmnbroad This fixes a personal pet peeve of mine, which is that we're packaging a bunch of test classes as a runtime dependency. It splits out a new test artifact which contains just the classes in utils.test and allows it to be published and consumed separately from the rest of the gatk. This allows us to make testng and minicluster no longer compile dependencies |
Codecov Report
@@ Coverage Diff @@
## master #5112 +/- ##
===============================================
+ Coverage 86.507% 86.652% +0.145%
+ Complexity 29260 28982 -278
===============================================
Files 1814 1799 -15
Lines 135635 134495 -1140
Branches 15063 14924 -139
===============================================
- Hits 117334 116543 -791
+ Misses 12833 12546 -287
+ Partials 5468 5406 -62
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad we're doing this - just a couple of questions/suggestions.
build.gradle
Outdated
testUtils | ||
} | ||
|
||
configurations { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor question - is there any significance to the fact that this configurations closure is separate from the other one ? Can they be consolidated ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is any significance, I'll combine them.
@@ -293,7 +295,9 @@ protected Process getProcess() { | |||
public void terminate() { | |||
if (dataTransferFIFOWriter != null) { | |||
if (asyncWriter != null) { | |||
Assert.assertTrue(asyncWriter.terminate()); | |||
if(!asyncWriter.terminate()){ | |||
throw new GATKException("failed to close asynWriter"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two comments:
1 Wow.
2) asynWriter -> asyncWriter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. It's easy to end up accidentally depending on things you don't want to be when they're in your classpath...
build.gradle
Outdated
addFilter('gatk-test-utils') {artifact, file -> | ||
artifact.name == 'gatk-test-utils' | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we factor this out into a named (def =) closure so it can be shared ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, done, although it doesn't save that much typing.
testUtilsCompile 'org.apache.hadoop:hadoop-minicluster:' + hadoopVersion | ||
|
||
testCompile sourceSets.testUtils.output | ||
|
||
testCompile "org.mockito:mockito-core:2.10.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can/should mockito be moved to testUtilsCompile ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can, but there's no reason to do so. Nothing in testUtils uses it. We can move it when / if we need it. Best to keep dependencies scoped as narrowly as possible I think. Similar issue with jimfs. I suspect your ArgumentsBuilder branch will require jimfs to move to testUtils.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -279,8 +290,6 @@ dependencies { | |||
} | |||
|
|||
compile 'org.jgrapht:jgrapht-core:0.9.1' | |||
compile 'org.testng:testng:' + testNGVersion //compile instead of testCompile because it is needed for test infrastructure that needs to be packaged | |||
compile 'org.apache.hadoop:hadoop-minicluster:' + hadoopVersion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally these two out of my toolkit dependencies!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
@@ -22,7 +23,6 @@ | |||
import org.broadinstitute.hellbender.utils.param.ParamUtils; | |||
import org.broadinstitute.hellbender.utils.read.ReadUtils; | |||
import org.broadinstitute.hellbender.utils.variant.GATKVariantContextUtils; | |||
import org.testng.collections.Sets; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OMG!
@@ -1,4 +1,4 @@ | |||
package org.broadinstitute.hellbender.utils.test; | |||
package org.broadinstitute.hellbender.testutils; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be here, but should be a test in living in org.broadinstitute.hellbender.utils.help
(no idea why it was here in the first place)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good call, I didn't actually audit what these things are.
@@ -1,4 +1,4 @@ | |||
package org.broadinstitute.hellbender.utils.test; | |||
package org.broadinstitute.hellbender.testutils; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be better moved to the funcotator package, as it isn't really related with testutils
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has one method that's generally useful, maybe that should move but I'm going to leave it here for now.
@@ -1,4 +1,4 @@ | |||
package org.broadinstitute.hellbender.utils.test; | |||
package org.broadinstitute.hellbender.testutils; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Integration test for help package. Same as DocumentationGenerationIntegrationTest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call.
@@ -1,4 +1,4 @@ | |||
package org.broadinstitute.hellbender.utils.test.testers; | |||
package org.broadinstitute.hellbender.testutils.testers; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this live in testutils
or better in the markduplicate's related package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, if anyone wants to make a new version of mark duplicates this might help. I'm going to leave it here for now.
@@ -1,4 +1,4 @@ | |||
package org.broadinstitute.hellbender.utils.test.testers; | |||
package org.broadinstitute.hellbender.testutils.testers; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is a good place to fix the TODO on top of the class: this only tests one class and it is not part of the framework; it should be added to the GATK-test-sources. And actually it is testing a picard tool, so I am not sure if it is needed at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just delete this, it's unused.
this allows us to remove the compile time dependencies minicluster and testng and convert them to dependencies of this new artifact moving utils.test package to testutils and a new source root the new dependency structure looks like main <- testUtils ^ ^ test
36cb9b8
to
38945dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check and see that all of the tests are being run now? I'm not sure i'm convinced these test classes have made it into the docker.
Tests are run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check and see that all of the tests are being run now? I'm not sure i'm convinced these test classes have made it into the docker. 👍
this allows us to remove the compile time dependencies minicluster and testng and convert them to dependencies of this new artifact
moving utils.test package to testutils and a new source root
the new dependency structure looks like
main <- testUtils
^ ^
test
one side effect was that commons.math is no longer imported, we were accidentally using this in some places instead of commons.math3 which is what we wanted.