Skip to content

Commit

Permalink
Added environment varibale for enable/disable ODBC Tests
Browse files Browse the repository at this point in the history
for run them use -Pnative.enable=true
  • Loading branch information
Piyush Bisen committed Jul 30, 2019
1 parent 96f6dac commit 7cb09a6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
3 changes: 3 additions & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ if (rootProject.hasProperty('enablePublish')) {
}

scalaTest {
if (rootProject.hasProperty('native.enabled')) {
environment 'SNAPPY_NATIVE_ENABLED': rootProject.property('native.enabled')
}
dependsOn ':cleanScalaTest'
doFirst {
// cleanup files since scalatest plugin does not honour workingDir yet
Expand Down
22 changes: 11 additions & 11 deletions core/src/test/scala/io/snappydata/CommandLineToolsSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -288,25 +288,25 @@ class CommandLineToolsSuite extends SnappyTestRunner {
s"-locators option still displayed in run command's usage text!")
}

ignore("ODBC_FailOverTest_NEWSERVER"){
try {
test("ODBC_FailOverTest_AddServer_BeforeConn") {
val flag = System.getenv("SNAPPY_NATIVE_ENABLED")
if (flag.equalsIgnoreCase("true")) {
var scriptPath = s"$snappyNativeTestDir/failoverTest_NewServer.sh"
var consoleOutput = s"$scriptPath $snappyProductDir $snappyNativeTestDir".!!
assert(consoleOutput.contains("Test executed successfully"),
assert(consoleOutput.contains("Test executed successfully connected to"),
s"FailOver failed $consoleOutput")
} finally {

System.out.println(consoleOutput)
}
}

ignore("ODBC_FailOverTest_NONE"){
try {
test("ODBC_FailOverTest_AddServer_AfterConn") {
val flag = System.getenv("SNAPPY_NATIVE_ENABLED")
if (flag.equalsIgnoreCase("true")) {
var scriptPath = s"$snappyNativeTestDir/failoverTest_None.sh"
var consoleOutput = s"$scriptPath $snappyProductDir $snappyNativeTestDir".!!
assert(consoleOutput.contains("Test executed successfully, no failover tried"),
s"There failover tried but failed $consoleOutput")
} finally {

assert(consoleOutput.contains("Test executed successfully connected to"),
s"Failed to create new connection $consoleOutput")
System.out.println(consoleOutput)
}
}
}

0 comments on commit 7cb09a6

Please sign in to comment.