From a7d1904c63e7729b3904b09510639531024b4d73 Mon Sep 17 00:00:00 2001 From: Khalid Shakir Date: Wed, 9 Jul 2014 23:12:56 +0800 Subject: [PATCH] Appending to md5db in the gatkdir, with additional logging. --- public/external-example/pom.xml | 8 ++++++++ public/gatk-root/pom.xml | 20 +++++++++++++++++++ .../broadinstitute/gatk/utils/BaseTest.java | 3 +++ .../org/broadinstitute/gatk/utils/MD5DB.java | 20 +++++++++++++++---- 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/public/external-example/pom.xml b/public/external-example/pom.xml index c4c8a691c..fea1e93e3 100644 --- a/public/external-example/pom.xml +++ b/public/external-example/pom.xml @@ -204,6 +204,10 @@ **/*UnitTest.class + + ${gatk.basedir} + unit + @@ -236,6 +240,10 @@ **/*IntegrationTest.class + + ${gatk.basedir} + integrationtest + diff --git a/public/gatk-root/pom.xml b/public/gatk-root/pom.xml index b0adc4cc9..a7e720acb 100644 --- a/public/gatk-root/pom.xml +++ b/public/gatk-root/pom.xml @@ -424,6 +424,10 @@ **/*UnitTest.class + + ${gatk.basedir} + unit + @@ -474,6 +478,10 @@ **/*IntegrationTest.class + + ${gatk.basedir} + integration + @@ -491,6 +499,10 @@ **/*QueueTest.class + + ${gatk.basedir} + queue + @@ -507,6 +519,10 @@ **/*LargeScaleTest.class + + ${gatk.basedir} + largescale + @@ -523,6 +539,10 @@ **/*KnowledgeBaseTest.class + + ${gatk.basedir} + knowledgebasetests + diff --git a/public/gatk-tools-public/src/test/java/org/broadinstitute/gatk/utils/BaseTest.java b/public/gatk-tools-public/src/test/java/org/broadinstitute/gatk/utils/BaseTest.java index 1c78574df..0f73d9002 100644 --- a/public/gatk-tools-public/src/test/java/org/broadinstitute/gatk/utils/BaseTest.java +++ b/public/gatk-tools-public/src/test/java/org/broadinstitute/gatk/utils/BaseTest.java @@ -88,7 +88,10 @@ public abstract class BaseTest { public static final Logger logger = CommandLineUtils.getStingLogger(); private static final String CURRENT_DIRECTORY = System.getProperty("user.dir"); + public static final String gatkDirectory = System.getProperty("gatkdir", CURRENT_DIRECTORY) + "/"; public static final String baseDirectory = System.getProperty("basedir", CURRENT_DIRECTORY) + "/"; + public static final String testType = System.getProperty("testType"); // May be null + public static final String testTypeSubDirectory = testType == null ? "" : ("/" + testType); // May be empty public static final String hg18Reference = "/seq/references/Homo_sapiens_assembly18/v0/Homo_sapiens_assembly18.fasta"; public static final String hg19Reference = "/seq/references/Homo_sapiens_assembly19/v1/Homo_sapiens_assembly19.fasta"; diff --git a/public/gatk-tools-public/src/test/java/org/broadinstitute/gatk/utils/MD5DB.java b/public/gatk-tools-public/src/test/java/org/broadinstitute/gatk/utils/MD5DB.java index 218906fdd..0313ad3e9 100644 --- a/public/gatk-tools-public/src/test/java/org/broadinstitute/gatk/utils/MD5DB.java +++ b/public/gatk-tools-public/src/test/java/org/broadinstitute/gatk/utils/MD5DB.java @@ -49,7 +49,7 @@ public class MD5DB { */ private static final int MAX_RECORDS_TO_READ = 1000000; private static final int MAX_RAW_DIFFS_TO_SUMMARIZE = -1; - public static final String LOCAL_MD5_DB_DIR = BaseTest.baseDirectory + "integrationtests"; + public static final String LOCAL_MD5_DB_DIR = BaseTest.gatkDirectory + "integrationtests"; public static final String GLOBAL_MD5_DB_DIR = "/humgen/gsa-hpprojects/GATK/data/integrationtests"; // tracking and emitting a data file of origina and new md5s @@ -65,14 +65,26 @@ public class MD5DB { ensureMd5DbDirectory(); - logger.debug("Creating md5 mismatch db at " + MD5MismatchesFile); + boolean exists = MD5MismatchesFile.exists(); + + if (!exists) { + logger.warn("Creating md5 mismatch db at " + MD5MismatchesFile); + } else { + logger.warn("Updating md5 mismatch db at " + MD5MismatchesFile); + } + logger.warn("GATK directory: " + BaseTest.gatkDirectory); + logger.warn("Base directory: " + BaseTest.baseDirectory); + logger.warn("Test type: " + BaseTest.testType); + try { - md5MismatchStream = new PrintStream(new FileOutputStream(MD5MismatchesFile)); - md5MismatchStream.printf("%s\t%s\t%s%n", "expected", "observed", "test"); + md5MismatchStream = new PrintStream(new FileOutputStream(MD5MismatchesFile, true)); } catch ( FileNotFoundException e ) { throw new ReviewedGATKException("Failed to open md5 mismatch file", e); } + if (!exists) { + md5MismatchStream.printf("%s\t%s\t%s%n", "expected", "observed", "test"); + } } public void close() {