Skip to content
Snippets Groups Projects
Commit 95abfc8e authored by Wai Yi Leung's avatar Wai Yi Leung
Browse files

Merge branch 'patch-pipelines_test' into 'develop'

Patch pipelines test

This is a patch for the newly added pipeline tests to ensure that each pipeline test has a unique directory that is removed after the test. The curren behaviour is to use a named directory in the user's tmp directory, that may fail if a directory with that name already exist.

@p.j.van_t_hof , this is what we discussed earlier.

See merge request !96
parents dfb1ece5 280f922d
No related branches found
No related tags found
No related merge requests found
......@@ -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",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment