feat: add Telegram notifications to PostSync smoke tests + new tests for researchowl/openclaw
- Create telegram-notify secret in n8n, portfolio, polymarket-bot, researchowl, openclaw namespaces (values mirrored from monitoring/grafana-telegram) - Update existing smoke tests (n8n, portfolio, polymarket-bot) to send [OK]/[FAIL] Telegram notifications on success/failure - Add postsync-smoke-test for openclaw (curl GET / on port 18789) - Add postsync-smoke-test for researchowl (no HTTP port; checks readyReplicas via k8s API using a smoke-test-reader ServiceAccount + Role + RoleBinding) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,17 @@ spec:
|
||||
containers:
|
||||
- name: smoke-test
|
||||
image: curlimages/curl:latest
|
||||
env:
|
||||
- name: TELEGRAM_BOT_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: telegram-notify
|
||||
key: TELEGRAM_BOT_TOKEN
|
||||
- name: TELEGRAM_CHAT_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: telegram-notify
|
||||
key: TELEGRAM_CHAT_ID
|
||||
command: ["/bin/sh", "-c"]
|
||||
args:
|
||||
- |
|
||||
@@ -22,22 +33,36 @@ spec:
|
||||
API="http://api.polymarket-bot.svc.cluster.local:8000"
|
||||
DASH="http://dashboard.polymarket-bot.svc.cluster.local:80"
|
||||
|
||||
notify() {
|
||||
curl -s --max-time 10 -X POST \
|
||||
"https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
|
||||
-d "chat_id=${TELEGRAM_CHAT_ID}" \
|
||||
--data-urlencode "text=$1" \
|
||||
> /dev/null || true
|
||||
}
|
||||
|
||||
fail() {
|
||||
notify "[FAIL] polymarket-bot PostSync: $1"
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo "--- [1/3] GET /api/summary ---"
|
||||
SUMMARY=$(curl -sf --max-time 15 --retry 3 --retry-delay 5 --retry-all-errors \
|
||||
"$API/api/summary")
|
||||
"$API/api/summary") || fail "GET /api/summary unreachable"
|
||||
echo "$SUMMARY"
|
||||
echo "$SUMMARY" | grep -qE '"paper_mode"\s*:\s*true' \
|
||||
|| { echo "FAIL: paper_mode is not true"; exit 1; }
|
||||
|| fail "paper_mode is not true"
|
||||
echo "OK"
|
||||
|
||||
echo "--- [2/3] GET /api/trades?status=open ---"
|
||||
curl -sf --max-time 15 --retry 3 --retry-delay 5 --retry-all-errors \
|
||||
"$API/api/trades?status=open" > /dev/null
|
||||
"$API/api/trades?status=open" > /dev/null || fail "GET /api/trades unreachable"
|
||||
echo "OK"
|
||||
|
||||
echo "--- [3/3] Dashboard HTTP 200 ---"
|
||||
curl -sf --max-time 15 --retry 3 --retry-delay 5 --retry-all-errors \
|
||||
"$DASH/" > /dev/null
|
||||
"$DASH/" > /dev/null || fail "dashboard returned non-200"
|
||||
echo "OK"
|
||||
|
||||
notify "[OK] polymarket-bot PostSync passed"
|
||||
echo "=== polymarket-bot: all smoke tests passed ==="
|
||||
|
||||
Reference in New Issue
Block a user