Refine logic to filter out configs do not need LAVA tests

Make the if-else logic on submitting LAVA jobs more readable.

Signed-off-by: Xinyu Zhang <xinyu.zhang@arm.com>
Change-Id: I1589a8d4a07cca5c925bb76d72fe0369a11aa722
diff --git a/jenkins/ci.jpl b/jenkins/ci.jpl
index 02f0f92..d79bbae 100644
--- a/jenkins/ci.jpl
+++ b/jenkins/ci.jpl
@@ -171,12 +171,20 @@
     def build_url = build_res.getAbsoluteUrl()
     print("${build_res.number}: ${config} ${build_res.result} ${build_url}")
     failure_states = ["FAILURE", "ABORTED", "UNSTABLE", "NOT_BUILT"]
+
+    // Filter out configs do not need LAVA tests
+
+    // Configs with build failure do not need LAVA tests
     if (build_res.result in failure_states) {
       error("Build failed at ${build_url}")
     }
-    else if (params_collection["NS"] == "False" || \
-             (params_collection["TFM_PLATFORM"].contains("musca_b1") && \
-             env.JOB_NAME.equals("tf-m-build-and-test"))) {
+    // Configs without building NS app do not need LAVA tests
+    else if (params_collection["NS"] == "False") {
+      print("LAVA is not needed for ${build_url}")
+    }
+    // LAVA tests on MUSCA_B1 are not needed in per-patch job
+    else if (params_collection["TFM_PLATFORM"].contains("musca_b1") && \
+             env.JOB_NAME.equals("tf-m-build-and-test")) {
       print("LAVA is not needed for ${build_url}")
     }
     // Only submit LAVA test for a specified OTP enabled config in nightly or release job
@@ -188,6 +196,8 @@
              !(env.JOB_NAME.equals("tf-m-nightly") || env.JOB_NAME.equals("tf-m-release"))) {
       print("LAVA is not needed for ${build_url}")
     }
+
+    // Submit LAVA tests
     else {
       print("Doing LAVA stuff for ${build_url}")
       params += generateLavaParam(params_collection)