Skip to content

Commit

Permalink
iss #33: [wip] Co2Report servlet tests 4 - fix parallel exec
Browse files Browse the repository at this point in the history
  • Loading branch information
maizy committed Nov 29, 2016
1 parent 085f76f commit 8e4eba9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions ambient7-webapp/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ containerPort := 22480
(test in Test).value
}
scalastyleFailOnError := true
// TODO remove shared DB connection pool and turn on
parallelExecution in Test := false
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package ru.maizy.ambient7.webapp.tests

import com.typesafe.scalalogging.LazyLogging
import org.flywaydb.core.Flyway
import org.scalatest.{ FlatSpecLike, Matchers }
import org.scalatest.{ BeforeAndAfterAll, FlatSpecLike, Matchers }
import org.scalatra.test.scalatest.ScalatraSuite
import scalikejdbc.ConnectionPool
import ru.maizy.ambient7.webapp.AppConfig
Expand Down Expand Up @@ -49,16 +49,12 @@ abstract class BaseServletTest
with FlatSpecLike
with Matchers
with LazyLogging
with BeforeAndAfterAll
{
val bootstrap = new TestsBootstrap {}

protected override def afterAll(): Unit = {
super.afterAll()
bootstrap.destroyWebApp()
}


protected override def beforeAll(): Unit = {
logger.info("before all")
super.beforeAll()
bootstrap.loadTestConfig()
setupConfig(bootstrap.appConfig)
Expand All @@ -67,6 +63,12 @@ abstract class BaseServletTest
initServlets(bootstrap.appConfig)
}

protected override def afterAll(): Unit = {
logger.info("after all")
bootstrap.destroyWebApp()
super.afterAll()
}

private[tests] def setupBootstrapBeforeTests(): Unit = {}

def setupConfig(config: AppConfig): Unit = {}
Expand Down

0 comments on commit 8e4eba9

Please sign in to comment.