add staged Supermemory smoke diagnostics
This commit is contained in:
@@ -15,20 +15,55 @@ api_key=$(cat "$data_dir/api-key")
|
|||||||
auth_header="Authorization: Bearer $api_key"
|
auth_header="Authorization: Bearer $api_key"
|
||||||
marker="supermemory-poc-google-embedding-2-$(date +%s)"
|
marker="supermemory-poc-google-embedding-2-$(date +%s)"
|
||||||
|
|
||||||
|
fail() {
|
||||||
|
code="$1"
|
||||||
|
phase="$2"
|
||||||
|
printf '{"smoke":"failed","phase":"%s","exit_code":%s}\n' "$phase" "$code"
|
||||||
|
exit "$code"
|
||||||
|
}
|
||||||
|
|
||||||
plan="$data_dir/embedding-plan.json"
|
plan="$data_dir/embedding-plan.json"
|
||||||
for _ in $(seq 1 30); do
|
for _ in $(seq 1 30); do
|
||||||
[ -f "$plan" ] && break
|
[ -f "$plan" ] && break
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
grep -q 'openai' "$plan"
|
grep -q 'openai' "$plan" || fail 11 embedding-plan-provider
|
||||||
grep -q 'google/gemini-embedding-2' "$plan"
|
grep -q 'google/gemini-embedding-2' "$plan" || fail 12 embedding-plan-model
|
||||||
grep -q '1024' "$plan"
|
grep -q '1024' "$plan" || fail 13 embedding-plan-dimensions
|
||||||
|
|
||||||
curl --fail --silent --show-error --max-time 60 \
|
if ! curl --fail --silent --show-error --max-time 60 \
|
||||||
-H "$auth_header" \
|
-H "$auth_header" \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
--data "{\"content\":\"$marker:中文跨文档检索测试;海棠计划的下一步是核对原始报告。\",\"containerTag\":\"$container_tag\",\"customId\":\"$marker\",\"metadata\":{\"source\":\"poc-smoke\",\"status\":\"temporary\"}}" \
|
--data "{\"containerTags\":[\"$container_tag\"],\"limit\":20}" \
|
||||||
"$base_url/v3/documents" >/tmp/add.json
|
"$base_url/v3/documents/list" >/tmp/documents.json; then
|
||||||
|
fail 21 documents-list
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep -q 'supermemory-poc-google-embedding-2' /tmp/documents.json; then
|
||||||
|
if grep -Eq '"status"[[:space:]]*:[[:space:]]*"failed"' /tmp/documents.json; then
|
||||||
|
fail 31 document-processing-failed
|
||||||
|
fi
|
||||||
|
if ! grep -Eq '"status"[[:space:]]*:[[:space:]]*"done"' /tmp/documents.json; then
|
||||||
|
if grep -Eq '"status"[[:space:]]*:[[:space:]]*"embedding"' /tmp/documents.json; then
|
||||||
|
fail 32 document-stuck-embedding
|
||||||
|
fi
|
||||||
|
if grep -Eq '"status"[[:space:]]*:[[:space:]]*"chunking"' /tmp/documents.json; then
|
||||||
|
fail 33 document-stuck-chunking
|
||||||
|
fi
|
||||||
|
if grep -Eq '"status"[[:space:]]*:[[:space:]]*"indexing"' /tmp/documents.json; then
|
||||||
|
fail 34 document-stuck-indexing
|
||||||
|
fi
|
||||||
|
fail 35 document-not-done
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if ! curl --fail --silent --show-error --max-time 60 \
|
||||||
|
-H "$auth_header" \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
--data "{\"content\":\"$marker:中文跨文档检索测试;海棠计划的下一步是核对原始报告。\",\"containerTag\":\"$container_tag\",\"customId\":\"$marker\",\"metadata\":{\"source\":\"poc-smoke\",\"status\":\"temporary\"}}" \
|
||||||
|
"$base_url/v3/documents" >/tmp/add.json; then
|
||||||
|
fail 22 document-add
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
found=false
|
found=false
|
||||||
for _ in $(seq 1 90); do
|
for _ in $(seq 1 90); do
|
||||||
@@ -36,27 +71,47 @@ for _ in $(seq 1 90); do
|
|||||||
-H "$auth_header" \
|
-H "$auth_header" \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
--data "{\"q\":\"海棠计划下一步是什么?\",\"containerTag\":\"$container_tag\",\"searchMode\":\"hybrid\",\"limit\":5}" \
|
--data "{\"q\":\"海棠计划下一步是什么?\",\"containerTag\":\"$container_tag\",\"searchMode\":\"hybrid\",\"limit\":5}" \
|
||||||
"$base_url/v4/search" >/tmp/search.json
|
"$base_url/v4/search" >/tmp/search-v4.json || fail 41 search-v4-request
|
||||||
if grep -q '核对原始报告' /tmp/search.json && grep -q 'poc-smoke' /tmp/search.json; then
|
if grep -q '核对原始报告' /tmp/search-v4.json && grep -q 'poc-smoke' /tmp/search-v4.json; then
|
||||||
|
found=true
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
curl --fail --silent --show-error --max-time 60 \
|
||||||
|
-H "$auth_header" \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
--data "{\"q\":\"海棠计划下一步是什么?\",\"containerTags\":[\"$container_tag\"],\"searchMode\":\"hybrid\",\"limit\":5}" \
|
||||||
|
"$base_url/v4/search" >/tmp/search-v4-tags.json || fail 42 search-v4-tags-request
|
||||||
|
if grep -q '核对原始报告' /tmp/search-v4-tags.json && grep -q 'poc-smoke' /tmp/search-v4-tags.json; then
|
||||||
|
found=true
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
curl --fail --silent --show-error --max-time 60 \
|
||||||
|
-H "$auth_header" \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
--data "{\"q\":\"海棠计划下一步是什么?\",\"containerTag\":\"$container_tag\"}" \
|
||||||
|
"$base_url/v3/search" >/tmp/search-v3.json || fail 43 search-v3-request
|
||||||
|
if grep -q '核对原始报告' /tmp/search-v3.json && grep -q 'poc-smoke' /tmp/search-v3.json; then
|
||||||
found=true
|
found=true
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
[ "$found" = true ]
|
[ "$found" = true ] || fail 44 search-no-traceable-hit
|
||||||
|
|
||||||
curl --fail --silent --show-error --max-time 60 \
|
curl --fail --silent --show-error --max-time 60 \
|
||||||
-H "$auth_header" \
|
-H "$auth_header" \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
--data "{\"containerTag\":\"$container_tag\",\"q\":\"海棠计划\"}" \
|
--data "{\"containerTag\":\"$container_tag\",\"q\":\"海棠计划\"}" \
|
||||||
"$base_url/v4/profile" >/tmp/profile.json
|
"$base_url/v4/profile" >/tmp/profile.json || fail 51 profile-request
|
||||||
grep -q '"profile"' /tmp/profile.json
|
grep -q '"profile"' /tmp/profile.json || fail 52 profile-shape
|
||||||
|
|
||||||
curl --fail --silent --show-error --max-time 60 \
|
curl --fail --silent --show-error --max-time 60 \
|
||||||
-H "$auth_header" \
|
-H "$auth_header" \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
--data "{\"conversationId\":\"$marker\",\"containerTags\":[\"$container_tag\"],\"messages\":[{\"role\":\"user\",\"content\":\"这只是隔离测试。\"},{\"role\":\"assistant\",\"content\":\"不会作为正式事实。\"}],\"metadata\":{\"source\":\"poc-smoke\",\"status\":\"temporary\"}}" \
|
--data "{\"conversationId\":\"$marker\",\"containerTags\":[\"$container_tag\"],\"messages\":[{\"role\":\"user\",\"content\":\"这只是隔离测试。\"},{\"role\":\"assistant\",\"content\":\"不会作为正式事实。\"}],\"metadata\":{\"source\":\"poc-smoke\",\"status\":\"temporary\"}}" \
|
||||||
"$base_url/v4/conversations" >/tmp/conversation.json
|
"$base_url/v4/conversations" >/tmp/conversation.json || fail 61 conversation-ingest
|
||||||
|
|
||||||
touch "$sentinel"
|
touch "$sentinel"
|
||||||
printf '%s\n' '{"embedding_plan":"openai/google/gemini-embedding-2/1024","llm":"gemini-3.5-flash-lite","chinese_hybrid_search":"ok","metadata_traceability":"ok","profile":"ok","conversation_ingest":"accepted"}'
|
printf '%s\n' '{"embedding_plan":"openai/google/gemini-embedding-2/1024","llm":"gemini-3.5-flash-lite","chinese_hybrid_search":"ok","metadata_traceability":"ok","profile":"ok","conversation_ingest":"accepted"}'
|
||||||
|
|||||||
Reference in New Issue
Block a user