Skip to content

Commit 83e0cfa

Browse files
author
David T. Adcox
committed
523: Send slack msg on kind test failure
1 parent 4dd7fd8 commit 83e0cfa

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

scripts/pipeline/runTest.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,19 @@ echo "switching back to ebc-gateway-http directory"
9191
cd scripts/pipeline/ebc-gateway-http
9292

9393
if [[ "$keep_cluster" == 0 ]]; then
94+
if (( (rc & KIND_E2E_TEST) >0 )); then
95+
slack_users=$(get_env slack_users)
96+
echo "slack_users=$slack_users"
97+
eval "arr=($slack_users)"
98+
for user in "${arr[@]}"; do
99+
echo "user=$user"
100+
curl -X POST -H 'Content-type: application/json' --data '{"text":"<'$user'> kind accceptance test failure see below "}' $(get_env slack_web_hook_url)
101+
echo " "
102+
done
103+
pipeline_url="https://cloud.ibm.com/devops/pipelines/tekton/${PIPELINE_ID}/runs/${PIPELINE_RUN_ID}?env_id=ibm:yp:us-south"
104+
curl -X POST -H 'Content-type: application/json' --data '{"text":"Your kind acceptance test failed."}' $(get_env slack_web_hook_url) </dev/null
105+
curl -X POST -H 'Content-type: application/json' --data '{"text":"Failing pipeline: '$pipeline_url'"}' $(get_env slack_web_hook_url) </dev/null
106+
fi
94107
./ebc_complete.sh
95108
else
96109
hours=$(get_env ebc_autocomplete_hours "6")
@@ -103,9 +116,9 @@ else
103116
echo "slack_users=$slack_users"
104117
eval "arr=($slack_users)"
105118
for user in "${arr[@]}"; do
106-
echo "user=$user"
107-
curl -X POST -H 'Content-type: application/json' --data '{"text":"<'$user'> accceptance test failure see below "}' $(get_env slack_web_hook_url)
108-
echo " "
119+
echo "user=$user"
120+
curl -X POST -H 'Content-type: application/json' --data '{"text":"<'$user'> accceptance test failure see below "}' $(get_env slack_web_hook_url)
121+
echo " "
109122
done
110123
pipeline_url="https://cloud.ibm.com/devops/pipelines/tekton/${PIPELINE_ID}/runs/${PIPELINE_RUN_ID}?env_id=ibm:yp:us-south"
111124
curl -X POST -H 'Content-type: application/json' --data '{"text":"Your acceptance test failed."}' $(get_env slack_web_hook_url) </dev/null

0 commit comments

Comments
 (0)