Use Travis provided DB in migration test

This commit is contained in:
Naoki Takezoe
2016-05-26 19:01:06 +09:00
parent 9103c88f0e
commit c65e843491
2 changed files with 36 additions and 31 deletions

View File

@@ -27,50 +27,50 @@ class GitBucketCoreModuleSpec extends FunSuite {
}
test("Migration MySQL"){
val config = aMysqldConfig(v5_7_10)
.withPort(3306)
.withUser("gitbucket", "gitbucket")
.withCharset(Charset.UTF8)
.build()
val mysqld = anEmbeddedMysql(config)
.addSchema("gitbucket")
.start()
try {
// val config = aMysqldConfig(v5_7_10)
// .withPort(3306)
// .withUser("gitbucket", "gitbucket")
// .withCharset(Charset.UTF8)
// .build()
//
// val mysqld = anEmbeddedMysql(config)
// .addSchema("gitbucket")
// .start()
//
// try {
new Solidbase().migrate(
DriverManager.getConnection("jdbc:mysql://localhost:3306/gitbucket", "gitbucket", "gitbucket"),
DriverManager.getConnection("jdbc:mysql://localhost:3306/gitbucket", "sa", "sa"),
Thread.currentThread().getContextClassLoader(),
new MySQLDatabase(),
new Module(GitBucketCoreModule.getModuleId, GitBucketCoreModule.getVersions)
)
} finally {
mysqld.stop()
}
// } finally {
// mysqld.stop()
// }
}
test("Migration PostgreSQL"){
val runtime = PostgresStarter.getDefaultInstance()
val config = new PostgresConfig(
PRODUCTION,
new Net("localhost", 5432),
new Storage("gitbucket"),
new Timeout(),
new Credentials("root", "root"))
val exec = runtime.prepare(config)
val process = exec.start()
try {
// val runtime = PostgresStarter.getDefaultInstance()
// val config = new PostgresConfig(
// PRODUCTION,
// new Net("localhost", 5432),
// new Storage("gitbucket"),
// new Timeout(),
// new Credentials("root", "root"))
//
// val exec = runtime.prepare(config)
// val process = exec.start()
//
// try {
new Solidbase().migrate(
DriverManager.getConnection("jdbc:postgresql://localhost:5432/gitbucket", "root", "root"),
DriverManager.getConnection("jdbc:postgresql://localhost:5432/gitbucket", "sa", "sa"),
Thread.currentThread().getContextClassLoader(),
new PostgresDatabase(),
new Module(GitBucketCoreModule.getModuleId, GitBucketCoreModule.getVersions)
)
} finally {
process.stop()
}
// } finally {
// process.stop()
// }
}
}