Skip to content

Commit

Permalink
Improve Travis build script to be more stable
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Apr 19, 2015
1 parent 9285f8e commit b7dd4bb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ env:
- TEST_TYPE="blank-app"
global:
secure: Sc+Fw9a/cZUbqyGhQrEujg8G2gBlYVVpf7gXcBdFbot5xiHmgvzWXWDxJrkEOVYSvYPWwOnjS2w/fVFF05cCnoT2VVuMxZ3bp/wB1WMEvZ9TLIR2sFUdySohD/VZTV+DiIRZWTZmrlWXXyQmqk/H84n5QBikZZxRmyEHK4WeCag=

Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ import javax.servlet.http._
import org.scalatest._
import org.scalatest.mock.MockitoSugar
import org.mockito.Mockito._
import skinny.DBSettings
import scalikejdbc._

class TxPerRequestFilterSpec extends FunSpec with Matchers with MockitoSugar with DBSettings {
class TxPerRequestFilterSpec extends FunSpec with Matchers with MockitoSugar {

Class.forName("org.h2.Driver")
ConnectionPool.add('TxPerRequestFilterSpec_ORM, "jdbc:h2:mem:TxPerRequestFilterSpec_ORM", "sa", "sa")

val filter = new TxPerRequestFilter {
override def connectionPool = ConnectionPool.get('TxPerRequestFilterSpec_ORM)
}

describe("TxPerRequestFilter") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ class SessionInjectorControllerSpec extends ScalatraFlatSpec {

it should "renew session attributes" in {
session {
put("/session",
"hoge" -> SessionInjectorController.serialize("aaa")) {}
put("/session", "hoge" -> SessionInjectorController.serialize("aaa")) {
status should equal(200)
}
get("/session.json") {
body should include(""""hoge":"aaa"""")
}
Expand Down
10 changes: 4 additions & 6 deletions travis.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
#!/bin/bash
if [[ "$TEST_TYPE" == "framework" ]]; then
export SKINNY_ENV=test
export APP_ENV=test
if [[ "$TRAVIS_SCALA_VERSION" == 2.11* ]]; then
gem install sass &&
sbt "example/run db:migrate test" &&
sbt clean ++$TRAVIS_SCALA_VERSION coverage test
sbt clean ++$TRAVIS_SCALA_VERSION "example/run db:migrate test" coverage test
else
# skip converage for Scala 2.10
# https://github.com/scoverage/sbt-scoverage#highlighting
# skip scoverage for Scala 2.10
gem install sass &&
sbt "example/run db:migrate test" &&
sbt clean ++$TRAVIS_SCALA_VERSION test
sbt clean ++$TRAVIS_SCALA_VERSION "example/run db:migrate test" test
fi
elif [[ "$TEST_TYPE" == "blank-app" && "$TRAVIS_SCALA_VERSION" == 2.11* ]]; then
export SBT_OPTS="" && yes|./run_skinny-blank-app_test.sh
Expand Down

0 comments on commit b7dd4bb

Please sign in to comment.