diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 89aec5bdb4db0080f7c9a04fda28c7c31dd4c2ef..6d9e0b31479126187cda8b9aff052a55d7fbcafb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -105,9 +105,10 @@ bundle-raspberrypi4-64: # Mimic the updated rules for lava-test from the bitbake-workspace. .lava-test: rules: - - if: '$CI_LAVA_TOKEN == null' - when: never + #- if: '$CI_LAVA_TOKEN == null' + # when: never - if: '$CI_PIPELINE_SOURCE == "schedule"' + when: manual # Mimic the updated rules for lava-report from the bitbake-workspace. .lava-report: diff --git a/.oniro-ci/build-generic.yaml b/.oniro-ci/build-generic.yaml index c2081c344b42ec88f7ae673f78a5326ba51dfab6..554f15eab81e90019a1d6d8fb2cb156cc5ac2842 100644 --- a/.oniro-ci/build-generic.yaml +++ b/.oniro-ci/build-generic.yaml @@ -53,8 +53,8 @@ && git remote add incoming-merged "$CI_MERGE_REQUEST_SOURCE_PROJECT_URL" \ && git fetch incoming-merged ); fi; - echo "CI: Switching $CI_ONIRO_GIT_REPO_PATH to $CI_COMMIT_SHA"; - ( cd "$CI_ONIRO_GIT_REPO_PATH" && git checkout "$CI_COMMIT_SHA" ); + #echo "CI: Switching $CI_ONIRO_GIT_REPO_PATH to $CI_COMMIT_SHA"; + #( cd "$CI_ONIRO_GIT_REPO_PATH" && git checkout "$CI_COMMIT_SHA" ); fi set +x diff --git a/.oniro-ci/test-generic.yaml b/.oniro-ci/test-generic.yaml index 530c04b4a15e7ffe1a9bda01f8dd82d802321b48..3386b53c68deaff89dac54e676e069a3d4fc74b3 100644 --- a/.oniro-ci/test-generic.yaml +++ b/.oniro-ci/test-generic.yaml @@ -68,17 +68,21 @@ mv job_def.yaml lava_jobs/ fi set +x - # Submit the job to LAVA. + # Submit the jobs to SQUAD. - | for job_def in $(find lava_jobs/ -name "*.yaml"); do - lava_job_id=$(curl -X POST -H "Authorization: Token $CI_LAVA_TOKEN" -F "definition=$(<${job_def})" "$CI_LAVA_INSTANCE/api/v0.2/jobs/" | jq ".job_ids" | tr -d "[\n ]") - if [ "${lava_job_id}" != "null" ]; then - echo "$CI_LAVA_INSTANCE/scheduler/job/$lava_job_id" - echo "$lava_job_id" >> job_ids_"${CI_JOB_NAME}_${lava_job_id}".txt - else - echo "Failed to submit ${job_def}" - exit 1 - fi + # TODO: do we need build_id from squad? + #build_id=$(curl $CI_SQUAD_INSTANCE/api/submitjob/oniro-core/$CI_PROJECT_NAME/$CI_COMMIT_SHORT_SHA/$MACHINE --header "Auth-Token: $CI_SQUAD_TOKEN" --form "backend=oniro_lava" --form "definition=@${job_def}") + curl $CI_SQUAD_INSTANCE/api/submitjob/oniro-core/$CI_PROJECT_NAME/$CI_COMMIT_SHORT_SHA/$MACHINE --header "Auth-Token: $CI_SQUAD_TOKEN" --form "backend=oniro_lava" --form "definition=@${job_def}" + + #lava_job_id=$(curl -X POST -H "Authorization: Token $CI_LAVA_TOKEN" -F "definition=$(<${job_def})" "$CI_LAVA_INSTANCE/api/v0.2/jobs/" | jq ".job_ids" | tr -d "[\n ]") + #if [ "${lava_job_id}" != "null" ]; then + # echo "$CI_LAVA_INSTANCE/scheduler/job/$lava_job_id" + # echo "$lava_job_id" >> job_ids_"${CI_JOB_NAME}_${lava_job_id}".txt + #else + # echo "Failed to submit ${job_def}" + # exit 1 + #fi done artifacts: paths: @@ -108,6 +112,8 @@ script: - | incomplete=false + # TODO: here get all jobs from squad and check status, or just check some squad field + # TODO: https://qa-reports.linaro.org/api/builds/106391/status/ (test_runs_incomplete) for file in $(find ./ -name "job_ids_*.txt"); do echo "Job file: $file" while read -r p; do