diff --git a/core/build.gradle b/core/build.gradle index f69a3c04d7..ed405f6572 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -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 diff --git a/core/src/test/scala/io/snappydata/CommandLineToolsSuite.scala b/core/src/test/scala/io/snappydata/CommandLineToolsSuite.scala index 6446154a3c..4e95ccedcb 100644 --- a/core/src/test/scala/io/snappydata/CommandLineToolsSuite.scala +++ b/core/src/test/scala/io/snappydata/CommandLineToolsSuite.scala @@ -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) } } }