Added gerrit change Verification validation
Change-Id: I731826f0723a682395fb65231e87315e2954f6c0
diff --git a/test-salt-formulas-pipeline.groovy b/test-salt-formulas-pipeline.groovy
index bfa38e6..159efe2 100644
--- a/test-salt-formulas-pipeline.groovy
+++ b/test-salt-formulas-pipeline.groovy
@@ -41,9 +41,12 @@
stage("checkout") {
if (gerritRef) {
// job is triggered by Gerrit
- def gerritChange = gerrit.getGerritChange(GERRIT_NAME, GERRIT_HOST, GERRIT_CHANGE_NUMBER, CREDENTIALS_ID)
+ def gerritChange = gerrit.getGerritChange(GERRIT_NAME, GERRIT_HOST, GERRIT_CHANGE_NUMBER, CREDENTIALS_ID, true)
+ // test if gerrit change is already Verified
+ if(gerrit.patchsetHasApproval(gerritChange.currentPatchSet,"Verified")){
+ common.successMsg("Gerrit change ${GERRIT_CHANGE_NUMBER} patchset ${GERRIT_PATCHSET_NUMBER} already has Verified, skipping tests") // do nothing
// test WIP contains in commit message
- if(gerritChange.commitMessage.contains("WIP")){
+ }else if(gerritChange.commitMessage.contains("WIP")){
common.successMsg("Commit message contains WIP, skipping tests") // do nothing
}else{
// test if change aren't already merged
@@ -141,3 +144,4 @@
}
return buildNums
}
+