Added parallel switch to kitchen test functions
Change-Id: I5c08bdf042f65c7f2decc122881953886fc5bb29
diff --git a/src/com/mirantis/mk/Ruby.groovy b/src/com/mirantis/mk/Ruby.groovy
index 31876c3..939bf2c 100644
--- a/src/com/mirantis/mk/Ruby.groovy
+++ b/src/com/mirantis/mk/Ruby.groovy
@@ -34,8 +34,10 @@
/**
* Run kitchen tests in tests/integration
+ * @param environment kitchen environment (optional can be empty)
+ * @param parallel run kitchen test suites in parallel (optional, default true)
*/
-def runKitchenTests(environment=""){
+def runKitchenTests(environment="", parallel = true){
def common = new com.mirantis.mk.Common()
def kitchenTests=runKitchenCommand("list -b", environment)
if(kitchenTests && kitchenTests != ""){
@@ -47,7 +49,11 @@
runKitchenCommand("converge " + testSuite, environment)
}
}
- parallel kitchenTestRuns
+ if(parallel){
+ parallel kitchenTestRuns
+ }else{
+ common.serial(kitchenTestRuns)
+ }
runKitchenCommand("destroy", environment)
runKitchenCommand("verify -t tests/integration", environment)
}else{
@@ -67,7 +73,4 @@
}else{
return sh(script: "rbenv exec bundler exec kitchen ${cmd}", returnStdout: true)
}
-}
-
-
-
+}
\ No newline at end of file