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/deploy-cicd-and-run-tests.groovy b/jobs/pipelines/deploy-cicd-and-run-tests.groovy
index ce9f83f..1872451 100644
--- a/jobs/pipelines/deploy-cicd-and-run-tests.groovy
+++ b/jobs/pipelines/deploy-cicd-and-run-tests.groovy
@@ -211,13 +211,15 @@
}
}
//run upgrade env to proposed
- if (env.RUN_UPGRADE_AFTER_JOB == "true") {
+ if (env.RUN_UPGRADE_AFTER_JOB == "true" && currentBuild.result == 'SUCCESS') {
network_backend = env.PLATFORM_STACK_INSTALL.contains("contrail") ? 'contrail' : 'dvr'
upgrade_job = "mcp-update-${env.TEMPEST_IMAGE_VERSION}-${network_backend}-sl"
def deploy = build job: "${upgrade_job}",
parameters: [
string(name: 'PARENT_NODE_NAME', value: "openstack_slave_${env.LAB_CONFIG_NAME}"),
string(name: 'TCP_QA_REFS', value: env.TCP_QA_REFS),
+ string(name: 'PASSED_STEPS', value: steps),
+ string(name: 'TEMPEST_TEST_SUITE_NAME', value: env.TEMPEST_TEST_SUITE_NAME),
string(name: 'TEMPEST_PATTERN', value: env.TEMPEST_PATTERN),
string(name: 'NODE', value: "openstack_slave_${env.LAB_CONFIG_NAME}")
],
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
diff --git a/jobs/templates/test-scenarios.yml b/jobs/templates/test-scenarios.yml
index 70a384a..404848d 100644
--- a/jobs/templates/test-scenarios.yml
+++ b/jobs/templates/test-scenarios.yml
@@ -151,24 +151,28 @@
run-test-opts: '{test-opt}'
tempest_pattern: 'tempest'
display-name: MCP update (pike)
+ tempest_test_suite: "[MCP1.1_PIKE]Tempest"
- mcp-update-queens-dvr-sl:
deployment: released-heat-cicd-queens-dvr-sl
tempest_pattern: 'tempest'
run-test-opts: '{test-opt}'
display-name: MCP update (queens)
+ tempest_test_suite: "[MCP1.1_QUEENS]Tempest"
- mcp-update-pike-contrail-sl:
deployment: released-heat-cicd-pike-contrail41-sl
tempest_pattern: '{test-pattern-with-contrail}'
run-test-opts: '{test-opt-with-contrail}'
display-name: MCP update (pike + OC)
+ tempest_test_suite: "[MCP1.1_PIKE]Tempest"
- mcp-update-queens-contrail-sl:
deployment: released-heat-cicd-queens-contrail41-sl
tempest_pattern: '{test-pattern-with-contrail}'
run-test-opts: '{test-opt-with-contrail}'
display-name: MCP update (queens + OC)
+ tempest_test_suite: "[MCP1.1_QUEENS]Tempest"
- os-update-pike-to-queens:
deployment: heat-cicd-pike-dvr-sl
@@ -258,6 +262,12 @@
name: PASSED_STEPS
trim: 'false'
- string:
+ default: '{tempest_test_suite|}'
+ description: '[MCP1.1_xxx]Tempest where xxx - MCP version
+ using only for report to testrail'
+ name: TEMPEST_TEST_SUITE_NAME
+ trim: 'false'
+ - string:
default: ''
description: 'Example: refs/changes/89/411189/36
(for now - only one reference allowed)'