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

jjb/voltha-e2e/voltha-2.12.yaml
-------------------------------
  o More debugging

Change-Id: Ic5c8b8601e971229ab642c72e043346fc33781b4
diff --git a/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy b/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
index b411109..351a22f 100644
--- a/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
+++ b/jjb/pipeline/voltha/voltha-2.12/bbsim-tests.groovy
@@ -39,14 +39,24 @@
 }
 
 // -----------------------------------------------------------------------
+// Intent: Difficult at times to determine when pipeline jobs have
+//   regenerated.  Hardcode a version string that can be assigned
+//   per-script to be sure latest repository changes are being used.
+// -----------------------------------------------------------------------
+String pipelineVer() {
+    String version = '4f87de8f31d588d8277dc5ea6fbb69e714c66079'
+    return(version)
+}
+
+// -----------------------------------------------------------------------
 // Intent: Due to lack of a reliable stack trace, construct a literal.
 //         Jenkins will re-write the call stack for serialization.S
 // -----------------------------------------------------------------------
 // Note: Hardcoded version string used to visualize changes in jenkins UI
 // -----------------------------------------------------------------------
-tring getIam(String func, Boolean verbose=True) {
+String getIam(String func) {
     String branchName = branchName()
-    String version = '4f87de8f31d588d8277dc5ea6fbb69e714c66079'
+    String version    = pipelineVer()
     String src = [
         'ci-management',
         'jjb',
@@ -61,6 +71,28 @@
 }
 
 // -----------------------------------------------------------------------
+// Intent: Log progress message
+// -----------------------------------------------------------------------
+void enter(String name)
+{
+    // Announce ourselves for log usability
+    String iam = getIam(name)
+    println("${iam}: ENTER")
+    return
+}
+
+// -----------------------------------------------------------------------
+// Intent: Log progress message
+// -----------------------------------------------------------------------
+void leave(String name)
+{
+    // Announce ourselves for log usability
+    String iam = getIam(name)
+    println("${iam}: LEAVE")
+    return
+}
+
+// -----------------------------------------------------------------------
 // Intent: Determine if working on a release branch.
 //   Note: Conditional is legacy, should also check for *-dev or *-pre
 // -----------------------------------------------------------------------
@@ -71,24 +103,20 @@
 }
 
 // -----------------------------------------------------------------------
-// Intent:
+// Intent: Iterate over a list of test suites and invoke.
 // -----------------------------------------------------------------------
-void execute_test(testTarget, workflow, testLogging, teardown, testSpecificHelmFlags='') {
+void execute_test\
+(
+    String  testTarget,                       // functional-single-kind-dt
+    String  workflow,                         // dt
+    String  testLogging,                      // 'True'
+    Boolean teardown,                         // true
+    String  testSpecificHelmFlags=''
+) {
     String infraNamespace  = 'default'
     String volthaNamespace = 'voltha'
     String logsDir = "$WORKSPACE/${testTarget}"
 
-    stage('IAM')
-    {
-        script
-        {
-            // Announce ourselves for log usability
-            String iam = getIam('execute_test')
-            println("${iam}: ENTER")
-            println("${iam}: LEAVE")
-        }
-    }
-
     // -----------------------------------------------------------------------
     // Intent: Cleanup stale port-forwarding
     // -----------------------------------------------------------------------
@@ -577,8 +605,7 @@
         steps {
 	    script {
 		// Announce ourselves for log usability
-		String iam = getIam('execute_test')
-		println("${iam}: ENTER")
+		enter('Parse and execute tests')
 
                 def tests = readYaml text: testTargets
                 println("** [DEBUG]: tests=$tests")
@@ -620,21 +647,21 @@
 ** -----------------------------------------------------------------------
 """)
 
-		    try {
-			println "Executing test ${target}: ENTER"
-			execute_test(target, workflow, testLogging, teardown, flags)
-		    }
-		    catch (Exception err) {
-			println("** ${iam}: EXCEPTION ${err}")
-		    }
-		    finally {
-			println "Executing test ${target}: LEAVE"
-		    }
+                   try {
+                       leave("execute_test (target=$target)")
+                       execute_test(target, workflow, testLogging, teardown, flags)
+                   }
+                   catch (Exception err) {
+                       println("** ${iam}: EXCEPTION ${err}")
+                   }
+                   finally {
+                       leave("execute_test (target=$target)")
+                   }
 
 		    } // for
 
 		    // Premature exit if this message is not logged
-                    println("${iam}: LEAVE (testing ran to completion)")
+ 		    leave('Parse and execute tests')
                 } // script
             } // steps
 	} // stage