[CVP] Added option to pytest to show skip reasons
Added -rs option to pytest run for CVP pipelines to see
the reasons of skipped tests.
Change-Id: I18d1999adc0a98d3260010339a2911fb0916ebc3
Closes-Bug: PROD-33744
diff --git a/src/com/mirantis/mcp/Validate.groovy b/src/com/mirantis/mcp/Validate.groovy
index 25f4465..9ac618d 100644
--- a/src/com/mirantis/mcp/Validate.groovy
+++ b/src/com/mirantis/mcp/Validate.groovy
@@ -280,7 +280,7 @@
}
}
def script = ". ${env.WORKSPACE}/venv/bin/activate; ${settings}" +
- "pytest --junitxml ${output_dir}cvp_sanity.xml --tb=short -sv ${env.WORKSPACE}/cvp-sanity-checks/cvp_checks/tests/${test_set}"
+ "pytest --junitxml ${output_dir}cvp_sanity.xml --tb=short -rs -sv ${env.WORKSPACE}/cvp-sanity-checks/cvp_checks/tests/${test_set}"
withEnv(["SALT_USERNAME=${username}", "SALT_PASSWORD=${password}", "SALT_URL=${salt_url}"]) {
def statusCode = sh script:script, returnStatus:true
}
@@ -305,7 +305,7 @@
if (container_node != "") {
def saltMaster
saltMaster = salt.connection(salt_url, salt_credentials)
- def script = "pytest --junitxml ${xml_file} --tb=short -sv ${test_set}"
+ def script = "pytest --junitxml ${xml_file} --tb=short -rs -sv ${test_set}"
env_vars.addAll("SALT_USERNAME=${username}", "SALT_PASSWORD=${password}",
"SALT_URL=${salt_url}")
variables = ' -e ' + env_vars.join(' -e ')
@@ -318,7 +318,7 @@
variables = 'export ' + env_vars.join(';export ')
}
def script = ". ${env.WORKSPACE}/venv/bin/activate; ${variables}; " +
- "pytest --junitxml ${artifacts_dir}${xml_file} --tb=short -sv ${env.WORKSPACE}/${test_set}"
+ "pytest --junitxml ${artifacts_dir}${xml_file} --tb=short -rs -sv ${env.WORKSPACE}/${test_set}"
withEnv(["SALT_USERNAME=${username}", "SALT_PASSWORD=${password}", "SALT_URL=${salt_url}"]) {
def statusCode = sh script:script, returnStatus:true
}
@@ -348,7 +348,7 @@
}
}
def script = ". ${env.WORKSPACE}/venv/bin/activate; ${settings}" +
- "pytest --junitxml ${output_dir}report.xml --tb=short -sv ${env.WORKSPACE}/${test_set}"
+ "pytest --junitxml ${output_dir}report.xml --tb=short -rs -sv ${env.WORKSPACE}/${test_set}"
withEnv(["SALT_USERNAME=${username}", "SALT_PASSWORD=${password}", "SALT_URL=${salt_url}"]) {
def statusCode = sh script:script, returnStatus:true
}