From ca3cc94296e1838c0e236bed9c9b15428f226a49 Mon Sep 17 00:00:00 2001 From: Mark Kirichenko Date: Tue, 21 Jan 2025 14:12:27 +0000 Subject: [PATCH] Set a trap to report failed executions This commit modifies the CI scripts to deliver the status update in case of a failure. Signed-off-by: Mark Kirichenko --- ci_entrypoint.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ci_entrypoint.sh b/ci_entrypoint.sh index cd94f3b3..5c6a07b9 100755 --- a/ci_entrypoint.sh +++ b/ci_entrypoint.sh @@ -43,13 +43,18 @@ then exit 1 fi +trap 'STATE="failure"; status_update' ERR + STATE="pending" status_update +echo "Running tests" + set +e ./scripts/run_tests.sh 2>&1 | tee test_logs.out TEST_RESULTS=$? -set -e + +echo "Finished running tests, uploading results to S3" aws s3 cp --content-type 'text/plain' test_logs.out s3://aws-nitro-enclaves-cli/${LOGS_PATH} @@ -58,4 +63,8 @@ if [[ "${TEST_RESULTS}" != "0" ]];then STATE="failure" fi +echo "Updating job status to ${STATE}" + status_update + +echo "Done"