diff --git a/.travis.yml b/.travis.yml index b85cad5..eea05c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,3 +4,8 @@ - sbt test jdk: - oraclejdk8 +before_script: + - psql -c "CREATE ROLE sa WITH SUPERUSER LOGIN PASSWORD 'sa';" -U postgres + - psql -c "CREATE DATABASE gitbucket;" -U postgres + - mysql -e 'GRANT ALL ON *.* TO sa@"localhost"IDENTIFIED BY "sa";FLUSH PRIVILEGES;' -uroot + - mysql -e "CREATE DATABASE gitbucket;" -usa -psa diff --git a/src/test/scala/gitbucket/core/GitBucketCoreModuleSpec.scala b/src/test/scala/gitbucket/core/GitBucketCoreModuleSpec.scala index cbbe6a2..b9f23e3 100644 --- a/src/test/scala/gitbucket/core/GitBucketCoreModuleSpec.scala +++ b/src/test/scala/gitbucket/core/GitBucketCoreModuleSpec.scala @@ -27,50 +27,50 @@ } 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() +// } } }