Skip to content

Commit 35617ac

Browse files
committed
Awkwardly skip reference bundle tests in Spark tools; circumvent dependency injection issue in tests.
1 parent ebde816 commit 35617ac

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

src/test/java/org/broadinstitute/hellbender/tools/AbstractPrintReadsIntegrationTest.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@
2222
import org.broadinstitute.hellbender.testutils.ArgumentsBuilder;
2323
import org.broadinstitute.hellbender.testutils.IntegrationTestSpec;
2424
import org.broadinstitute.hellbender.testutils.SamAssertionUtils;
25+
import org.broadinstitute.hellbender.tools.spark.pipelines.PrintReadsSparkIntegrationTest;
2526
import org.broadinstitute.hellbender.utils.Utils;
2627
import org.broadinstitute.hellbender.utils.gcs.BucketUtils;
2728
import org.broadinstitute.hellbender.utils.io.IOUtils;
2829
import org.broadinstitute.hellbender.utils.read.GATKRead;
2930
import org.testng.Assert;
31+
import org.testng.SkipException;
3032
import org.testng.annotations.DataProvider;
3133
import org.testng.annotations.Test;
3234

@@ -74,7 +76,13 @@ public void doFileToFile(String fileIn, String extOut, String reference, boolean
7476
}
7577
}
7678

77-
public void doFileToFileUsingReferenceBundle(String fileIn, String extOut, String reference, boolean testMD5) throws Exception {
79+
public void doFileToFileUsingReferenceBundle(final String fileIn, final String extOut, final String reference, final boolean testMD5) throws Exception {
80+
// this is ugly, but we need to skip this test in Spark tools because they don't support bundles, and
81+
// if I put an override of this method in PrintReadsSparkIntegrationTest, it results in dependency injection
82+
// errors when the tests are run
83+
if (this.getClass().equals(PrintReadsSparkIntegrationTest.class)) {
84+
throw new SkipException("Bundles are not supported in Spark tools");
85+
}
7886
final String referenceToUse;
7987
if (reference != null) {
8088
// create the bundle, using inference to find the sibling files, then write the bundle out to a temp file
@@ -105,11 +113,6 @@ private void checkMD5asExpected(final File outFile) throws IOException {
105113
Assert.assertEquals(actualMD5, expectedMD5);
106114
}
107115

108-
@Test(dataProvider="testingData")
109-
public void testFileToFileWithReferenceBundle(String fileIn, String extOut, String reference) throws Exception {
110-
doFileToFileUsingReferenceBundle(fileIn, extOut, reference, false);
111-
}
112-
113116
@DataProvider(name="testingData")
114117
public Object[][] testingData() {
115118
return new String[][]{
@@ -153,7 +156,7 @@ public Object[][] testingData() {
153156
}
154157

155158
@Test(dataProvider="testingData")
156-
public void testFileToFileUsingReferenceBundle(String fileIn, String extOut, String reference) throws Exception {
159+
public void testFileToFileUsingReferenceBundle(final String fileIn, final String extOut, final String reference) throws Exception {
157160
if (reference != null) {
158161
doFileToFileUsingReferenceBundle(fileIn, extOut, reference, false);
159162
}

src/test/java/org/broadinstitute/hellbender/tools/PrintReadsIntegrationTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,11 @@ public void testPrintReadsWithReferenceBundle() throws IOException {
157157
Assert.assertEquals(count, 8);
158158
}
159159

160+
// only do reference bundle tests for non-spark tools, since for now the spark tools don't support reference bundles
161+
// (since they use 2-bit and hadoop references)
162+
@Test(dataProvider="testingData")
163+
public void testFileToFileWithReferenceBundle(final String fileIn, final String extOut, final String reference) throws Exception {
164+
doFileToFileUsingReferenceBundle(fileIn, extOut, reference, false);
165+
}
166+
160167
}

0 commit comments

Comments
 (0)