VOL-5155 - triage failure in periodic-voltha-test-bbsim-2.12

jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
--------------------------------------------------
  o Added a missing script block, String iam= was in limbo.

makefiles/lint/groovy/include.mk
-----------------------------------------------------
  o Add lint BYSRC= so npm-groovy-lint can be run on individual files.

Change-Id: I33269893780c7cb116d87dae5f8ac6cbc01ff3e6
diff --git a/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy b/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
index f273eb5..e8c2181 100644
--- a/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
+++ b/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
@@ -412,7 +412,10 @@
 // -----------------------------------------------------------------------
 // -----------------------------------------------------------------------
 def collectArtifacts(exitStatus) {
-    String iam = getIam('collectArtifacts')
+    script {
+	String iam = getIam('collectArtifacts')
+	println("${iam}: ENTER (exitStatus=${exitStatus})")
+    }
 
     echo '''
 
@@ -420,7 +423,6 @@
 ** collectArtifacts
 ** -----------------------------------------------------------------------
 '''
-    println("${iam}: ENTER (exitStatus=${exitStatus})")
 
     getPodsInfo("$WORKSPACE/${exitStatus}")
 
@@ -570,8 +572,6 @@
     // -----------------------------------------------------------------------
     // -----------------------------------------------------------------------
     stage('Replace voltctl') {
-        String iam = getIam('Replace voltctl')
-	    
         // if the project is voltctl, override the downloaded one with the built one
         when {
             expression { return gerritProject == 'voltctl' }
@@ -580,11 +580,15 @@
         // Hmmmm(?) where did the voltctl download happen ?
         // Likely Makefile but would be helpful to document here.
         steps {
-            println("${iam} Running: installVoltctl($branch)")
-	    println("${iam}: ENTER")
-            installVoltctl("$branch")
-	    println("${iam}: LEAVE")
-        } // steps
+		script {
+		    String iam = getIam('Replace voltctl')
+
+		    println("${iam} Running: installVoltctl($branch)")
+		    println("${iam}: ENTER")
+		    installVoltctl("$branch")
+		    println("${iam}: LEAVE")
+		} // script
+	    } // steps
     } // stage
 
     // -----------------------------------------------------------------------
diff --git a/makefiles/lint/groovy/include.mk b/makefiles/lint/groovy/include.mk
index 6baf70c..1d39bcb 100644
--- a/makefiles/lint/groovy/include.mk
+++ b/makefiles/lint/groovy/include.mk
@@ -34,15 +34,33 @@
 endif
 
 ## -----------------------------------------------------------------------
+## All or on-demand
+##   make lint-groovy BYSRC="a/b/c.groovy d/e/f.groovy"
+## -----------------------------------------------------------------------
+ifdef BYSRC
+  lint-groovy : lint-groovy-bysrc
+else
+  lint-groovy : lint-groovy-all
+endif
+
+## -----------------------------------------------------------------------
 ## Intent: Perform a lint check on command line script sources
 ## -----------------------------------------------------------------------
-lint-groovy:
+lint-groovy-all:
 	$(groovy-check) --version
 	@echo
 	$(HIDE)$(env-clean) find . -iname '*.groovy' -print0 \
   | $(xargs-n1) $(groovy-check) $(groovy-check-args)
 
 ## -----------------------------------------------------------------------
+## Intent: Perform lint check on a named list of files
+## -----------------------------------------------------------------------
+lint-groovy-bysrc:
+	$(groovy-check) --version
+	@echo
+	$(foreach fyl,$(BYSRC),$(groovy-check) $(groovy-check-args) $(fyl))
+
+## -----------------------------------------------------------------------
 ## Intent: Display command help
 ## -----------------------------------------------------------------------
 help-summary ::