Pass GERRIT_BRANCH parameter from gating job to salt-formulas test job

Related: PROD-29251

Change-Id: Ie14c9a80349e14733930135f10074c2eab75fd55
diff --git a/gating-pipeline.groovy b/gating-pipeline.groovy
index b40bfec..e7887f9 100644
--- a/gating-pipeline.groovy
+++ b/gating-pipeline.groovy
@@ -70,10 +70,18 @@
                                 if (isJobExists(testJob)) {
                                     common.infoMsg("Test job ${testJob} found, running")
                                     def patchsetVerified = gerrit.patchsetHasApproval(gerritChange.currentPatchSet, "Verified", "+")
-                                    build job: testJob, parameters: [
-                                        [$class: 'StringParameterValue', name: 'DEFAULT_GIT_URL', value: "${GERRIT_SCHEME}://${GERRIT_NAME}@${GERRIT_HOST}:${GERRIT_PORT}/${GERRIT_PROJECT}"],
-                                        [$class: 'StringParameterValue', name: 'DEFAULT_GIT_REF', value: GERRIT_REFSPEC]
-                                    ]
+                                    if (JOBS_NAMESPACE.equals("salt-formulas")) {
+                                        build job: testJob, parameters: [
+                                            [$class: 'StringParameterValue', name: 'DEFAULT_GIT_URL', value: "${GERRIT_SCHEME}://${GERRIT_NAME}@${GERRIT_HOST}:${GERRIT_PORT}/${GERRIT_PROJECT}"],
+                                            [$class: 'StringParameterValue', name: 'DEFAULT_GIT_REF', value: GERRIT_REFSPEC],
+                                            [$class: 'StringParameterValue', name: 'GATING_GERRIT_BRANCH', value: GERRIT_BRANCH]
+                                        ]
+                                    } else {
+                                        build job: testJob, parameters: [
+                                            [$class: 'StringParameterValue', name: 'DEFAULT_GIT_URL', value: "${GERRIT_SCHEME}://${GERRIT_NAME}@${GERRIT_HOST}:${GERRIT_PORT}/${GERRIT_PROJECT}"],
+                                            [$class: 'StringParameterValue', name: 'DEFAULT_GIT_REF', value: GERRIT_REFSPEC]
+                                        ]
+                                    }
                                     giveVerify = true
                                 } else {
                                     common.infoMsg("Test job ${testJob} not found")
diff --git a/test-salt-formulas-pipeline.groovy b/test-salt-formulas-pipeline.groovy
index f21ab29..640cfed 100644
--- a/test-salt-formulas-pipeline.groovy
+++ b/test-salt-formulas-pipeline.groovy
@@ -20,7 +20,9 @@
 gerritBranch = 'master'
 if (common.validInputParam('GERRIT_BRANCH')) {
   gerritBranch = env.GERRIT_BRANCH
-}
+} else if (common.validInputParam('GATING_GERRIT_BRANCH')) {
+    gerritBranch = env.GATING_GERRIT_BRANCH
+  }
 
 
 def checkouted = false