diff mbox series

[isar-cip-core] submit_lava.sh: Modify environment slug in SQUAD

Message ID 20240802062317.3333603-1-Sai.Sathujoda@toshiba-tsip.com (mailing list archive)
State Accepted
Headers show
Series [isar-cip-core] submit_lava.sh: Modify environment slug in SQUAD | expand

Commit Message

Sai.Sathujoda@toshiba-tsip.com Aug. 2, 2024, 6:23 a.m. UTC
From: sai ashrith sathujoda <sai.sathujoda@toshiba-tsip.com>

This commit modifies environment slug for test results hosted in SQUAD.
Currently the slug includes device name which keeps varying as that depends
on assigned device in LAVA Lab. Ex: "qemu-cip-siemens-muc", "qemu-renesas-01"
etc.

Environment slug should denote the test suite as well as the target on which
tests are executed. So it needs target information as part of it instead of
device allocated. This also helps in fetching the results from SQUAD using
squad-client while generating test reports.

Signed-off-by: sai ashrith sathujoda <sai.sathujoda@toshiba-tsip.com>
---
 scripts/submit_lava.sh | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Comments

Jan Kiszka Aug. 2, 2024, 11:02 a.m. UTC | #1
On 02.08.24 08:23, Sai.Sathujoda@toshiba-tsip.com wrote:
> From: sai ashrith sathujoda <sai.sathujoda@toshiba-tsip.com>
>
> This commit modifies environment slug for test results hosted in SQUAD.
> Currently the slug includes device name which keeps varying as that depends
> on assigned device in LAVA Lab. Ex: "qemu-cip-siemens-muc", "qemu-renesas-01"
> etc.
>
> Environment slug should denote the test suite as well as the target on which
> tests are executed. So it needs target information as part of it instead of
> device allocated. This also helps in fetching the results from SQUAD using
> squad-client while generating test reports.
>
> Signed-off-by: sai ashrith sathujoda <sai.sathujoda@toshiba-tsip.com>
> ---
>  scripts/submit_lava.sh | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/scripts/submit_lava.sh b/scripts/submit_lava.sh
> index b9015f3..1f55c3b 100755
> --- a/scripts/submit_lava.sh
> +++ b/scripts/submit_lava.sh
> @@ -104,19 +104,18 @@ submit_squad_watch_job(){
>  	fi
>
>  	if [ "$TEST" = "swupdate" ] || [ "$TEST" = "kernel-panic" ] || [ "$TEST" = "initramfs-crash" ]; then
> -		squad_project="swupdate-testing"
> +		SQUAD_PROJECT="swupdate-testing"
>  	elif [ "$TEST" = "secure-boot" ]; then
> -		squad_project="secure-boot-testing"
> +		SQUAD_PROJECT="secure-boot-testing"
>  	elif [ "$TEST" = "IEC" ]; then
> -		squad_project="iec-layer-testing"
> +		SQUAD_PROJECT="iec-layer-testing"
>  	else
>  		echo "Unable to host results in available CIP Core SQUAD projects"
>  		return 1
>  	fi
>
> -	local DEVICE=$2
> -	local ENV="${DEVICE}_${squad_project}"
> -	local squad_url="$SQUAD_WATCH_JOBS_URL/${SQUAD_GROUP}/${squad_project}/${COMMIT_REF}/${ENV}"
> +	local ENV="${SQUAD_PROJECT}_${TARGET}"
> +	local squad_url="$SQUAD_WATCH_JOBS_URL/${SQUAD_GROUP}/${SQUAD_PROJECT}/${COMMIT_REF}/${ENV}"
>  	ret=$(curl -s \
>  		--header "Authorization: token $CIP_SQUAD_LAB_TOKEN" \
>  		--form backend="$SQUAD_LAVA_BACKEND" \
> @@ -165,7 +164,7 @@ submit_job() {
>  				| cut -d ":" -f 2 \
>  				| awk '{$1=$1};1')
>
> -			submit_squad_watch_job "${ret}" "${DEVICE}"
> +			submit_squad_watch_job "${ret}"
>
>  			lavacli $LAVACLI_ARGS jobs logs "${ret}"
>  			lavacli $LAVACLI_ARGS results "${ret}"

Thanks, applied.

Jan
diff mbox series

Patch

diff --git a/scripts/submit_lava.sh b/scripts/submit_lava.sh
index b9015f3..1f55c3b 100755
--- a/scripts/submit_lava.sh
+++ b/scripts/submit_lava.sh
@@ -104,19 +104,18 @@  submit_squad_watch_job(){
 	fi
 
 	if [ "$TEST" = "swupdate" ] || [ "$TEST" = "kernel-panic" ] || [ "$TEST" = "initramfs-crash" ]; then
-		squad_project="swupdate-testing"
+		SQUAD_PROJECT="swupdate-testing"
 	elif [ "$TEST" = "secure-boot" ]; then
-		squad_project="secure-boot-testing"
+		SQUAD_PROJECT="secure-boot-testing"
 	elif [ "$TEST" = "IEC" ]; then
-		squad_project="iec-layer-testing"
+		SQUAD_PROJECT="iec-layer-testing"
 	else
 		echo "Unable to host results in available CIP Core SQUAD projects"
 		return 1
 	fi
 
-	local DEVICE=$2
-	local ENV="${DEVICE}_${squad_project}"
-	local squad_url="$SQUAD_WATCH_JOBS_URL/${SQUAD_GROUP}/${squad_project}/${COMMIT_REF}/${ENV}"
+	local ENV="${SQUAD_PROJECT}_${TARGET}"
+	local squad_url="$SQUAD_WATCH_JOBS_URL/${SQUAD_GROUP}/${SQUAD_PROJECT}/${COMMIT_REF}/${ENV}"
 	ret=$(curl -s \
 		--header "Authorization: token $CIP_SQUAD_LAB_TOKEN" \
 		--form backend="$SQUAD_LAVA_BACKEND" \
@@ -165,7 +164,7 @@  submit_job() {
 				| cut -d ":" -f 2 \
 				| awk '{$1=$1};1')
 
-			submit_squad_watch_job "${ret}" "${DEVICE}"
+			submit_squad_watch_job "${ret}"
 
 			lavacli $LAVACLI_ARGS jobs logs "${ret}"
 			lavacli $LAVACLI_ARGS results "${ret}"