-
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
Changes to allow for tab-completion file creation in the GATK. #3424
Conversation
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 it would be worth adding an integration smoke test for tab completion similar to the docgen one. It only runs on a handful of packages, and doesn't attempt to validate the output, but it ensures the process runs successfully. Also it would catch things like the missing template issue we hit yesterday.
@@ -495,6 +495,56 @@ task gatkDoc(type: Javadoc, dependsOn: classes) { | |||
options.addStringOption("verbose") | |||
} | |||
|
|||
// Generate GATK Bash Tab Completion File | |||
task gatkTabComplete(type: Javadoc, dependsOn: classes) { | |||
final File tabCompletionDir = new File("build/docs/tabCompletion") |
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.
We should extract a docRoot variable for the value "build/docs" since its repeated in a few places.
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've added in a test. I'll commit the update now.
Codecov Report
@@ Coverage Diff @@
## master #3424 +/- ##
==============================================
- Coverage 80.37% 80.146% -0.224%
- Complexity 17670 17799 +129
==============================================
Files 1179 1184 +5
Lines 63876 64565 +689
Branches 9930 10055 +125
==============================================
+ Hits 51337 51746 +409
- Misses 8584 8842 +258
- Partials 3955 3977 +22
|
docArgList.addAll(tabCompletionTestPackages); | ||
|
||
// This is smoke test; we just want to make sure it doesn't blow up | ||
int success = com.sun.tools.javadoc.Main.execute(docArgList.toArray(new String[]{})); |
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 com.sun
class reference in the GATK test suite might be an issue, since these classes are not present in every JVM out there.
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.
Maybe we could run javadoc as a process and get the return value to avoid classloading the com.sun
class?
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.
Sure. Fixing in new update. I'll fix HelpSmokeTest
too.
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.
One comment on the com.sun
reference in our test suite, otherwise looks good. Merge after resolving the com.sun
issue.
All that was required was pointing to the latest barclay release and creating a new build target in build.gradle.
683c94f
to
43c29eb
Compare
// // This is smoke test; we just want to make sure it doesn't blow up | ||
// int success = com.sun.tools.javadoc.Main.execute(docArgList.toArray(new String[]{})); | ||
// Assert.assertEquals(success, 0, "Failure processing gatkTabComplete via javadoc"); | ||
// } |
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 can be deleted now.
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!
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.
Final review complete -- merge after addressing comments.
@@ -2,6 +2,7 @@ | |||
|
|||
import org.broadinstitute.hellbender.CommandLineProgramTest; | |||
import org.broadinstitute.hellbender.utils.help.GATKHelpDoclet; | |||
import org.broadinstitute.hellbender.utils.runtime.ProcessController; | |||
import org.testng.Assert; | |||
import org.testng.annotations.Test; | |||
|
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.
Maybe this class should be called something like DocumentationGenerationIntegrationTest
instead of HelpSmokeTest
, which is a little puzzling/inconsistent with our test class naming conventions.
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.
/** | ||
* Smoke test to run tab completion generation on a subset of classes to make sure it doesn't regress. | ||
*/ | ||
public class TabCompletionSmokeTest extends CommandLineProgramTest { |
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.
Use standard GATK test class naming conventions: TabCompletionIntegrationTest
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!
static { | ||
final ClassFinder classFinder = new ClassFinder(); | ||
classFinder.find("org.broadinstitute.hellbender", CommandLineProgram.class); | ||
tabCompletionTestPackages = classFinder.getClasses().stream().map(Class::getName).collect(Collectors.toList()); |
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.
Make this an immutable list
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!
tabCompletionTestPackages = classFinder.getClasses().stream().map(Class::getName).collect(Collectors.toList()); | ||
} | ||
|
||
// @Test |
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.
Remove commented-out code
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!
All that was required was pointing to the latest barclay release and
creating a new build target in build.gradle.
fixes #1454