blob: df437b354d089cc347e03548ec80a35f38339965 [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
40 stage("Deployment report") {
41 report_name = "deployment_${ENV_NAME}.xml"
42 testSuiteName = "[MCP] Integration automation"
43 methodname = '{methodname}'
44 testrail_name_template = '{title}'
45 reporter_extra_options = [
46 "--testrail-add-missing-cases",
47 "--testrail-case-custom-fields {\\\"custom_qa_team\\\":\\\"9\\\"}",
48 "--testrail-case-section-name \'All\'",
49 ]
50 shared.upload_results_to_testrail(report_name, testSuiteName, methodname, testrail_name_template, reporter_extra_options)
51 }
52
53 stage("tcp-qa cases report") {
54 report_name = "nosetests.xml"
55 testSuiteName = "[MCP_X] integration cases"
56 methodname = "{methodname}"
57 testrail_name_template = "{title}"
58 shared.upload_results_to_testrail(report_name, testSuiteName, methodname, testrail_name_template)
59 }
60
61 if ('openstack' in stacks) {
62 stage("Tempest report") {
63 report_name = "report_*.xml"
64 testSuiteName = "[MCP1.1_PIKE]Tempest"
65 methodname = "{classname}.{methodname}"
66 testrail_name_template = "{title}"
67 shared.upload_results_to_testrail(report_name, testSuiteName, methodname, testrail_name_template)
68 }
69 }
70
71 if ('k8s' in stacks) {
72 stage("Tempest report") {
73 println "TBD"
74 // K8s conformance report
75 }
76 }
77
78 if ('stacklight' in stacks) {
79 stage("stacklight-pytest report") {
80 report_name = "report.xml"
81 testSuiteName = "LMA2.0_Automated"
82 methodname = "{methodname}"
83 testrail_name_template = "{title}"
84 shared.upload_results_to_testrail(report_name, testSuiteName, methodname, testrail_name_template)
85 }
86 }
87
88 } catch (e) {
89 common.printMsg("Job is failed: " + e.message, "red")
90 throw e
91 } finally {
92 // reporting is failed for some reason
93 }
94 }
95}