Skip to content

Commit

Permalink
Merge pull request #30 from cbmi/travis_ci_support
Browse files Browse the repository at this point in the history
Add Travis CI Support
  • Loading branch information
mitalia committed Aug 1, 2013
2 parents 42ba67c + 54568c8 commit 486088f
Show file tree
Hide file tree
Showing 12 changed files with 118 additions and 176 deletions.
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: scala
scala:
- 2.10.0

#once develop is fixed we can turn this on
branches:
only:
- master
services:
- mysql
- posgres
- sqlite3

before_script:
- mysql -e 'create database dataexpress_test;'
- psql -c 'create database dataexpress_test;' -U postgres

#Note that sbt needs the entire command quoted as well as quotes around the tags to exclude
script:
- sbt ++$TRAVIS_SCALA_VERSION 'test-only * -- -l "edu.chop.cbmi.dataExpress.test.util.tags.SqlServerTest edu.chop.cbmi.dataExpress.test.util.tags.OracleTest"'
5 changes: 5 additions & 0 deletions src/test/resources/mysql_travis_test.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
driverClassName=com.mysql.jdbc.Driver
jdbcUri=jdbc:mysql://127.0.0.1/dataexpress_test
user=travis
password=
jdbcCompliantTruncation=false
4 changes: 4 additions & 0 deletions src/test/resources/postgres_travis_test.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
driverClassName=org.postgresql.Driver
jdbcUri=dbc:postgresql://127.0.0.1/dataexpress_test
user=travis
password=
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import java.util.Properties
import edu.chop.cbmi.dataExpress.backends.MySqlBackend
import edu.chop.cbmi.dataExpress.dataModels._
import edu.chop.cbmi.dataExpress.dataModels.sql._
import edu.chop.cbmi.dataExpress.test.util.TestProps
import edu.chop.cbmi.dataExpress.test.util._
import edu.chop.cbmi.dataExpress.test.util.cars.dataSetup.backends.MySqlDataSetup
import scala.language.reflectiveCalls

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,25 @@ package edu.chop.cbmi.dataExpress.test.backends



import org.scalatest.FeatureSpec
import org.scalatest.{FeatureSpec}
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.GivenWhenThen
import java.util.Properties
import edu.chop.cbmi.dataExpress.test.util.TestProps
import edu.chop.cbmi.dataExpress.test.util._
import edu.chop.cbmi.dataExpress.dataModels._
import edu.chop.cbmi.dataExpress.dataModels.sql._
import edu.chop.cbmi.dataExpress.backends.OracleBackend
import scala.language.reflectiveCalls
import edu.chop.cbmi.dataExpress.test.util.cars.dataSetup.backends.OracleDataSetup


class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with ShouldMatchers {

def fixture =
new {
val props = TestProps.getDbProps("oracle")
}


//TODO: Hard-coding schema names and users in the tests like this is confusing. It's not clear how they relate to the properties file
//This stuff all needs to be re-worked
val dbSchema:Option[String] = Some("QE10C01")
val targetDbUserName:String = "QE10C01"

Expand Down Expand Up @@ -73,7 +72,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul

}

