Commit 280f922d authored by bow's avatar bow
Browse files

Use unique and transient temp directory for each pipeline test

parent bec375ba
......@@ -2,15 +2,18 @@ package nl.lumc.sasc.biopet.pipelines.carp
import java.io.File
import com.google.common.io.Files
import org.apache.commons.io.FileUtils
import org.broadinstitute.gatk.queue.QSettings
import org.testng.annotations.{ AfterClass, Test, DataProvider }
import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite
import nl.lumc.sasc.biopet.core.config.Config
import nl.lumc.sasc.biopet.extensions.bwa.BwaMem
import nl.lumc.sasc.biopet.extensions.macs2.Macs2CallPeak
import nl.lumc.sasc.biopet.extensions.picard.{ MergeSamFiles, SortSam }
import nl.lumc.sasc.biopet.utils.ConfigUtils
import org.broadinstitute.gatk.queue.QSettings
import org.testng.annotations.{ Test, DataProvider }
import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite
/**
* Created by pjvan_thof on 2/13/15.
......@@ -69,10 +72,15 @@ class CarpTest extends TestNGSuite with Matchers {
carp.functions.count(_.isInstanceOf[Macs2CallPeak]) shouldBe (numberSamples + (if (threatment) 1 else 0))
}
}
// remove temporary run directory all tests in the class have been run
@AfterClass def removeTempOutputDir() = {
FileUtils.deleteDirectory(CarpTest.outputDir)
}
}
object CarpTest {
val outputDir = System.getProperty("java.io.tmpdir") + File.separator + "flexiprep"
val outputDir = Files.createTempDir()
val excutables = Map(
"reference" -> "test",
......
......@@ -2,15 +2,17 @@ package nl.lumc.sasc.biopet.pipelines.flexiprep
import java.io.File
import com.google.common.io.Files
import org.apache.commons.io.FileUtils
import org.broadinstitute.gatk.queue.QSettings
import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.{ AfterClass, DataProvider, Test }
import nl.lumc.sasc.biopet.core.config.Config
import nl.lumc.sasc.biopet.extensions.{ Gzip, Zcat }
import nl.lumc.sasc.biopet.tools.FastqSync
import nl.lumc.sasc.biopet.utils.ConfigUtils
import org.broadinstitute.gatk.queue.QSettings
import org.broadinstitute.gatk.queue.function.QFunction
import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.{ DataProvider, Test }
/**
* Created by pjvan_thof on 2/11/15.
......@@ -67,9 +69,15 @@ class FlexiprepTest extends TestNGSuite with Matchers {
flexiprep.functions.count(_.isInstanceOf[Sickle]) shouldBe (if (skipTrim) 0 else 1)
flexiprep.functions.count(_.isInstanceOf[Gzip]) shouldBe (if (paired) 2 else 1)
}
// remove temporary run directory all tests in the class have been run
@AfterClass def removeTempOutputDir() = {
FileUtils.deleteDirectory(FlexiprepTest.outputDir)
}
}
object FlexiprepTest {
val outputDir = System.getProperty("java.io.tmpdir") + File.separator + "flexiprep"
val outputDir = Files.createTempDir()
val excutables = Map(
"seqstat" -> Map("exe" -> "test"),
......
......@@ -2,6 +2,13 @@ package nl.lumc.sasc.biopet.pipelines.mapping
import java.io.File
import com.google.common.io.Files
import org.apache.commons.io.FileUtils
import org.broadinstitute.gatk.queue.QSettings
import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.{ AfterClass, DataProvider, Test }
import nl.lumc.sasc.biopet.core.config.Config
import nl.lumc.sasc.biopet.extensions.bwa.{ BwaSamse, BwaSampe, BwaAln, BwaMem }
import nl.lumc.sasc.biopet.extensions.picard.{ MergeSamFiles, AddOrReplaceReadGroups, MarkDuplicates, SortSam }
......@@ -12,10 +19,6 @@ import nl.lumc.sasc.biopet.pipelines.flexiprep.Sickle
import nl.lumc.sasc.biopet.pipelines.flexiprep._
import nl.lumc.sasc.biopet.tools.FastqSync
import nl.lumc.sasc.biopet.utils.ConfigUtils
import org.broadinstitute.gatk.queue.QSettings
import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.{ DataProvider, Test }
/**
* Created by pjvan_thof on 2/12/15.
......@@ -94,10 +97,15 @@ class MappingTest extends TestNGSuite with Matchers {
mapping.functions.count(_.isInstanceOf[MergeSamFiles]) shouldBe (if (skipMarkDuplicate && chunks > 1) 1 else 0)
mapping.functions.count(_.isInstanceOf[MarkDuplicates]) shouldBe (if (skipMarkDuplicate) 0 else 1)
}
// remove temporary run directory all tests in the class have been run
@AfterClass def removeTempOutputDir() = {
FileUtils.deleteDirectory(MappingTest.outputDir)
}
}
object MappingTest {
val outputDir = System.getProperty("java.io.tmpdir") + File.separator + "flexiprep"
val outputDir = Files.createTempDir()
val excutables = Map(
"reference" -> "test",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment