mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 22:15:51 +01:00
Use Travis provided DB in migration test
This commit is contained in:
@@ -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()
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user