[med-svn] [Git][med-team/htsjdk][master] Finalise ftp/http exclusion patches
Andreas Tille
gitlab at salsa.debian.org
Tue Sep 18 14:22:44 BST 2018
Andreas Tille pushed to branch master at Debian Med / htsjdk
Commits:
c78d5694 by Andreas Tille at 2018-09-18T13:22:08Z
Finalise ftp/http exclusion patches
- - - - -
3 changed files:
- debian/changelog
- debian/patches/90-disable-testftp.patch
- debian/patches/92-disable-testhttp.patch
Changes:
=====================================
debian/changelog
=====================================
@@ -1,4 +1,4 @@
-htsjdk (2.16.1+dfsg-1) UNRELEASED; urgency=medium
+htsjdk (2.16.1+dfsg-1) unstable; urgency=medium
[ Andreas Tille ]
* New upstream version
@@ -9,7 +9,7 @@ htsjdk (2.16.1+dfsg-1) UNRELEASED; urgency=medium
[ Olivier Sallou ]
* Skip test requiring ftp connection
- -- Andreas Tille <tille at debian.org> Tue, 18 Sep 2018 11:00:54 +0200
+ -- Andreas Tille <tille at debian.org> Tue, 18 Sep 2018 14:21:42 +0200
htsjdk (2.14.3+dfsg-3) unstable; urgency=medium
=====================================
debian/patches/90-disable-testftp.patch
=====================================
@@ -4,7 +4,7 @@ Description: remove unsupported *tags* and disable ftp tests as require network
--- a/build.gradle
+++ b/build.gradle
-@@ -102,15 +102,6 @@
+@@ -102,15 +102,6 @@ test {
} dependsOn findScalaAndJavaTypes
@@ -20,3 +20,57 @@ Description: remove unsupported *tags* and disable ftp tests as require network
task testSRA(type: Test) {
description = "Run the SRA tests"
+--- a/src/test/java/htsjdk/tribble/util/ftp/FTPClientTest.java
++++ b/src/test/java/htsjdk/tribble/util/ftp/FTPClientTest.java
+@@ -16,13 +16,3 @@ import java.net.UnknownHostException;
+ * @author Jim Robinson
+ * @since 10/3/11
+ */
+- at Test(groups="ftp")
+-public class FTPClientTest extends HtsjdkTest {
+-
+- static String host = "ftp.broadinstitute.org";
+- static String file = "/pub/igv/TEST/test.txt";
+- static int fileSize = 27;
+- static byte[] expectedBytes = "abcdefghijklmnopqrstuvwxyz\n".getBytes();
+- FTPClient client;
+-
+-}
+--- a/src/test/java/htsjdk/samtools/SamStreamsTest.java
++++ b/src/test/java/htsjdk/samtools/SamStreamsTest.java
+@@ -91,35 +91,4 @@ public class SamStreamsTest extends Htsj
+ Assert.assertEquals(SamStreams.sourceLikeCram(strm), expected);
+ }
+
+-
+- @DataProvider(name = "sourceLikeBam")
+- public Object[][] sourceLikeBamData() {
+- return new Object[][] {
+- {"cram_with_bai_index.cram", true, false },
+- {"compressed.bam", true, true },
+- {"unsorted.sam", true, false },
+- // fails due to a combination of https://github.com/samtools/htsjdk/issues/619 and
+- // https://github.com/samtools/htsjdk/issues/618
+- //{"ftp://ftp.broadinstitute.org/dummy.cram", false, false},
+- {"ftp://ftp.broadinstitute.org/dummy.bam", false, true},
+- {"http://www.broadinstitute.org/dummy.bam", false, true},
+- {"https://www.broadinstitute.org/dummy.bam", false, true},
+- {"http://www.broadinstitute.org/dummy.bam?alt=media", false, true},
+- {"http://www.broadinstitute.org/test?file=my.bam", false, true},
+- {"http://www.broadinstitute.org/test?foo=bar,file=my.bam", false, true},
+- {"http://www.broadinstitute.org/test?file=my.cram", false, false}
+- };
+- }
+-
+- @Test(dataProvider = "sourceLikeBam")
+- public void sourceLikeBam(
+- final String resourceName,
+- final boolean isFile,
+- final boolean expected) throws IOException
+- {
+- SeekableStream strm = isFile ?
+- new SeekableFileStream(new File(TEST_DATA_DIR, resourceName)) :
+- SeekableStreamFactory.getInstance().getStreamFor(new URL(resourceName));
+- Assert.assertEquals(SamStreams.sourceLikeBam(strm), expected);
+- }
+ }
=====================================
debian/patches/92-disable-testhttp.patch
=====================================
@@ -33,3 +33,97 @@ Description: Skip test requiring http connection
@Test(dataProvider = "customInflaterInput", singleThreaded = true)
public void testCustomInflater(final CheckedExceptionInputStreamSupplier bcisSupplier,
final List<String> expectedOutput,
+--- a/src/test/java/htsjdk/samtools/seekablestream/SeekableStreamFactoryTest.java
++++ b/src/test/java/htsjdk/samtools/seekablestream/SeekableStreamFactoryTest.java
+@@ -22,22 +22,6 @@ public class SeekableStreamFactoryTest e
+ Assert.assertEquals(SeekableStreamFactory.isFilePath("ftp://broadinstitute.org"), false);
+ }
+
+- @DataProvider(name="getStreamForData")
+- public Object[][] getStreamForData() throws Exception {
+- return new Object[][] {
+- { new File(TEST_DATA_DIR, "BAMFileIndexTest/index_test.bam").getAbsolutePath(),
+- new File(TEST_DATA_DIR, "BAMFileIndexTest/index_test.bam").getAbsolutePath() },
+- { new File(TEST_DATA_DIR, "cram_with_bai_index.cram").getAbsolutePath(),
+- new File(TEST_DATA_DIR, "cram_with_bai_index.cram").getAbsolutePath() },
+- { new URL("file://" + new File(TEST_DATA_DIR, "cram_with_bai_index.cram").getAbsolutePath()).toExternalForm(),
+- new File(TEST_DATA_DIR, "cram_with_bai_index.cram").getAbsolutePath() },
+- { new URL(TestUtil.BASE_URL_FOR_HTTP_TESTS + "index_test.bam").toExternalForm(),
+- new URL(TestUtil.BASE_URL_FOR_HTTP_TESTS + "index_test.bam").toExternalForm() },
+- { new URL(TestUtil.BASE_URL_FOR_HTTP_TESTS + "index_test.bam.bai").toExternalForm(),
+- new URL(TestUtil.BASE_URL_FOR_HTTP_TESTS + "index_test.bam.bai").toExternalForm() }
+- };
+- }
+-
+ @Test(dataProvider = "getStreamForData")
+ public void testGetStreamFor(final String path, final String expectedPath) throws IOException {
+ Assert.assertEquals(SeekableStreamFactory.getInstance().getStreamFor(path).getSource(), expectedPath);
+--- a/src/test/java/htsjdk/samtools/SamReaderFactoryTest.java
++++ b/src/test/java/htsjdk/samtools/SamReaderFactoryTest.java
+@@ -229,66 +229,6 @@ public class SamReaderFactoryTest extend
+ final File localBam = new File("src/test/resources/htsjdk/samtools/BAMFileIndexTest/index_test.bam");
+ final File localBamIndex = new File("src/test/resources/htsjdk/samtools/BAMFileIndexTest/index_test.bam.bai");
+
+- final URL bamUrl, bamIndexUrl;
+-
+- {
+- try {
+- bamUrl = new URL(TestUtil.BASE_URL_FOR_HTTP_TESTS + "index_test.bam");
+- bamIndexUrl = new URL(TestUtil.BASE_URL_FOR_HTTP_TESTS + "index_test.bam.bai");
+- } catch (final MalformedURLException e) {
+- throw new RuntimeException(e);
+- }
+- }
+-
+- @DataProvider
+- public Object[][] composeAllPermutationsOfSamInputResource() {
+- final List<SamInputResource> sources = new ArrayList<>();
+- for (final InputResource.Type dataType : InputResource.Type.values()) {
+- if (dataType.equals(InputResource.Type.SRA_ACCESSION))
+- continue;
+-
+- sources.add(new SamInputResource(composeInputResourceForType(dataType, false)));
+- for (final InputResource.Type indexType : InputResource.Type.values()) {
+- if (indexType.equals(InputResource.Type.SRA_ACCESSION))
+- continue;
+-
+- sources.add(new SamInputResource(
+- composeInputResourceForType(dataType, false),
+- composeInputResourceForType(indexType, true)
+- ));
+- }
+- }
+- final Object[][] data = new Object[sources.size()][];
+- for (final SamInputResource source : sources) {
+- data[sources.indexOf(source)] = new Object[]{source};
+- }
+-
+- return data;
+- }
+-
+- private InputResource composeInputResourceForType(final InputResource.Type type, final boolean forIndex) {
+- final File f = forIndex ? localBamIndex : localBam;
+- final URL url = forIndex ? bamIndexUrl : bamUrl;
+- switch (type) {
+- case FILE:
+- return new FileInputResource(f);
+- case PATH:
+- return new PathInputResource(f.toPath(), Function.identity());
+- case URL:
+- return new UrlInputResource(url);
+- case SEEKABLE_STREAM:
+- return new SeekableStreamInputResource(new SeekableHTTPStream(url));
+- case INPUT_STREAM:
+- try {
+- return new InputStreamInputResource(new FileInputStream(f));
+- } catch (final FileNotFoundException e) {
+- throw new RuntimeIOException(e);
+- }
+- default:
+- throw new IllegalStateException();
+- }
+- }
+-
+ final Set<SAMFileHeader> observedHeaders = new HashSet<>();
+ final Set<List<SAMRecord>> observedRecordOrdering = new HashSet<>();
+
View it on GitLab: https://salsa.debian.org/med-team/htsjdk/commit/c78d569463efdb4a067e33d15e71ee4b0db969ff
--
View it on GitLab: https://salsa.debian.org/med-team/htsjdk/commit/c78d569463efdb4a067e33d15e71ee4b0db969ff
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20180918/64a346c0/attachment-0001.html>
More information about the debian-med-commit
mailing list