diff --git a/test/m-ai-01-08-integration.sh b/test/m-ai-01-08-integration.sh index bdfe253..eeee323 100644 --- a/test/m-ai-01-08-integration.sh +++ b/test/m-ai-01-08-integration.sh @@ -103,34 +103,26 @@ else fi # ─── 4. Notification 链路 ── +# Notification jobs are triggered implicitly by Active Recall/Feynman analysis +# via notifyJobComplete() → NotificationWorker. Verify after Active Recall section. echo "" echo "── 4. Notification 链路 ──" -echo -n " Triggering notification..." -NOTIF=$(curl -s -X POST "$API/api/notifications/test" \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer ${USER_TOKEN:-test}" \ - -d '{"type":"ai_job_succeeded","title":"Integration Test","content":"Verifying notification chain"}' 2>/dev/null) -NOTIF_STATUS=$(echo "$NOTIF" | python3 -c "import json,sys; d=json.load(sys.stdin); print(d.get('success', False))" 2>/dev/null || echo "") -if [ "$NOTIF_STATUS" = "True" ]; then - pass "Notification enqueued" -else - echo " (skipped — requires USER_TOKEN)" -fi - -echo " Worker processes notification queue:" -NOTIF_LOG=$(docker compose logs worker 2>/dev/null | grep -i "notification" | tail -3 || echo "") +echo " Notification jobs are created by Active Recall analysis (notifyJobComplete)." +echo " Worker log verification:" +NOTIF_LOG=$(docker compose logs worker 2>/dev/null | grep -i "notification" | tail -5 || echo "") if [ -n "$NOTIF_LOG" ]; then echo "$NOTIF_LOG" pass "NotificationWorker log entries found" else - echo " (no notification log entries yet — Worker may not have processed the job)" + echo " (no notification log entries yet — run Active Recall analysis to trigger notifyJobComplete)" fi -echo " Verify notification state in DB:" +echo "" +echo " Verify notification records in DB:" echo " docker compose exec mysql mysql -u zhixi_user -p\$MYSQL_PASSWORD zhixi -e \"" -echo " SELECT id, userId, type, title, readAt, createdAt FROM Notification WHERE type='ai_job_succeeded' ORDER BY createdAt DESC LIMIT 3;\" " +echo " SELECT id, userId, type, title, readAt, createdAt FROM Notification ORDER BY createdAt DESC LIMIT 5;\" " # ─── 5. Active Recall 全链路 ──