scenario("The user can create a table with four columns") {
scenario("The user can create a table with four columns", OracleTest) {

val f = fixture
val tableName = "cars_deba_a"
Expand Down Expand Up @@ -144,7 +143,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul
backend.close()
}

scenario("The user can truncate a table and commit") {
scenario("The user can truncate a table and commit", OracleTest) {
val f = fixture

val tableName:String = "cars_deba_a"
Expand Down Expand Up @@ -182,9 +181,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul

}



scenario("The inserted row can be committed by executing an insert query") {
scenario("The inserted row can be committed by executing an insert query", OracleTest) {
val f = fixture
val backend = new OracleBackend(f.props)
val tableName = "cars_deba_a"
Expand Down Expand Up @@ -224,8 +221,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul
backend.close()
}


scenario("The user can obtain a record from executing a select query") {
scenario("The user can obtain a record from executing a select query", OracleTest) {
//Prerequisites: scenario 1: Passed

val f = fixture
Expand Down Expand Up @@ -258,12 +254,8 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul

backend.close()
}




//THIS SHOULD WORK
scenario("The user can determine whether a select query has returned a record") {
scenario("The user can determine whether a select query has returned a record", OracleTest) {
//Prerequisites: scenario 1: Passed

val f = fixture
Expand Down Expand Up @@ -304,13 +296,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul

}







scenario("The user can commit an open transaction") {
scenario("The user can commit an open transaction", OracleTest) {

val f = fixture

Expand Down Expand Up @@ -384,10 +370,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul

}




scenario("The user can truncate a populated table") {
scenario("The user can truncate a populated table", OracleTest) {
val f = fixture

val tableName:String = "cars_deba_a"
Expand Down Expand Up @@ -420,10 +403,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul

}




scenario("The user can roll back an open transaction") {
scenario("The user can roll back an open transaction", OracleTest) {

val f = fixture

Expand Down Expand Up @@ -483,12 +463,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul

}






scenario("The user can open a transaction, insert a row, and end the transaction") {
scenario("The user can open a transaction, insert a row, and end the transaction", OracleTest) {

val f = fixture

Expand Down Expand Up @@ -563,9 +538,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul

}



scenario("The user can create a table with 32 columns") {
scenario("The user can create a table with 32 columns", OracleTest) {
val f = fixture

val tableName = "cars_deba_b"
Expand Down Expand Up @@ -614,9 +587,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul
backend.close()
}



scenario("The user can insert a row without constructing an insert statement") {
scenario("The user can insert a row without constructing an insert statement", OracleTest) {
val f = fixture
val tableName: String = "cars_deba_a"
val columnNames: List[String] = List("carid", "carnumber", "carmake", "carmodel")
Expand Down Expand Up @@ -651,13 +622,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul

}







scenario("The user can insert a batch of rows and commit without having to construct the insert statements") {
scenario("The user can insert a batch of rows and commit without having to construct the insert statements", OracleTest) {
val f = fixture

val tableName:String = "cars_deba_a"
Expand Down Expand Up @@ -720,10 +685,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul

}




scenario("The user can drop a table") {
scenario("The user can drop a table", OracleTest) {
val f = fixture

val tableName:String = "cars_deba_c"
Expand Down Expand Up @@ -774,12 +736,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul

}






scenario("The user can drop a table with cascade") {
scenario("The user can drop a table with cascade", OracleTest) {
val f = fixture
val tableName: String = "cars_deba_c"
val viewName: String = "cars_deba_c_v"
Expand Down Expand Up @@ -818,11 +775,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul

}





scenario("The user can iterate over the results of a select query") {
scenario("The user can iterate over the results of a select query", OracleTest) {
//Prerequisites: Need Multiple Row in table cars_deba_a

val f = fixture
Expand Down Expand Up @@ -854,10 +807,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul
backend.close()
}




scenario("The user can update a record in a table using a valid update statement") {
scenario("The user can update a record in a table using a valid update statement", OracleTest) {
//Prerequisites: Need Multiple Row in table cars_deba_a

val f = fixture
Expand Down Expand Up @@ -916,8 +866,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul
backend.close()
}


scenario("The user can update a multiple records in a table using a valid update statement") {
scenario("The user can update a multiple records in a table using a valid update statement", OracleTest) {
//Prerequisites: Need Multiple Row in table cars_deba_a

val f = fixture
Expand Down Expand Up @@ -970,11 +919,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul
backend.close()
}





scenario("The user can update a multiple records in a table without constructing update statement") {
scenario("The user can update a multiple records in a table without constructing update statement", OracleTest) {
//Prerequisites: Need Multiple Row in table cars_deba_a with carmake = 'MiniCoopeRb'

val f = fixture
Expand Down Expand Up @@ -1033,11 +978,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul
backend.close()
}





scenario("The user can insert a multiple rows using a loop without constructing an insert statement") {
scenario("The user can insert a multiple rows using a loop without constructing an insert statement", OracleTest) {
//Prerequisites: None of theses record should exist
val f = fixture

Expand Down Expand Up @@ -1090,11 +1031,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul

}





scenario("The user can delete multiple records in a table using a valid delete statement") {
scenario("The user can delete multiple records in a table using a valid delete statement", OracleTest) {
//Prerequisites: Need Multiple Row in table cars_deba_a

val f = fixture
Expand Down Expand Up @@ -1134,12 +1071,7 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul

}






scenario("The user can drop all tables that begin with a certain string") {
scenario("The user can drop all tables that begin with a certain string", OracleTest) {

/*http://stackoverflow.com/questions/3476765/mysql-drop-all-tables-ignoring-foreign-keys*/

Expand Down Expand Up @@ -1203,17 +1135,14 @@ class OracleBackendFeatureSpec extends FeatureSpec with GivenWhenThen with Shoul

}




scenario("Remove Test Data Setup") {
scenario("Remove Test Data Setup", OracleTest) {
/**** Remove Test Data ****/
removeTestDataSetup
/**** ****/

}

scenario("Close Test SetUp Connections") {
scenario("Close Test SetUp Connections", OracleTest) {

setup.targetBackend.close

Expand Down
Loading

0 comments on commit 486088f

Please sign in to comment.