blob: 7d2ce538eb636cfb3481b3310519c6881308f7df [file] [log] [blame]
Dennis Dmitrieve4b831b2018-08-15 17:16:10 +03001/**
2 *
3 * Deploy the product cluster using Jenkins master on CICD cluster
4 *
5 * Expected parameters:
6
7 * ENV_NAME Fuel-devops environment name
8 * MCP_VERSION MCP version, like 2018.4 or proposed
9 * PASSED_STEPS Steps passed to install components using Jenkins on CICD cluster: "salt,core,cicd,openstack:3200,stacklight:2400",
10 where 3200 and 2400 might be timeouts (not used in the testing pipeline)
11 * PARENT_NODE_NAME Name of the jenkins slave to create the environment
12 * PARENT_WORKSPACE Path to the workspace of the parent job to use tcp-qa repo
13 * TCP_QA_REFS Reference to the tcp-qa change on review.gerrithub.io, like refs/changes/46/418546/41
14 */
15
16@Library('tcp-qa')_
17
18def common = new com.mirantis.mk.Common()
19def shared = new com.mirantis.system_qa.SharedPipeline()
20def stacks = shared.get_steps_list(PASSED_STEPS)
21
22if (! env.PARENT_NODE_NAME) {
23 error "'PARENT_NODE_NAME' must be set from the parent deployment job!"
24}
25
26currentBuild.description = "${PARENT_NODE_NAME}:${ENV_NAME}"
27
28node ("${PARENT_NODE_NAME}") {
29 if (! fileExists("${PARENT_WORKSPACE}")) {
30 error "'PARENT_WORKSPACE' contains path to non-existing directory ${PARENT_WORKSPACE} on the node '${PARENT_NODE_NAME}'."
31 }
32 dir("${PARENT_WORKSPACE}") {
33 try {
34 def report_name = ''
35 def testSuiteName = ''
36 def methodname = ''
37 def testrail_name_template = ''
38 def reporter_extra_options = []
39
Dennis Dmitriev39666082018-08-29 15:30:45 +030040 //stage("Archive all xml reports") {
41 // archiveArtifacts artifacts: "${PARENT_WORKSPACE}/*.xml"
42 //}
43
Dennis Dmitrieve4b831b2018-08-15 17:16:10 +030044 stage("Deployment report") {
45 report_name = "deployment_${ENV_NAME}.xml"
46 testSuiteName = "[MCP] Integration automation"
47 methodname = '{methodname}'
48 testrail_name_template = '{title}'
49 reporter_extra_options = [
50 "--testrail-add-missing-cases",
51 "--testrail-case-custom-fields {\\\"custom_qa_team\\\":\\\"9\\\"}",
52 "--testrail-case-section-name \'All\'",
53 ]
54 shared.upload_results_to_testrail(report_name, testSuiteName, methodname, testrail_name_template, reporter_extra_options)
55 }
56
57 stage("tcp-qa cases report") {
58 report_name = "nosetests.xml"
59 testSuiteName = "[MCP_X] integration cases"
60 methodname = "{methodname}"
61 testrail_name_template = "{title}"
62 shared.upload_results_to_testrail(report_name, testSuiteName, methodname, testrail_name_template)
63 }
64
65 if ('openstack' in stacks) {
66 stage("Tempest report") {
67 report_name = "report_*.xml"
68 testSuiteName = "[MCP1.1_PIKE]Tempest"
69 methodname = "{classname}.{methodname}"
70 testrail_name_template = "{title}"
71 shared.upload_results_to_testrail(report_name, testSuiteName, methodname, testrail_name_template)
72 }
73 }
74
75 if ('k8s' in stacks) {
76 stage("Tempest report") {
77 println "TBD"
78 // K8s conformance report
79 }
80 }
81
82 if ('stacklight' in stacks) {
83 stage("stacklight-pytest report") {
84 report_name = "report.xml"
85 testSuiteName = "LMA2.0_Automated"
86 methodname = "{methodname}"
87 testrail_name_template = "{title}"
88 shared.upload_results_to_testrail(report_name, testSuiteName, methodname, testrail_name_template)
89 }
90 }
91
92 } catch (e) {
93 common.printMsg("Job is failed: " + e.message, "red")
94 throw e
95 } finally {
96 // reporting is failed for some reason
97 }
98 }
99}