test(ingest): Add integration test for INGEST_MODEL logging

This commit is contained in:
Matteo Cherubini 2026-06-05 09:33:45 +02:00
parent 39775398f7
commit 50d3f39f51

View file

@ -91,3 +91,44 @@ EOF
# listed by slug under the Conflicts section
grep -q 'queries/conflict-pricing-2026-06-03' wiki/index.md
}
@test "run-ingest: records INGEST_MODEL in the log (manifest carries no model field)" {
command -v jq >/dev/null 2>&1 || skip "jq not installed"
G="$(make_fixture_genome)"; cd "$G"
cat > wiki/sources/test-source.md <<'EOF'
---
title: "Test Source"
type: source
domain: genome-test
tags: [t]
maturity: draft
last_updated: 2026-06-04
private: false
---
body
EOF
# New contract: NO "model" field — the orchestrator supplies it via INGEST_MODEL.
cat > .ingest-manifest.json <<'EOF'
{
"raw_source": "raw/articles/test.md",
"reasoning": "Ingested the test source.",
"pr_summary": "Ingest of test: 1 source page.",
"contradictions": "None",
"pages": [
{"path": "wiki/sources/test-source.md", "summary": "A smoke-test source.", "maturity": "draft", "status": "created"}
]
}
EOF
export KG_LIB_DIR="$LIB_DIR"
export FORGEJO_URL="http://forgejo.local" FORGEJO_USER="u" FORGEJO_TOKEN="t" DRY_RUN=1
export INGEST_MODEL="qwen-test-tag"
run bash "$SKILL_SCRIPTS/run-ingest.sh" genome-test
[ "$status" -eq 0 ]
[[ "$output" == *'"status":"ok"'* ]]
grep -q 'qwen-test-tag' wiki/log.md
}