From cba88a8861f9e55a8a92f39cfa7acd4c56f47def Mon Sep 17 00:00:00 2001 From: ebanks Date: Thu, 24 Feb 2011 21:32:35 +0000 Subject: [PATCH] Elegant solution to the determinism problem: force testNG to run tests in the order that I want it to. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5312 348d0f76-0448-11de-a6fe-93d51630548a --- .../indels/IndelRealignerIntegrationTest.java | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerIntegrationTest.java b/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerIntegrationTest.java index fff021803..e70ca9d14 100755 --- a/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerIntegrationTest.java +++ b/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerIntegrationTest.java @@ -14,45 +14,50 @@ public class IndelRealignerIntegrationTest extends WalkerTest { private static final String knownIndels = validationDataLocation + "indelRealignerTest.pilot1.ceu.vcf"; private static final String baseCommandPrefix = "-T IndelRealigner -noPG -R " + b36KGReference + " -I " + mainTestBam + " -targetIntervals " + mainTestIntervals + " -compress 0 -L 20:49,500-55,500 "; private static final String baseCommand = baseCommandPrefix + "-o %s "; + private static final String base_md5 = "282070822dc5495eb20dad157d827133"; @Test public void testDefaults() { - String md5 = "282070822dc5495eb20dad157d827133"; WalkerTestSpec spec1 = new WalkerTestSpec( baseCommand, 1, - Arrays.asList(md5)); + Arrays.asList(base_md5)); executeTest("test realigner defaults", spec1); WalkerTestSpec spec2 = new WalkerTestSpec( baseCommand + "-B:indels,vcf " + knownIndels, 1, - Arrays.asList(md5)); + Arrays.asList(base_md5)); executeTest("test realigner defaults with VCF", spec2); WalkerTestSpec spec3 = new WalkerTestSpec( baseCommand + "-D " + GATKDataLocation + "dbsnp_129_b36.rod", 1, - Arrays.asList(md5)); + Arrays.asList(base_md5)); executeTest("realigner defaults with dbsnp", spec3); } - @Test + @Test(dependsOnMethods = { "testNoTags" }) public void testStats() { - WalkerTestSpec spec = new WalkerTestSpec( + WalkerTestSpec spec1 = new WalkerTestSpec( baseCommandPrefix + "-stats %s -o /dev/null", 1, Arrays.asList("ed5a207ddf5bdda4bb76899fb3eae35c")); - executeTest("realigner stats", spec); + executeTest("realigner stats", spec1); + WalkerTestSpec spec2 = new WalkerTestSpec( + baseCommandPrefix + "-LOD 60 -stats %s -o /dev/null", + 1, + Arrays.asList("ffab7d9ca19daa8a21e0b8f0072d39e9")); + executeTest("realigner stats", spec2); } - @Test + @Test(dependsOnMethods = { "testKnownsOnly" }) public void testLods() { HashMap e = new HashMap(); - e.put( "-LOD 60", "282070822dc5495eb20dad157d827133" ); + e.put( "-LOD 60", base_md5 ); e.put( "-LOD 1", "c98d699d94f01bd0089f12646c764dfc" ); for ( Map.Entry entry : e.entrySet() ) { @@ -64,7 +69,7 @@ public class IndelRealignerIntegrationTest extends WalkerTest { } } - @Test + @Test(dependsOnMethods = { "testDefaults" }) public void testKnownsOnly() { WalkerTestSpec spec1 = new WalkerTestSpec( baseCommand + "-knownsOnly -B:indels,vcf " + knownIndels, @@ -79,7 +84,7 @@ public class IndelRealignerIntegrationTest extends WalkerTest { executeTest("realigner known indels only from dbsnp", spec2); } - @Test + @Test(dependsOnMethods = { "testLongRun" }) public void testNoTags() { WalkerTestSpec spec = new WalkerTestSpec( baseCommand + "--noOriginalAlignmentTags", @@ -88,7 +93,7 @@ public class IndelRealignerIntegrationTest extends WalkerTest { executeTest("realigner no output tags", spec); } - @Test + @Test(dependsOnMethods = { "testLods" }) public void testLongRun() { WalkerTestSpec spec = new WalkerTestSpec( "-T IndelRealigner -noPG -R " + b36KGReference + " -I " + validationDataLocation + "NA12878.chrom1.SLX.SRP000032.2009_06.bam -L 1:10,000,000-11,000,000 -targetIntervals " + validationDataLocation + "indelRealignerTest.NA12878.chrom1.intervals -compress 0 -o %s",