diff options
author | Nathan Fischer <nfischer921@gmail.com> | 2019-04-10 14:17:55 -0700 |
---|---|---|
committer | Tobias Roeser <le.petit.fou@web.de> | 2019-04-17 08:06:46 +0200 |
commit | 6abf903f63b6cbf178b435b958822d88e26df5a7 (patch) | |
tree | 31a19d720c453b561850f15606a7c0adbbad31e4 | |
parent | bb7673afc83bac32b756863c158d7fd4455d6fee (diff) | |
download | mill-6abf903f63b6cbf178b435b958822d88e26df5a7.tar.gz mill-6abf903f63b6cbf178b435b958822d88e26df5a7.tar.bz2 mill-6abf903f63b6cbf178b435b958822d88e26df5a7.zip |
PR comments
-rw-r--r-- | .travis.yml | 5 | ||||
-rwxr-xr-x | ci/test-mill-0.5.sh | 11 | ||||
-rwxr-xr-x | ci/test-mill-0.sh | 2 | ||||
-rw-r--r-- | contrib/flyway/src/FlywayModule.scala | 2 | ||||
-rw-r--r-- | contrib/flyway/test/resources/db/migration/V1__test_init_migration.sql | 5 | ||||
-rw-r--r-- | contrib/flyway/test/src/BuildTest.scala | 15 |
6 files changed, 12 insertions, 28 deletions
diff --git a/.travis.yml b/.travis.yml index 9ae0ba67..e7a73872 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,11 +28,6 @@ matrix: env: CI_SCRIPT=ci/test-mill-0.sh jdk: oraclejdk8 - stage: build - env: CI_SCRIPT=ci/test-mill-0.5.sh - jdk: oraclejdk8 - addons: - postgresql: "9.6" - - stage: build env: CI_SCRIPT=ci/test-mill-1.sh jdk: oraclejdk8 - stage: build diff --git a/ci/test-mill-0.5.sh b/ci/test-mill-0.5.sh deleted file mode 100755 index 20c58c7f..00000000 --- a/ci/test-mill-0.5.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -eux - -# Starting from scratch... -git clean -xdf - -psql -c 'create database test_db;' -U postgres - -# Run tests that use a db -mill -i contrib.flyway.test diff --git a/ci/test-mill-0.sh b/ci/test-mill-0.sh index b1dd7e49..fa8d7604 100755 --- a/ci/test-mill-0.sh +++ b/ci/test-mill-0.sh @@ -6,4 +6,4 @@ set -eux git clean -xdf # Run tests -mill -i all {main,scalalib,scalajslib,contrib.twirllib,contrib.playlib,main.client,contrib.scalapblib}.test +mill -i all {main,scalalib,scalajslib,contrib.twirllib,contrib.playlib,main.client,contrib.scalapblib,contrib.flyway}.test diff --git a/contrib/flyway/src/FlywayModule.scala b/contrib/flyway/src/FlywayModule.scala index 75c66e97..f73e8e7b 100644 --- a/contrib/flyway/src/FlywayModule.scala +++ b/contrib/flyway/src/FlywayModule.scala @@ -41,7 +41,7 @@ trait FlywayModule extends JavaModule { .map(key -> _) private implicit val flywayWriter = writer[String].comap[Flyway](_.toString) - def flywayInstance = T.command { + def flywayInstance = T.worker { val jdbcClassloader = new URLClassLoader(jdbcClasspath().map(_.path.toIO.toURI.toURL).toArray) val configProps = Map(flyway.URL -> flywayUrl()) ++ diff --git a/contrib/flyway/test/resources/db/migration/V1__test_init_migration.sql b/contrib/flyway/test/resources/db/migration/V1__test_init_migration.sql new file mode 100644 index 00000000..964391a2 --- /dev/null +++ b/contrib/flyway/test/resources/db/migration/V1__test_init_migration.sql @@ -0,0 +1,5 @@ + +create table test_table ( + id bigserial primary key, + field varchar +);
\ No newline at end of file diff --git a/contrib/flyway/test/src/BuildTest.scala b/contrib/flyway/test/src/BuildTest.scala index 9f51f72c..961e0522 100644 --- a/contrib/flyway/test/src/BuildTest.scala +++ b/contrib/flyway/test/src/BuildTest.scala @@ -11,10 +11,9 @@ object BuildTest extends TestSuite { def resources = T.sources(os.pwd / 'contrib / 'flyway / 'test / 'resources) - def postgres = ivy"org.postgresql:postgresql:42.2.5" + def postgres = ivy"com.h2database:h2:1.4.199" - def flywayUrl = "jdbc:postgresql:test_db" - def flywayUser = "postgres" + def flywayUrl = "jdbc:h2:mem:test_db;DB_CLOSE_DELAY=-1" def flywayDriverDeps = Agg(postgres) } } @@ -33,14 +32,10 @@ object BuildTest extends TestSuite { count > 0, res == 1 ) - } - - 'migrateAgain - { - val eval = new TestEvaluator(Build) - val Right((res, count)) = eval(Build.build.flywayMigrate()) + val Right((resAgain, countAgain)) = eval(Build.build.flywayMigrate()) assert( - count > 0, - res == 0 + countAgain > 0, + resAgain == 0 ) } |