diff options
author | Nathan Fischer <nfischer921@gmail.com> | 2019-04-09 17:53:06 -0700 |
---|---|---|
committer | Tobias Roeser <le.petit.fou@web.de> | 2019-04-17 08:06:46 +0200 |
commit | bb7673afc83bac32b756863c158d7fd4455d6fee (patch) | |
tree | 9f24fb518831b77318f7d7361a157b079f17369f /contrib/flyway/test/src | |
parent | 78c65edfcfdce450dad478c0d9ef91e524c31f7a (diff) | |
download | mill-bb7673afc83bac32b756863c158d7fd4455d6fee.tar.gz mill-bb7673afc83bac32b756863c158d7fd4455d6fee.tar.bz2 mill-bb7673afc83bac32b756863c158d7fd4455d6fee.zip |
Tests
Diffstat (limited to 'contrib/flyway/test/src')
-rw-r--r-- | contrib/flyway/test/src/BuildTest.scala | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/contrib/flyway/test/src/BuildTest.scala b/contrib/flyway/test/src/BuildTest.scala new file mode 100644 index 00000000..9f51f72c --- /dev/null +++ b/contrib/flyway/test/src/BuildTest.scala @@ -0,0 +1,53 @@ +package mill.contrib.flyway + +import mill._ +import mill.scalalib._ +import mill.util.{TestEvaluator, TestUtil} +import utest.{TestSuite, Tests, assert, _} + +object BuildTest extends TestSuite { + object Build extends TestUtil.BaseModule { + object build extends FlywayModule { + + def resources = T.sources(os.pwd / 'contrib / 'flyway / 'test / 'resources) + + def postgres = ivy"org.postgresql:postgresql:42.2.5" + + def flywayUrl = "jdbc:postgresql:test_db" + def flywayUser = "postgres" + def flywayDriverDeps = Agg(postgres) + } + } + + def tests = Tests { + 'clean - { + val eval = new TestEvaluator(Build) + val Right((_, count)) = eval(Build.build.flywayClean()) + assert(count > 0) + } + + 'migrate - { + val eval = new TestEvaluator(Build) + val Right((res, count)) = eval(Build.build.flywayMigrate()) + assert( + count > 0, + res == 1 + ) + } + + 'migrateAgain - { + val eval = new TestEvaluator(Build) + val Right((res, count)) = eval(Build.build.flywayMigrate()) + assert( + count > 0, + res == 0 + ) + } + + 'info - { + val eval = new TestEvaluator(Build) + val Right((_, count)) = eval(Build.build.flywayInfo()) + assert(count > 0) + } + } +}
\ No newline at end of file |