Leave stage blank for unscheduled tests in TestON Jenkins pipelines.

Change-Id: I60290a9225f26ab789652aea874b795421e0bd82
diff --git a/TestON/JenkinsFile/CommonJenkinsFile.groovy b/TestON/JenkinsFile/CommonJenkinsFile.groovy
index 6d98b7e..ac60785 100644
--- a/TestON/JenkinsFile/CommonJenkinsFile.groovy
+++ b/TestON/JenkinsFile/CommonJenkinsFile.groovy
@@ -62,6 +62,12 @@
     test_list.init()
     readParams()
 
+    if ( branch == "manually" ){
+        echo '''Warning: entered branch was: "manually". Defaulting to master branch.'''
+        branch = "master"
+        branchWithPrefix = test_list.addPrefixToBranch( branch )
+    }
+
     if ( category == "SCPF" ){
         isSCPF = true
         SCPFfuncs.init()
@@ -75,7 +81,7 @@
         prop = getProperties()
     }
 
-    // get the list of the test and init branch to it.
+    // get the list of the tests from category
     testsFromList = test_list.getTestsFromCategory( category )
 
     initGraphPaths()
@@ -131,10 +137,10 @@
 
 def runTests(){
     // run the test sequentially and save the function into the dictionary.
-    for ( String test : testsToRun.keySet() ){
-        toBeRun = test
+    for ( String test : testsFromList.keySet() ){
+        toBeRun = testsToRun.keySet().contains( test )
         stepName = ( toBeRun ? "" : "Not " ) + "Running $test"
-        pureTestName = ( testsToRun[ test ].containsKey( "test" ) ? testsToRun[ test ][ "test" ].split().head() : test )
+        pureTestName = ( testsFromList[ test ].containsKey( "test" ) ? testsFromList[ test ][ "test" ].split().head() : test )
         pipeline[ stepName ] = runTest( test,
                                         toBeRun,
                                         prop,
@@ -397,6 +403,8 @@
                                        isSCPF ? "" : testCategory[ testName ][ 'wikiName' ],
                                        isSCPF )
                     }
+                } else {
+                    echo testName + " is not being run today. Leaving the rest of stage contents blank."
                 }
             }
         }