From 50d3f39f5186f47a6c133f027c6e4a5590d5776e Mon Sep 17 00:00:00 2001 From: Matteo Cherubini Date: Fri, 5 Jun 2026 09:33:45 +0200 Subject: [PATCH] test(ingest): Add integration test for INGEST_MODEL logging --- tests/run-ingest.bats | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/run-ingest.bats b/tests/run-ingest.bats index 20864f9..65fdb43 100644 --- a/tests/run-ingest.bats +++ b/tests/run-ingest.bats @@ -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 +}