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

Extract tests from PrintReadsIntegrationTest to share with Spark version #5689

Merged
merged 1 commit into from
Mar 4, 2019

Conversation

tomwhite
Copy link
Contributor

PrintReadsIntegrationTest and PrintReadsSparkIntegrationTest had diverged, this fixes the problem.

@tomwhite tomwhite self-assigned this Feb 19, 2019

@Test( groups = "spark")
@Test()
public void testUnSortedRoundTrip() throws Exception {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the only test that is Spark-specific. It fails on PrintReads (non-Spark) since that tool does not allow reads to be written in an order that is inconsistent with the header (the header says coordinate sorted, but the file is actually queryname sorted).

Also (contrary to the comment in this test) PrintReadSpark does not sort the file, so it writes an invalid BAM. This seems to be wrong.

Copy link
Collaborator

@jamesemery jamesemery Feb 20, 2019

Choose a reason for hiding this comment

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

Right, so the point with this test as I added it was to enforce that printReadsSpark was no longer spuriously sorting the output reads (at runtime cost and some pain if you were dealing with invalid input files in the first place). I'm not sure its the place of PrintReads to go about sorting your bam output for you, especially if your purpose is to extract reads with some tag or another. Perhaps this test would make more sense if we were looking at queryname sorted bams, where there exists a valid alternative version of what a "queryname" sort means that somebody might well want to preserve.

@codecov-io
Copy link

codecov-io commented Feb 19, 2019

Codecov Report

Merging #5689 into master will decrease coverage by 0.005%.
The diff coverage is 90.865%.

@@               Coverage Diff               @@
##              master     #5689       +/-   ##
===============================================
- Coverage     87.069%   87.064%   -0.005%     
+ Complexity     31875     31850       -25     
===============================================
  Files           1940      1941        +1     
  Lines         146738    146599      -139     
  Branches       16226     16208       -18     
===============================================
- Hits          127764    127635      -129     
+ Misses         13061     13057        -4     
+ Partials        5913      5907        -6
Impacted Files Coverage Δ Complexity Δ
...park/pipelines/PrintReadsSparkIntegrationTest.java 92.857% <100%> (+4.325%) 2 <1> (-29) ⬇️
...te/hellbender/tools/PrintReadsIntegrationTest.java 100% <100%> (+3.205%) 3 <1> (-23) ⬇️
...ender/tools/AbstractPrintReadsIntegrationTest.java 90.777% <90.777%> (ø) 28 <28> (?)

Copy link
Collaborator

@jamesemery jamesemery left a comment

Choose a reason for hiding this comment

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

This change looks positive, my only concern is that we probably don't want to move more tests than we have to into the integration test group on travis, consequently we probably want to make sure the tests are tagged properly.


@Test( groups = "spark")
@Test()
public void testUnSortedRoundTrip() throws Exception {
Copy link
Collaborator

@jamesemery jamesemery Feb 20, 2019

Choose a reason for hiding this comment

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

Right, so the point with this test as I added it was to enforce that printReadsSpark was no longer spuriously sorting the output reads (at runtime cost and some pain if you were dealing with invalid input files in the first place). I'm not sure its the place of PrintReads to go about sorting your bam output for you, especially if your purpose is to extract reads with some tag or another. Perhaps this test would make more sense if we were looking at queryname sorted bams, where there exists a valid alternative version of what a "queryname" sort means that somebody might well want to preserve.


SamAssertionUtils.assertSamsEqual(outBam, inBam);
}
public final class PrintReadsSparkIntegrationTest extends AbstractPrintReadsIntegrationTest {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We still want these tests to be tagged as spark tests I think, i'm not sure how the propagation for testng works with inherited tests but these tests should probably stay in the spark group. If you added @Test(groups = {"spark"}) to the class I suspect this might propagate the test tags correctly.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can check by looking at the travis test outputs to check that these did indeed run with the spark tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the spark group back. Also, these tests were all run as a part of the integration test type.

@tomwhite tomwhite force-pushed the tw_common_print_reads_integration_tests branch from 4b48fe9 to 200ddaf Compare February 26, 2019 12:09
Copy link
Collaborator

@jamesemery jamesemery left a comment

Choose a reason for hiding this comment

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

Lookks good to me 👍

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.

3 participants