Skip to content
Snippets Groups Projects

ci: reorganize SQUAD groups and projects

Merged Chase Qi requested to merge (removed):reorg-squad-projects into kirkstone
All threads resolved!
Files
2
@@ -12,7 +12,8 @@
@@ -12,7 +12,8 @@
GIT_STRATEGY: none
GIT_STRATEGY: none
CI_LAVA_INSTANCE: "https://lava.ostc-eu.org/"
CI_LAVA_INSTANCE: "https://lava.ostc-eu.org/"
CI_SQUAD_INSTANCE: "https://squadp.svc.ostc-eu.dev"
CI_SQUAD_INSTANCE: "https://squadp.svc.ostc-eu.dev"
CI_SQUAD_PROJECT_NAME: "oniro-test-mr"
CI_SQUAD_GROUP_NAME: ""
 
CI_SQUAD_PROJECT_NAME: ""
CI_LAVA_JOB_PRIORITY: "medium"
CI_LAVA_JOB_PRIORITY: "medium"
# Run the same ltp test suites that using by LKFT project.
# Run the same ltp test suites that using by LKFT project.
# Reference: https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.10.y/build/v5.10.98-75-g9f5cb871ceb9/testjobs/
# Reference: https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.10.y/build/v5.10.98-75-g9f5cb871ceb9/testjobs/
@@ -32,7 +33,13 @@
@@ -32,7 +33,13 @@
echo "precondition failed - set CI_LAVA_JOB_DEFINITION to the URL of the LAVA test job definition"
echo "precondition failed - set CI_LAVA_JOB_DEFINITION to the URL of the LAVA test job definition"
&& exit 1 )
&& exit 1 )
- test -n "$CI_REPORT_JOB_NAME" || (
- test -n "$CI_REPORT_JOB_NAME" || (
echo "precondition failed - set CI_REPORT_JOB_NAME to the CI job name which will gather results back from LAVA"
echo "precondition failed - set CI_REPORT_JOB_NAME to the CI job name which will gather results back from Squad"
 
&& exit 1 )
 
- test -n "$CI_SQUAD_GROUP_NAME" || (
 
echo "precondition failed - set CI_SQUAD_GROUP_NAME to the squad group name."
 
&& exit 1 )
 
- test -n "$CI_SQUAD_PROJECT_NAME" || (
 
echo "precondition failed - set CI_SQUAD_PROJECT_NAME to the squad project name."
&& exit 1 )
&& exit 1 )
# If the test job name contains 'sysota', usage of update job name is
# If the test job name contains 'sysota', usage of update job name is
# required.
# required.
@@ -85,8 +92,8 @@
@@ -85,8 +92,8 @@
# Submit the jobs to SQUAD.
# Submit the jobs to SQUAD.
- |
- |
for job_def in $(find lava_jobs/ -name "*.yaml"); do
for job_def in $(find lava_jobs/ -name "*.yaml"); do
echo $CI_SQUAD_INSTANCE/api/submitjob/oniro-core/$CI_SQUAD_PROJECT_NAME/$CI_PIPELINE_ID/$MACHINE --header "Auth-Token: $CI_SQUAD_TOKEN" --form "backend=oniro_lava" --form "definition=@${job_def}"
echo $CI_SQUAD_INSTANCE/api/submitjob/$CI_SQUAD_GROUP_NAME/$CI_SQUAD_PROJECT_NAME/$CI_PIPELINE_ID/$MACHINE --header "Auth-Token: $CI_SQUAD_TOKEN" --form "backend=oniro_lava" --form "definition=@${job_def}"
curl $CI_SQUAD_INSTANCE/api/submitjob/oniro-core/$CI_SQUAD_PROJECT_NAME/$CI_PIPELINE_ID/$MACHINE --header "Auth-Token: $CI_SQUAD_TOKEN" --form "backend=oniro_lava" --form "definition=@${job_def}"
curl $CI_SQUAD_INSTANCE/api/submitjob/$CI_SQUAD_GROUP_NAME/$CI_SQUAD_PROJECT_NAME/$CI_PIPELINE_ID/$MACHINE --header "Auth-Token: $CI_SQUAD_TOKEN" --form "backend=oniro_lava" --form "definition=@${job_def}"
done
done
# Attach a callback to this build to trigger the lava-report job
# Attach a callback to this build to trigger the lava-report job
squad_build_id="$(curl --silent "$CI_SQUAD_INSTANCE/api/builds/?version=$CI_PIPELINE_ID" | jq -r '.results[0].id')"
squad_build_id="$(curl --silent "$CI_SQUAD_INSTANCE/api/builds/?version=$CI_PIPELINE_ID" | jq -r '.results[0].id')"
@@ -129,7 +136,9 @@
@@ -129,7 +136,9 @@
# report job is successful or not.
# report job is successful or not.
squad_build_id="$(curl --silent "$CI_SQUAD_INSTANCE/api/builds/?version=$CI_PIPELINE_ID" | jq -r '.results[0].id')"
squad_build_id="$(curl --silent "$CI_SQUAD_INSTANCE/api/builds/?version=$CI_PIPELINE_ID" | jq -r '.results[0].id')"
curl --silent "$CI_SQUAD_INSTANCE/api/builds/$squad_build_id/testjobs/" > test_jobs.json
curl --silent "$CI_SQUAD_INSTANCE/api/builds/$squad_build_id/testjobs/" > test_jobs.json
jq -r '.results | .[] | .external_url, .job_status' test_jobs.json | tee job_status.txt
jq -r '.results | .[] | .name, .environment, .external_url, .job_status | @sh' test_jobs.json \
 
| xargs printf '------------\nname: %s\ndevice: %s\nurl: %s\nstatus: %s\n' \
 
| tee job_status.txt
if grep -qi "incomplete" job_status.txt; then
if grep -qi "incomplete" job_status.txt; then
echo "ERROR: Incomplete test job reported: exit code 1"
echo "ERROR: Incomplete test job reported: exit code 1"
exit 1
exit 1
Loading