diff --git a/.gitlab/stages/01.test.yml b/.gitlab/stages/01.test.yml index 24176d7653..b42c9b0d63 100644 --- a/.gitlab/stages/01.test.yml +++ b/.gitlab/stages/01.test.yml @@ -46,7 +46,7 @@ test:build_image: ADDITIONAL_PARAMS=() - if [[ "$CI_COMMIT_BRANCH" == "ci-rebuild-mcore-nemo-image" ]]; then + if [[ "$CI_COMMIT_BRANCH" == "ci-rebuild-mcore-nemo-image" || "$CI_COMMIT_BRANCH" == "main" ]]; then ADDITIONAL_PARAMS+=("--pull") ADDITIONAL_PARAMS+=("--cache-to type=registry,ref=${IMAGE}-buildcache:main") fi diff --git a/tests/functional_tests/shell_test_utils/notify_unit_tests.sh b/tests/functional_tests/shell_test_utils/notify_unit_tests.sh index e16f8d81f9..3e25f44af5 100644 --- a/tests/functional_tests/shell_test_utils/notify_unit_tests.sh +++ b/tests/functional_tests/shell_test_utils/notify_unit_tests.sh @@ -11,7 +11,7 @@ collect_jobs () { -s \ --globoff \ --header "PRIVATE-TOKEN: $RO_API_TOKEN" \ - "https://${GITLAB_ENDPOINT}/api/v4/projects/${CI_PROJECT_ID}/pipelines/${DOWNSTREAM_PIPELINE_ID}/jobs?page=$PAGE&per_page=$PER_PAGE" + "https://${GITLAB_ENDPOINT}/api/v4/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/jobs?page=$PAGE&per_page=$PER_PAGE" ) # Combine the results RESULTS=$(jq -s '.[0] + .[1]' <<< "$RESULTS $RESPONSE") @@ -36,20 +36,13 @@ CONTEXT="unit-tests-extended" # Fetch Elastic logs set +x -PIPELINE_JSON=$(curl \ - --fail \ - --silent \ - --header "PRIVATE-TOKEN: ${RO_API_TOKEN}" \ - "https://${GITLAB_ENDPOINT}/api/v4/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/jobs" - ) || ret_code=$? +UNIT_TESTS_JOBS=$(collect_jobs | jq '[.[] | select(.name | startswith("test:pyt"))]') set -x if [[ ${ret_code:-0} -ne 0 ]]; then echo CI_PIPELINE_ID=$CI_PIPELINE_ID does not exist exit 1 fi -UNIT_TESTS_JOBS=$(echo -E $PIPELINE_JSON | jq '[.[] | select(.name | startswith("test:pyt"))]') - if [[ $UNIT_TESTS_JOBS == null ]]; then FAILED_JOBS=$(curl \ --fail \