Skip to content

Commit

Permalink
DBMS updates
Browse files Browse the repository at this point in the history
- MariaDB liquibase and tests.
- Re-synchronize PostgreSQL schema to other DBMS.
- Use client side datetime DATETIME(6) vs. server side TIMESTAMP.
- Test that the DBMS attribute is set on all changelogs.
- Test that the quoting strategy is set for PostgreSQL changelogs.
- Test that sequences have the same width as columns.
- Database tests by default run on all DBMS.
- Add tests to ensure schemas stay synced from now on.
  • Loading branch information
kshakir committed Jul 11, 2019
1 parent d39cdfe commit e762904
Show file tree
Hide file tree
Showing 44 changed files with 2,296 additions and 874 deletions.
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ lazy val engine = project
.dependsOn(common % "test->test")
.dependsOn(core % "test->test")
.dependsOn(backend % "test->test")
.dependsOn(services % "test->test")
// In the future we may have a dedicated test backend like the `TestLocalAsyncJobExecutionActor`.
// For now, all the engine tests run on the "Local" backend, an implementation of an impl.sfs.config backend.
.dependsOn(sfsBackend % "test->compile")
Expand Down
6 changes: 4 additions & 2 deletions centaur/src/main/scala/centaur/CromwellConfiguration.scala
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
package centaur

import java.lang.ProcessBuilder.Redirect

import better.files.File
import com.typesafe.scalalogging.StrictLogging

trait CromwellProcess {
trait CromwellProcess extends StrictLogging {
def logFile: String
def displayString: String
def start(): Unit
def stop(): Unit
def isAlive: Boolean
def cromwellConfiguration: CromwellConfiguration

protected def runProcess(command: Array[String]): Process = {
logger.info(s"Running: ${command.mkString(" ")}")
val processBuilder = new java.lang.ProcessBuilder()
.command(command: _*)
.redirectOutput(Redirect.appendTo(File(logFile).toJava))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ case class DockerComposeCromwellConfiguration(dockerTag: String, dockerComposeFi
private val stopCommand = composeCommand("down -v")
private val rmCommand = composeCommand("rm -fsv")

override def displayString: String = startCommand.mkString(" ")

private var process: Option[Process] = None

override def start(): Unit = {
Expand Down
2 changes: 0 additions & 2 deletions centaur/src/main/scala/centaur/JarCromwellConfiguration.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ case class JarCromwellConfiguration(jar: String, conf: String, logFile: String)

private var process: Option[Process] = None

override def displayString: String = command.mkString(" ")

override def start(): Unit = {
process = Option(runProcess(command))
}
Expand Down
6 changes: 3 additions & 3 deletions core/src/test/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ database-test-mysql {
profile = "slick.jdbc.MySQLProfile$"
db {
driver = "com.mysql.cj.jdbc.Driver"
url = "jdbc:mysql://localhost:3306/cromwell_test?useSSL=false&rewriteBatchedStatements=true&serverTimezone=UTC"
url = "jdbc:mysql://localhost:3306/cromwell_test?useSSL=false&rewriteBatchedStatements=true&serverTimezone=UTC&useInformationSchema=true"
url = ${?CROMWELL_BUILD_MYSQL_JDBC_URL}
user = "cromwell"
user = ${?CROMWELL_BUILD_MYSQL_USERNAME}
Expand All @@ -52,8 +52,8 @@ database-test-mariadb {
# mysql --protocol=tcp -P13306 -ucromwell -ptest -e "DROP DATABASE IF EXISTS cromwell_test; CREATE DATABASE cromwell_test;"
profile = "slick.jdbc.MySQLProfile$"
db {
driver = "com.mysql.cj.jdbc.Driver"
url = "jdbc:mysql://localhost:13306/cromwell_test?useSSL=false&rewriteBatchedStatements=true&serverTimezone=UTC"
driver = "org.mariadb.jdbc.Driver"
url = "jdbc:mariadb://localhost:13306/cromwell_test?rewriteBatchedStatements=true"
url = ${?CROMWELL_BUILD_MARIADB_JDBC_URL}
user = "cromwell"
user = ${?CROMWELL_BUILD_MARIADB_USERNAME}
Expand Down
2 changes: 2 additions & 0 deletions database/migration/src/main/resources/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
<include file="changesets/enlarge_call_caching_hash_entry_id.xml" relativeToChangelogFile="true" />
<include file="changesets/postgresql_engine_schema.xml" relativeToChangelogFile="true" />
<include file="changesets/add_hog_group_in_workflow_store.xml" relativeToChangelogFile="true" />
<include file="changesets/mariadb_engine_schema.xml" relativeToChangelogFile="true" />
<include file="changesets/resync_engine_schema.xml" relativeToChangelogFile="true" />
<!-- REMINDER!
Before appending here, did you remember to include the 'objectQuotingStrategy="QUOTE_ALL_OBJECTS"' line in your changeset/xyz.xml...?
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd">

<changeSet id="add_hog_group_in_workflow_store" author="cjllanwarne">
<changeSet id="add_hog_group_in_workflow_store" author="cjllanwarne" dbms="hsqldb,mysql,postgresql">
<addColumn tableName="WORKFLOW_STORE_ENTRY">
<column name="HOG_GROUP" type="VARCHAR(100)">
<constraints nullable="true" />
Expand Down
Loading

0 comments on commit e762904

Please sign in to comment.