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

Re-enable htsget tests #6668

Merged
merged 1 commit into from
Jun 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package org.broadinstitute.hellbender.tools;

import htsjdk.samtools.ValidationStringency;
import org.broadinstitute.hellbender.CommandLineProgramTest;
import org.broadinstitute.hellbender.cmdline.StandardArgumentDefinitions;
import org.broadinstitute.hellbender.exceptions.UserException;
import org.broadinstitute.hellbender.testutils.ArgumentsBuilder;
import org.broadinstitute.hellbender.testutils.IntegrationTestSpec;
import org.broadinstitute.hellbender.testutils.SamAssertionUtils;
import org.broadinstitute.hellbender.utils.Utils;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
Expand All @@ -13,6 +15,7 @@
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.Collections;
import java.util.Map;

import com.google.common.collect.ImmutableMap;
Expand Down Expand Up @@ -58,18 +61,18 @@ Object[][] successfulParameters() {
StandardArgumentDefinitions.INTERVALS_LONG_NAME, "chr1:24000000-25000000"),
"A1-B000168-3_57_F-1-1_R2.mus.Aligned.out.sorted.bam.startend"
},
{ // filter by field
ImmutableMap.of(
HtsgetReader.ID_LONG_NAME, FILE_ID,
HtsgetReader.FIELDS_LONG_NAME, "QNAME"),
"A1-B000168-3_57_F-1-1_R2.mus.Aligned.out.sorted.bam.field"
}
// TODO enable when server update goes in
// { // filter by field
// ImmutableMap.of(
// HtsgetReader.ID_LONG_NAME, FILE_ID,
// HtsgetReader.FIELDS_LONG_NAME, "QNAME"),
// "A1-B000168-3_57_F-1-1_R2.mus.Aligned.out.sorted.bam.field"
// }
};
}

// Test successful combinations of query parameters
// TODO: re-enable and add tags/notags tests once reference server is stable
@Test(dataProvider = "successfulParameters", enabled = false)
@Test(dataProvider = "successfulParameters")
public void testSuccessfulParameters(final Map<String, String> params, final String expectedFileName) throws IOException {
final File expected = new File(getToolTestDataDir(), expectedFileName);
final File output = createTempFile("output", ".bam");
Expand All @@ -80,9 +83,10 @@ public void testSuccessfulParameters(final Map<String, String> params, final Str
params.forEach(args::add);

runCommandLine(args);
IntegrationTestSpec.assertEqualTextFiles(output, expected, null);
SamAssertionUtils.assertEqualBamFiles(output, expected, false, ValidationStringency.LENIENT);
}

//This test is disabled because it takes a long time. It's included in order to run it manually.
@Test(enabled = false)
public void testLargeFileParallelDownload() throws IOException {
final String expectedMd5 = new String(Files.readAllBytes(new File(getToolTestDataDir(), LARGE_FILE_MD5_FILE).toPath()));
Expand Down