Commit 205d9cc4 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Fixing unit tests

parent bcbb2916
......@@ -297,7 +297,10 @@ trait ReportBuilder extends ToolCommand {
summary.getPipelineName(pipelineId = pipelineId).map(_.get -> Future(ReportPage(Nil, Await.result(Future.sequence(moduleSectionsSorted), Duration.Inf).toList, Map())))
})
val pipelineFiles = summary.getPipelineId(runId, pipelineName).flatMap(pipelinelineId => dbFiles.map(x => x(pipelinelineId.get).filter(_.moduleId.isEmpty)))
val pipelineFiles = summary.getPipelineId(runId, pipelineName)
.flatMap(pipelinelineId => dbFiles
.map(x => x.get(pipelinelineId.get).getOrElse(Seq())
.filter(_.moduleId.isEmpty)))
modulePages.flatMap(Future.sequence(_)).map(x => ReportPage(x.toList,
s"$pipelineName files" -> ReportSection("/nl/lumc/sasc/biopet/core/report/files.ssp", Map("files" -> Await.result(pipelineFiles, Duration.Inf))) ::
......
......@@ -16,6 +16,7 @@ package nl.lumc.sasc.biopet.core.report
import java.io.File
import java.nio.file.Paths
import java.sql.Date
import com.google.common.io.Files
import nl.lumc.sasc.biopet.utils.summary.db.SummaryDb
......@@ -23,7 +24,7 @@ import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.Test
import scala.concurrent.{ Await, Future }
import scala.concurrent.{Await, Future}
import scala.concurrent.duration.Duration
/**
......@@ -54,6 +55,9 @@ class MultisampleReportBuilderTest extends TestNGSuite with Matchers {
val db = SummaryDb.openSqliteSummary(dbFile)
db.createTables()
Await.ready(db.createPipeline("test", 0), Duration.Inf)
Await.ready(db.createRun("test", "", "", "", new Date(System.currentTimeMillis())), Duration.Inf)
val sample = Some("sampleName")
val lib = Some("libName")
......
......@@ -16,14 +16,15 @@ package nl.lumc.sasc.biopet.core.report
import java.io.File
import java.nio.file.Paths
import java.sql.Date
import com.google.common.io.Files
import nl.lumc.sasc.biopet.utils.summary.db.SummaryDb
import org.scalatest.Matchers
import org.scalatest.testng.TestNGSuite
import org.testng.annotations.{ DataProvider, Test }
import org.testng.annotations.{DataProvider, Test}
import scala.concurrent.{ Await, Future }
import scala.concurrent.{Await, Future}
import scala.concurrent.duration.Duration
/**
......@@ -64,6 +65,8 @@ class ReportBuilderTest extends TestNGSuite with Matchers {
Await.result(db.createLibrary(libName, 0, sampleId), Duration.Inf)
}
}
Await.ready(db.createPipeline("test", 0), Duration.Inf)
Await.ready(db.createRun("test", "", "", "", new Date(System.currentTimeMillis())), Duration.Inf)
val tempDir = Files.createTempDir()
tempDir.deleteOnExit()
......
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