Skip to content

Commit 1f35c6f

Browse files
committed
Report monitoring results to slack
1 parent 8979171 commit 1f35c6f

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

.github/workflows/monitoring-tests.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ name: Monitoring Tests
22

33
on:
44
schedule:
5-
- cron: '21 2 * * *' # every day at 5:21 AM UTC
5+
- cron: '21 2 * * *' # every day at 2:21 AM UTC
66
workflow_dispatch: # allow manually triggering a run
7-
pull_request:
87

98

109
env:
@@ -40,18 +39,36 @@ jobs:
4039
path: .3l_local_test
4140
key: monitor-local-test-cache
4241
- name: Run monitoring tests
42+
id: monitortest
4343
run: make monitortest
4444
continue-on-error: true
4545
- name: Save .3l_local_test cache
4646
uses: actions/cache/save@v4
4747
with:
4848
path: .3l_local_test
4949
key: monitor-local-test-cache
50+
- name: Check test result
51+
run: |
52+
if [ ${{ steps.monitortest.outcome }} == "failure" ]; then
53+
echo "Tests failed"
54+
echo "failure" > test_status.txt
55+
else
56+
echo "Tests passed"
57+
echo "success" > test_status.txt
58+
fi
5059
- name: Process and publish results
5160
run: |
5261
./generate_report.sh
5362
54-
curl -X POST \
55-
-H "Content-type: application/json" \
56-
--data "$(cat slack_message.json)" \
57-
${{ secrets.LIPA_SLACK_3L_MONITORING_BOT_WEBHOOK_URL }}
63+
TEST_STATUS=$(cat test_status.txt)
64+
if [ "$TEST_STATUS" = "failure" ]; then
65+
curl -X POST \
66+
-H "Content-type: application/json" \
67+
--data "$(cat slack_message.json)" \
68+
${{ secrets.LIPA_SLACK_3L_MONITORING_FAILURE_BOT_WEBHOOK_URL }}
69+
else
70+
curl -X POST \
71+
-H "Content-type: application/json" \
72+
--data "$(cat slack_message.json)" \
73+
${{ secrets.LIPA_SLACK_3L_MONITORING_BOT_WEBHOOK_URL }}
74+
fi

0 commit comments

Comments
 (0)