Switch rally tests from hardcoded scenarios
Add avability to configure rally scenarios files
related review in mk-pipelines is
https://gerrit.mcp.mirantis.net/12852
Change-Id: I7937678b955d9c347cc8cda910b4bfa2d0e97656
diff --git a/src/com/mirantis/mcp/Validate.groovy b/src/com/mirantis/mcp/Validate.groovy
index 54055cc..9132fd6 100644
--- a/src/com/mirantis/mcp/Validate.groovy
+++ b/src/com/mirantis/mcp/Validate.groovy
@@ -215,7 +215,7 @@
* @param branch Git branch which will be used during the checkout
* @param ext_variables The list of external variables
*/
-def runRallyTests(master, target, dockerImageLink, output_dir, repository, branch, ext_variables = []) {
+def runRallyTests(master, target, dockerImageLink, output_dir, repository, branch, scenarios, tasks_args_file, ext_variables = []) {
def salt = new com.mirantis.mk.Salt()
def output_file = 'docker-rally.log'
def results = '/root/qa_results'
@@ -237,9 +237,23 @@
if (repository != '' ) {
cmd = "git clone -b ${branch ?: 'master'} ${repository} test_config; " +
'rally deployment create --fromenv --name=existing; ' +
- 'rally deployment config; ' +
- 'rally task start test_config/rally/scenario.yaml ' +
- '--task-args-file test_config/rally/task_arguments.yaml; '
+ 'rally deployment config; '
+ if (scenarios == '') {
+ cmd += 'rally task start test_config/rally/scenario.yaml '
+ } else {
+ cmd += "rally task start ${scenarios} "
+ }
+ switch(tasks_args_file) {
+ case 'none':
+ cmd += '; '
+ break
+ case '':
+ cmd += '--task-args-file test_config/rally/task_arguments.yaml; '
+ break
+ default:
+ cmd += "--task-args-file ${tasks_args_file}; "
+ break
+ }
}
cmd += "rally task export --type junit-xml --to ${dest_folder}/report-rally.xml; " +
"rally task report --out ${dest_folder}/report-rally.html"