Added output to stop old tests in formulas testing pipeline
Change-Id: I5394fabd89a32f2598c6ebe209bbef017bd98258
diff --git a/test-salt-formulas-pipeline.groovy b/test-salt-formulas-pipeline.groovy
index 0e860a6..a3d9673 100644
--- a/test-salt-formulas-pipeline.groovy
+++ b/test-salt-formulas-pipeline.groovy
@@ -33,6 +33,7 @@
if (gerritRef) {
def runningTestBuildNums = _getRunningTriggeredTestsBuildNumbers(env["JOB_NAME"], GERRIT_CHANGE_NUMBER, GERRIT_PATCHET_NUMBER)
for(int i=0; i<runningTestBuildNums.size(); i++){
+ common.infoMsg("Old test with run number ${runningTestBuildNums[i]} found, stopping")
Jenkins.instance.getItemByFullName(env["JOB_NAME"]).getBuildByNumber(runningTestBuildNums[i]).finish(hudson.model.Result.ABORTED, new java.io.IOException("Aborting build"));
}
}
@@ -85,6 +86,6 @@
@NonCPS
def _getRunningTriggeredTestsBuildNumbers(jobName, gerritChangeNumber, excludePatchsetNumber){
- return gerrit.getGerritTriggeredBuilds(jenkins.getJobRunningBuilds(jobName), gerritChangeNumber, excludePatchsetNumber)
+ return gerrit.getGerritTriggeredBuilds(jenkinsUtils.getJobRunningBuilds(jobName), gerritChangeNumber, excludePatchsetNumber)
.stream().map{it -> it.number}.collect(java.util.stream.Collectors.toList())
}
\ No newline at end of file