Add ability to disable report and change testrail plan name prefix
Change-Id: Id87e720046fec6f072339fe64e40bcfa7f3be6d0
Related-PROD: PROD-28588
diff --git a/src/com/mirantis/system_qa/SharedPipeline.groovy b/src/com/mirantis/system_qa/SharedPipeline.groovy
index 53927f7..d052f32 100644
--- a/src/com/mirantis/system_qa/SharedPipeline.groovy
+++ b/src/com/mirantis/system_qa/SharedPipeline.groovy
@@ -291,6 +291,7 @@
string(name: 'PARENT_WORKSPACE', value: pwd()),
string(name: 'TCP_QA_REFS', value: "${tcp_qa_refs}"),
string(name: 'TEMPEST_TEST_SUITE_NAME', value: "${tempest_test_suite_name}"),
+ string(name: 'TEST_PLAN_NAME_PREFIX', value: env.TESTRAIL_TEST_PLAN_NAME_PREFIX ?: ''),
]
common.printMsg("Start building job 'swarm-testrail-report' with parameters:", "purple")
common.prettyPrint(parameters)
@@ -552,12 +553,15 @@
writeFile(file: filename, text: script, encoding: "UTF-8")
}
-def upload_results_to_testrail(report_name, testSuiteName, methodname, testrail_name_template, reporter_extra_options=[]) {
+def upload_results_to_testrail(report_name, testSuiteName, methodname, testrail_name_template, reporter_extra_options=[], testPlanNamePrefix=null) {
def venvPath = '/home/jenkins/venv_testrail_reporter'
def testPlanDesc = env.LAB_CONFIG_NAME
def testrailURL = "https://mirantis.testrail.com"
def testrailProject = "Mirantis Cloud Platform"
- def testPlanName = "[MCP-Q2]System-${MCP_VERSION}-${new Date().format('yyyy-MM-dd')}"
+ if (!testPlanNamePrefix) {
+ testPlanNamePrefix = "[MCP-Q2]System"
+ }
+ def testPlanName = "${testPlanNamePrefix}-${MCP_VERSION}-${new Date().format('yyyy-MM-dd')}"
def testrailMilestone = "MCP1.1"
def testrailCaseMaxNameLenght = 250
def jobURL = env.BUILD_URL