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

Changes to allow for tab-completion file creation in the GATK. #3424

Merged
merged 6 commits into from
Aug 25, 2017

Conversation

jonn-smith
Copy link
Collaborator

All that was required was pointing to the latest barclay release and
creating a new build target in build.gradle.

fixes #1454

Copy link
Collaborator

@cmnbroad cmnbroad left a 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")
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

@droazen droazen changed the title Changes to allow for tab-completion file creation in teh GATK. Changes to allow for tab-completion file creation in the GATK. Aug 11, 2017
@codecov-io
Copy link

codecov-io commented Aug 14, 2017

Codecov Report

Merging #3424 into master will decrease coverage by 0.224%.
The diff coverage is 100%.

@@              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
Impacted Files Coverage Δ Complexity Δ
...adinstitute/hellbender/CommandLineProgramTest.java 100% <100%> (ø) 6 <2> (+2) ⬆️
...nstitute/hellbender/utils/help/GATKHelpDoclet.java 0% <0%> (-100%) 0% <0%> (-6%)
...titute/hellbender/utils/help/GATKGSONWorkUnit.java 0% <0%> (-100%) 0% <0%> (-2%)
...lbender/utils/help/GATKHelpDocWorkUnitHandler.java 0% <0%> (-100%) 0% <0%> (-3%)
...institute/hellbender/utils/help/HelpConstants.java 3.704% <0%> (-92.593%) 1% <0%> (-7%)
...am/RevertOriginalBaseQualitiesAndAddMateCigar.java 0% <0%> (-11.111%) 0% <0%> (ø)
...titute/hellbender/tools/spark/pathseq/PSUtils.java 73.684% <0%> (-4.094%) 21% <0%> (+9%)
...titute/hellbender/tools/picard/sam/ReorderSam.java 0% <0%> (-3.488%) 0% <0%> (-1%)
...itute/hellbender/tools/picard/vcf/LiftOverVcf.java 0% <0%> (-1.149%) 0% <0%> (-1%)
...ine/GATKPlugin/GATKReadFilterPluginDescriptor.java 86.4% <0%> (-0.8%) 50% <0%> (-1%)
... and 19 more

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[]{}));
Copy link
Contributor

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.

Copy link
Contributor

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?

Copy link
Collaborator Author

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.

Copy link
Contributor

@droazen droazen left a 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.

@droazen droazen assigned jonn-smith and unassigned droazen Aug 18, 2017
// // 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");
// }
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

Copy link
Contributor

@droazen droazen left a 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;

Copy link
Contributor

@droazen droazen Aug 24, 2017

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.

Copy link
Collaborator Author

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 {
Copy link
Contributor

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

Copy link
Collaborator Author

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());
Copy link
Contributor

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

Copy link
Collaborator Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented-out code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@droazen droazen removed the request for review from lbergelson August 24, 2017 19:45
@jonn-smith jonn-smith merged commit 3d6ba41 into master Aug 25, 2017
@jonn-smith jonn-smith deleted the jts_tab_completion_1454 branch August 25, 2017 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

automatically generate bash/zsh completions for gatk
4 participants