Merge "First version of pipeline for testing sphinx docs"
diff --git a/cloud-deploy-pipeline.groovy b/cloud-deploy-pipeline.groovy
index 989d130..fa30579 100644
--- a/cloud-deploy-pipeline.groovy
+++ b/cloud-deploy-pipeline.groovy
@@ -50,6 +50,13 @@
* TEST_TEMPEST_IMAGE Tempest image link
* TEST_TEMPEST_PATTERN If not false, run tests matched to pattern only
* TEST_TEMPEST_TARGET Salt target for tempest node
+ * TESTRAIL_REPORT Whether upload results to testrail or not
+ * TESTRAIL_REPORTER_IMAGE Docker image for testrail reporter
+ * TESTRAIL_QA_CREDENTIALS Credentials for upload to testrail
+ * TESTRAIL_MILESTONE Product version for tests
+ * TESTRAIL_PLAN Testrail test plan
+ * TESTRAIL_GROUP Testrail test group
+ * TESTRAIL_SUITE Testrail test suite
*
* optional parameters for overwriting soft params
* SALT_OVERRIDES YAML with overrides for Salt deployment
@@ -500,6 +507,19 @@
stage('Archive rally artifacts') {
test.archiveRallyArtifacts(venvPepper, TEST_TEMPEST_TARGET)
}
+
+ if (common.validInputParam('TESTRAIL_REPORT') && TESTRAIL_REPORT.toBoolean()) {
+ stage('Upload test results to TestRail') {
+ def date = sh(script: 'date +%Y-%m-%d', returnStdout: true).trim()
+ def plan = TESTRAIL_PLAN ?: "[${TESTRAIL_MILESTONE}]System-Devcloud-${date}"
+ def group = TESTRAIL_GROUP ?: STACK_TEMPLATE
+
+ salt.cmdRun(venvPepper, TEST_TEMPEST_TARGET, "cd /root/rally_reports && cp \$(ls -t *xml | head -n1) report.xml")
+ test.uploadResultsTestrail("/root/rally_reports/report.xml",
+ TESTRAIL_REPORTER_IMAGE, group, TESTRAIL_QA_CREDENTIALS,
+ plan, TESTRAIL_MILESTONE, TESTRAIL_SUITE)
+ }
+ }
}
diff --git a/test-salt-formulas-pipeline.groovy b/test-salt-formulas-pipeline.groovy
index af22dc8..56e9bb9 100644
--- a/test-salt-formulas-pipeline.groovy
+++ b/test-salt-formulas-pipeline.groovy
@@ -43,8 +43,13 @@
try {
triggerTestFormulaJob(currentFormula, defaultGitRef, defaultGitUrl)
} catch (Exception e) {
- failedFormulas << currentFormula
- common.warningMsg("Test of ${currentFormula} failed : ${e}")
+ if (e.getMessage().contains("completed with status ABORTED")) {
+ common.warningMsg("Test of ${currentFormula} was aborted and will be retriggered")
+ futureFormulas << currentFormula
+ } else {
+ failedFormulas << currentFormula
+ common.warningMsg("Test of ${currentFormula} failed : ${e}")
+ }
}
}
}