-
Notifications
You must be signed in to change notification settings - Fork 593
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
Config file no longer overrides system properties #4445
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4445 +/- ##
===============================================
+ Coverage 79.156% 79.475% +0.319%
- Complexity 16583 17182 +599
===============================================
Files 1049 1050 +1
Lines 59510 60950 +1440
Branches 9747 10190 +443
===============================================
+ Hits 47106 48440 +1334
- Misses 8620 8690 +70
- Partials 3784 3820 +36
|
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.
@jonn-smith I have a few comments about the test, but they're mostly just nitpicky stylistic things. Do what you would like 👍
@@ -67,54 +109,94 @@ public String getTestedClassName() { | |||
@Test(dataProvider = "provideForTestToolWithConfigValidation") |
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 the singleThreaded = true
property to the test so it's never executed alongside other tests. We don't currently parallelize our tests, but it's good to mark ones that would definitely break others.
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.
Will do.
} | ||
|
||
// Run our command: | ||
runCommandLine(args.getArgsArray()); |
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.
you can pass an Args Builder directly to runCommandLine
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.
|
||
// Create some arguments for our command: | ||
final ArgumentsBuilder args = new ArgumentsBuilder(); | ||
args.add("--" + StandardArgumentDefinitions.GATK_CONFIG_FILE_OPTION); |
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.
these could be a little bit less verbose if you use args.addArgument(key, value)
and there's a special args.addOutput(file)
too
it's fine if you prefer them this way though
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.
Sounds good. I didn't realize that was an option.
System.setProperty(entry.getKey(), entry.getValue().toString()); | ||
finally { | ||
// Clear our system properties: | ||
final List<Object> keyList = new ArrayList<>(System.getProperties().keySet()); |
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.
Does System.getProperties().clear() not work to clear them 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'm not sure. I'm using System.clearProperty
because that's the interface that specifically says it will clear a specific key.
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.
reasonable
@@ -451,6 +452,11 @@ task bundle(type: Zip) { | |||
from("gatk") | |||
from("README.md") | |||
from("build/docs/tabCompletion/gatk-completion.sh") | |||
|
|||
from("src/main/resources/org/broadinstitute/hellbender/utils/config/GATKConfig.properties") { | |||
rename 'GATKConfig.properties', 'GATKConfig.EXAMPLE.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.
This is a definitely useful to have in our bundle. I think we need to add something to A) the readme explaining how to use this, and B) probably in the example file itself. Doesn't have to be part of this pr though.
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.
Agreed. I'll add some info in the config file itself and I'll add a blurb in the Readme about it as well.
@lbergelson Addressed comments - back for final sign-off. |
Fixed a missing line in the README.md
15ac150
to
09c454d
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.
@jonn-smith looks good to me
Fixes #4435
Fixes #4436