add parameter to self-deploy job to only test patched JJB

Related-Prod: PROD-36994

Change-Id: Ib8d51386f0cbacdcb0e5936735ee541c005d4ab6
diff --git a/jobs/pipelines/self-deploy-jobs.groovy b/jobs/pipelines/self-deploy-jobs.groovy
index 7707a8e..57f1c9e 100644
--- a/jobs/pipelines/self-deploy-jobs.groovy
+++ b/jobs/pipelines/self-deploy-jobs.groovy
@@ -27,11 +27,17 @@
                 }
             }
             stage('Deploy jobs'){
+            sh """
+            cd jobs
+            ../.venv/bin/jenkins-jobs --conf ${tmp_jenkins_config} test ./
+            """
+            if ("${env.DRY_RUN}" != "true") {
                 sh """
                 cd jobs
                 ../.venv/bin/jenkins-jobs --conf ${tmp_jenkins_config} update ./
-                rm ${tmp_jenkins_config}
                 """
+                }
+            sh """rm ${tmp_jenkins_config}"""
             }
         }
     }
diff --git a/jobs/templates/self-deploy-jobs.yaml b/jobs/templates/self-deploy-jobs.yaml
index cfe3b99..64f1ec4 100644
--- a/jobs/templates/self-deploy-jobs.yaml
+++ b/jobs/templates/self-deploy-jobs.yaml
@@ -11,6 +11,10 @@
         description: 'tcp-qa review refspec'
         name: TCP_QA_REFS
         trim: 'true'
+    - bool:
+        name: DRY_RUN
+        description: 'check tcp-qa ref without apply'
+        default: 'false'
     pipeline-scm:
       lightweight-checkout: false
       scm: