Fix upgrade release reporting

-add prefix in test plan
-add steps for report
-add suite for tempest after upgrade
-set off reporting without success upgrade

Change-Id: Ia8b183470f454f005f26b7d2811b30eb8ae8d6e3
diff --git a/jobs/pipelines/run-test-scenarios.groovy b/jobs/pipelines/run-test-scenarios.groovy
index 76d5cb2..c03999b 100644
--- a/jobs/pipelines/run-test-scenarios.groovy
+++ b/jobs/pipelines/run-test-scenarios.groovy
@@ -25,6 +25,7 @@
 def steps = env.PASSED_STEPS
 def make_snapshot_stages = false
 env.LAB_CONFIG_NAME = env.LAB_CONFIG_NAME ?: env.ENV_NAME
+env.TEST_PLAN_NAME_PREFIX = '[2019.2.0-update]Upgraded'
 
 timeout(time: 23, unit: 'HOURS') {
     node ("${PARENT_NODE_NAME}") {
@@ -52,34 +53,40 @@
                 }
             } // stage("Run tests")
 
-            stage("Archive all xml reports") {
-                dir("${env.slave_workdir }") {
-                    archiveArtifacts artifacts: "**/*.xml,**/*.log"
+            if(currentBuild.result == 'SUCCESS'){
+                stage("Archive all xml reports") {
+                    dir("${env.slave_workdir }") {
+                        archiveArtifacts artifacts: "**/*.xml,**/*.log"
+                        }
+                }
+                stage("report results to testrail from jenkins master") {
+                    if ("${env.REPORT_TO_TESTRAIL}" != "false") {
+                        common.infoMsg("Running on: " + env.PARENT_NODE_NAME, "blue")
+                        shared.verbose_sh("""\
+                               [ -d /home/jenkins/venv_testrail_reporter ] || virtualenv --python=python3.7 /home/jenkins/venv_testrail_reporter""", true, false, true)
+                        shared.run_cmd("""\
+                                . /home/jenkins/venv_testrail_reporter/bin/activate; pip install git+https://github.com/dis-xcom/testrail_reporter -U""")
+                        shared.swarm_testrail_report(steps, env.PARENT_NODE_NAME)
+                    } else {
+                        common.infoMsg("REPORT_TO_TESTRAIL is set to FALSE. Skipped this step ")
                     }
+                } // stage("report results to testrail from jenkins master")
+                stage("Store TestRail reports to job description") {
+                    if ("${env.REPORT_TO_TESTRAIL}" != "false") {
+                        if (fileExists("description.txt")) {
+                            def String description  = readFile("description.txt")
+                            currentBuild.description += "${description}"
+                        }
+                    } else {
+                        common.infoMsg("REPORT_TO_TESTRAIL is set to FALSE. Skipped this step ")
+                        println(currentBuild.result)
+                    }
+                } // stage("Store TestRail reports to job description")
+            }//report if success
+            else{
+                common.infoMsg("Upgrade status different from successful. Skipped report steps.")
+                println("Current result is " + currentBuild.result)
             }
-
-            stage("report results to testrail from jenkins master") {
-                if ("${env.REPORT_TO_TESTRAIL}" != "false") {
-                    common.infoMsg("Running on: " + env.PARENT_NODE_NAME, "blue")
-                    shared.verbose_sh("""\
-                           [ -d /home/jenkins/venv_testrail_reporter ] || virtualenv --python=python3.7 /home/jenkins/venv_testrail_reporter""", true, false, true)
-                    shared.run_cmd("""\
-                            . /home/jenkins/venv_testrail_reporter/bin/activate; pip install git+https://github.com/dis-xcom/testrail_reporter -U""")
-                    shared.swarm_testrail_report(steps, env.PARENT_NODE_NAME)
-                } else {
-                    common.infoMsg("REPORT_TO_TESTRAIL is set to FALSE. Skipped this step ")
-                }
-            } // stage("report results to testrail from jenkins master")
-            stage("Store TestRail reports to job description") {
-                if ("${env.REPORT_TO_TESTRAIL}" != "false") {
-                    if (fileExists("description.txt")) {
-                        def String description  = readFile("description.txt")
-                        currentBuild.description += "${description}"
-                    }
-                } else {
-                    common.infoMsg("REPORT_TO_TESTRAIL is set to FALSE. Skipped this step ")
-                }
-            } // stage("Store TestRail reports to job description")
         } // dir
     } // node
 } // timeout
\ No newline at end of file