diff mbox series

[isar-cip-core,4/4] ci: submit_lava: Reduce validate_jobs to handle only a single one

Message ID 306d108ad904f0c8c4afa31fa0f34fa80a51e3a8.1719642474.git.jan.kiszka@siemens.com (mailing list archive)
State Superseded
Headers show
Series ci: add LAVA live output, fix and clean up submission script | expand

Commit Message

Jan Kiszka June 29, 2024, 6:27 a.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

We switched to one job per invocation already in 6bc117569001.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 scripts/submit_lava.sh | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)
diff mbox series

Patch

diff --git a/scripts/submit_lava.sh b/scripts/submit_lava.sh
index 6bf844bf..092819cd 100755
--- a/scripts/submit_lava.sh
+++ b/scripts/submit_lava.sh
@@ -196,25 +196,20 @@  is_device_online () {
 	return 1
 }
 
-# This method is added with the intention to check if all the jobs are valid before submit
-# If even a single definition is found to be invalid, then no job shall be submitted until
-# it is fixed by the maintainer
-validate_jobs () {
-	local ret=0
-	for JOB in "${job_dir}"/*.yml; do
-		# shellcheck disable=2086
-		if lavacli $LAVACLI_ARGS jobs validate "$JOB"; then
-			echo "$JOB is a valid definition"
-			if ! submit_job $JOB; then
-				clean_up
-				exit 1
-			fi
-		else
-			echo "$JOB is not a valid definition"
-			ret=1
+# This method checks if the job is valid before submitting it later on.
+validate_job () {
+	# shellcheck disable=2086
+	if lavacli $LAVACLI_ARGS jobs validate "${job_dir}"/*.yml; then
+		echo "$JOB is a valid definition"
+		if ! submit_job $JOB; then
+			clean_up
+			exit 1
 		fi
-	done
-	return $ret
+	else
+		echo "$JOB is not a valid definition"
+		return 1
+	fi
+	return 0
 }
 
 get_first_xml_attr_value() {
@@ -237,6 +232,7 @@  get_junit_test_results () {
 }
 
 set_up
+
 create_job "$TEST" "$TARGET"
 
 if ! validate_jobs; then