Test reclass-system changes with cookiecutter
Remove useless variables at the end of cookiecutter test pipeline
Change-Id: I4225a9431c45f9be35b80d572b36b65363106ba5
diff --git a/test-cookiecutter-reclass.groovy b/test-cookiecutter-reclass.groovy
index 3a33846..c2a4d52 100644
--- a/test-cookiecutter-reclass.groovy
+++ b/test-cookiecutter-reclass.groovy
@@ -82,7 +82,15 @@
def templateContext = readYaml text: content
def clusterName = templateContext.default_context.cluster_name
def clusterDomain = templateContext.default_context.cluster_domain
- git.checkoutGitRepository("${testEnv}/classes/system", RECLASS_MODEL_URL, RECLASS_MODEL_BRANCH, CREDENTIALS_ID)
+ if (SYSTEM_GIT_URL != "") {
+ dir("${testEnv}/classes/system") {
+ gerrit.gerritPatchsetCheckout(SYSTEM_GIT_URL, SYSTEM_GIT_REF, "HEAD", CREDENTIALS_ID)
+ common.errorMsg("Failed to obtain system reclass with url: ${SYSTEM_GIT_URL} and ${SYSTEM_GIT_REF}")
+ }
+ } else {
+ git.checkoutGitRepository("${testEnv}/classes/system", RECLASS_MODEL_URL, RECLASS_MODEL_BRANCH, CREDENTIALS_ID)
+ }
+
saltModelTesting.setupAndTestNode("cfg01.${clusterDomain}", clusterName, EXTRA_FORMULAS, testEnv)
}
@@ -171,8 +179,5 @@
currentBuild.result = "FAILURE"
currentBuild.description = currentBuild.description ? e.message + " " + currentBuild.description : e.message
throw e
- } finally {
- def dummy = "dummy"
- //FAILING common.sendNotification(currentBuild.result,"",["slack"])
}
}
diff --git a/test-system-reclass-pipeline.groovy b/test-system-reclass-pipeline.groovy
index 03bd9fe..dbe9342 100644
--- a/test-system-reclass-pipeline.groovy
+++ b/test-system-reclass-pipeline.groovy
@@ -60,6 +60,15 @@
def branches = [:]
def testModels = documentationOnly ? [] : TEST_MODELS.split(',')
+
+ if (!documentationOnly) {
+ branches["cookiecutter"] = {
+ build job: "test-mk-cookiecutter-templates", parameters: [
+ [$class: 'StringParameterValue', name: 'SYSTEM_GIT_URL', value: defaultGitUrl],
+ [$class: 'StringParameterValue', name: 'SYSTEM_GIT_REF', value: systemRefspec]
+ ]
+ }
+ }
for (int i = 0; i < testModels.size(); i++) {
def cluster = testModels[i]
def clusterGitUrl = defaultGitUrl.substring(0, defaultGitUrl.lastIndexOf("/") + 1) + cluster