-
Notifications
You must be signed in to change notification settings - Fork 602
rebase Dgs configure plugin packages #5573
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
Conversation
@lbergelson Looks like the build failed with exception... |
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.
After you fix the compiler error, you should really add a test for this plugin, maybe create a dummy annotation and/or read/filter in the test utils, then write a test that asserts that a tool can indeed detect both those annotations and the default annotations when you ask for a list of the annotations present.
152f123
to
6dbc1c5
Compare
@jamesemery I think this is actually ready for review this time... |
Codecov Report
@@ Coverage Diff @@
## master #5573 +/- ##
===============================================
- Coverage 87.046% 87.043% -0.003%
- Complexity 31524 31533 +9
===============================================
Files 1928 1930 +2
Lines 145340 145387 +47
Branches 16089 16088 -1
===============================================
+ Hits 126513 126549 +36
- Misses 12966 12981 +15
+ Partials 5861 5857 -4
|
* added tests to show that the Annotation /ReadFilter loading is controlled by the config file * added a new method to base test runToolInNewJvm which lets you run a gatk tool in a clean jvm so you can alter static state like which config file was used. Co-authored-by: Louis Bergelson <[email protected]>
89ab300
to
3225f8a
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.
A bunch of minor things, the only one I think is necessary are the changes to the dummy Annotation/Filter files as they will be incredibly confusing in the future when we have forgotten about this test. Feel free to merge once these issues are addressed.
|
||
import org.broadinstitute.hellbender.engine.filters.ReadFilter; | ||
import org.broadinstitute.hellbender.utils.read.GATKRead; | ||
|
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.
Hmm... Is there an issue with putting these explicitly in the test 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.
They're in the test package specifically so they're not discoverable under normal circumstances. They aren't found by the plugin unless you explicitly tell it to look in this package.
package org.broadinstitute.hellbender.cmdline.GATKPlugin.testpluggables; | ||
|
||
import org.broadinstitute.hellbender.tools.walkers.annotator.Annotation; | ||
|
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.
Add a comment explaining that these are just for testing purposes and maybe even a link to the exact test so nobody is confused in the future, as these are discovered by reflection and its not easy to track down their purpose.
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 idea, done
@@ -1,5 +1,6 @@ | |||
package org.broadinstitute.hellbender.utils.config; | |||
|
|||
import com.netflix.servo.util.VisibleForTesting; |
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.
Its nice to think that the gatk is dependent on netflix....
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 now depends on myspace
@Test | ||
public void testConfigFileControlsAnnotationPackages() throws IOException { | ||
final File output = createTempFile("annotations", "txt"); | ||
final File configFile = new File("src/test/resources/org/broadinstitute/hellbender/cmdline/GATKPlugin/changePluginPackages.properties"); |
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 probably use the default test dir constants.
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
@Test | ||
public void testConfigFileControlsReadFiltersPackages() throws IOException { | ||
final File output = createTempFile("annotations", "txt"); | ||
final File configFile = new File("src/test/resources/org/broadinstitute/hellbender/cmdline/GATKPlugin/changePluginPackages.properties"); |
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.
Same comment as above.
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.
same comment as above
* @param arguments arguments to provide to the tool | ||
*/ | ||
public static void runToolInNewJVM(String toolName, ArgumentsBuilder arguments){ | ||
final String javaHome = System.getProperty("java.home"); |
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 will be useful to have
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.
hopefully!
rebase of #4611 with fixes