From 709b560f1ab611157d1ac938e49c58af8fe60fd0 Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Thu, 24 Jul 2025 07:50:41 +0000 Subject: [PATCH] VNC-222 Presets test failing without showing report in CI --- .ci/helpers.sh | 11 ++++++++--- .gitlab-ci.yml | 5 +++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.ci/helpers.sh b/.ci/helpers.sh index c00484f..f63d01c 100644 --- a/.ci/helpers.sh +++ b/.ci/helpers.sh @@ -89,9 +89,14 @@ upload_report_to_s3() { } put_report_into_ci_pipeline() { - report_name="Functional%20test%20report" - report_url="https://${S3_BUCKET}.s3.amazonaws.com/${s3_tests_directory}/report/index.html" - curl --request POST --header "PRIVATE-TOKEN:${GITLAB_API_TOKEN}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/statuses/${CI_COMMIT_SHA}?state=success&name=${report_name}&target_url=${report_url}" + local functional_tests_exit_code="$1" + local report_name="Functional%20test%20report" + local report_url="https://${S3_BUCKET}.s3.amazonaws.com/${s3_tests_directory}/report/index.html" + local state="success" + if [ "$functional_tests_exit_code" -ne 0 ]; then + state="failed" + fi + curl --request POST --header "PRIVATE-TOKEN:${GITLAB_API_TOKEN}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/statuses/${CI_COMMIT_SHA}?state=${state}&name=${report_name}&target_url=${report_url}" } prepare_kasmvnc_built_packages_to_replace_workspaces_image_packages() { diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7c1b49c..0482d62 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -59,9 +59,10 @@ functional_test: - . .ci/helpers.sh script: - prepare_to_run_functional_tests - - ./functional-test + - set +e; ./functional-test; exit_code=$?; set -e - upload_report_to_s3 - - put_report_into_ci_pipeline + - put_report_into_ci_pipeline "$exit_code" + - exit "$exit_code" dependencies: - build_amd64 artifacts: