Commit 5ce42de7 authored by Wai Yi Leung's avatar Wai Yi Leung
Browse files

Merge branch 'fix-gentrap_tests' into 'develop'

Fix threading issue in unit tests



See merge request !346
parents 610e9327 8449e73b
......@@ -3,12 +3,11 @@ import java.io.File
import nl.lumc.sasc.biopet.extensions.tools.VcfFilter
import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.{DataProvider, Test}
import org.testng.annotations.{ DataProvider, Test }
/**
* Created by ahbbollen on 2-3-16.
*/
* Created by ahbbollen on 2-3-16.
*/
class VcfFilterTest extends TestNGSuite with Matchers {
def cmd(s: String) = {
......@@ -112,7 +111,7 @@ class VcfFilterTest extends TestNGSuite with Matchers {
}
if (minAlternateDepth.isDefined) {
cmdString = "--minAlternateDepth " + minAlternateDepth.getOrElse("") :: cmdString
cmdString = "--minAlternateDepth " + minAlternateDepth.getOrElse("") :: cmdString
}
if (minSamplesPass.isDefined) {
......@@ -183,7 +182,6 @@ class VcfFilterTest extends TestNGSuite with Matchers {
cmdString = "--minQualScore " + minQualScore.getOrElse("") :: cmdString
}
cmdString.foreach(x => command.contains(x) shouldBe true)
}
......
......@@ -30,7 +30,7 @@ import scala.sys.process.{ Process, ProcessLogger }
trait Rscript extends Configurable {
protected var script: File
def rscriptExecutable: String = config("exe", default = "Rscript", submodule = "Rscript")
def rscriptExecutable: String = config("exe", default = "Rscript", submodule = "rscript")
/** This is the defaul implementation, to add arguments override this */
def cmd: Seq[String] = Seq(rscriptExecutable, script.getAbsolutePath)
......
......@@ -15,18 +15,17 @@
*/
package nl.lumc.sasc.biopet.pipelines.gentrap
import java.io.{ File, FileOutputStream }
import java.io.{File, FileOutputStream}
import com.google.common.io.Files
import nl.lumc.sasc.biopet.extensions.tools.BaseCounter
import nl.lumc.sasc.biopet.utils.config.Config
import nl.lumc.sasc.biopet.extensions._
import nl.lumc.sasc.biopet.extensions.tools.BaseCounter
import nl.lumc.sasc.biopet.utils.ConfigUtils
import org.apache.commons.io.FileUtils
import nl.lumc.sasc.biopet.utils.config.Config
import org.broadinstitute.gatk.queue.QSettings
import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.{ AfterClass, DataProvider, Test }
import org.testng.annotations.{DataProvider, Test}
abstract class GentrapTestAbstract(val expressionMeasure: String) extends TestNGSuite with Matchers {
......@@ -143,10 +142,6 @@ abstract class GentrapTestAbstract(val expressionMeasure: String) extends TestNG
}
}
// remove temporary run directory all tests in the class have been run
@AfterClass def removeTempOutputDir() = {
FileUtils.deleteDirectory(GentrapTest.outputDir)
}
}
class GentrapFragmentsPerGeneTest extends GentrapTestAbstract("fragments_per_gene")
......@@ -158,6 +153,7 @@ class GentrapCufflinksBlindTest extends GentrapTestAbstract("cufflinks_blind")
object GentrapTest {
val outputDir = Files.createTempDir()
outputDir.deleteOnExit()
new File(outputDir, "input").mkdirs()
def inputTouch(name: String): String = {
val file = new File(outputDir, "input" + File.separator + name)
......@@ -182,7 +178,8 @@ object GentrapTest {
"annotation_gtf" -> (outputDir + File.separator + "ref.fa"),
"annotation_bed" -> (outputDir + File.separator + "ref.fa"),
"annotation_refflat" -> (outputDir + File.separator + "ref.fa"),
"varscan_jar" -> "test"
"varscan_jar" -> "test",
"rscript" -> Map("exe" -> "test")
) ++ Seq(
// fastqc executables
"fastqc", "seqtk", "sickle", "cutadapt",
......
......@@ -133,6 +133,8 @@ object ShivaVariantcallingTest {
"md5sum" -> Map("exe" -> "test"),
"bgzip" -> Map("exe" -> "test"),
"tabix" -> Map("exe" -> "test"),
"rscript" -> Map("exe" -> "test"),
"exe" -> "test",
"varscan_jar" -> "test"
)
}
\ No newline at end of file
Markdown is supported
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