forked from EduCraft/curriculum-project-hub
test(hub): 真实 model 集成测试 + Gitea CI workflow
real-model.test.ts: 用真 OpenRouter model + 真 cph + 真 workspace 跑 agent tool-calls 循环,验证 MockProvider 测不到的路径(model 返回 tool_calls → dispatch → tool_result 回传 → 继续/stop)。没 OPENROUTER_API_KEY 时自动 skip,不阻塞 CI;有 key 时自动跑。 两个 test:(1) list files → cph check → 回答;(2) write file → read back。 hub-check.yml: Gitea CI workflow,对齐 checker-check/spec-check 的纪律: npm ci → prisma generate → tsc → prisma validate → 装 cph → vitest unit → vitest integration(postgres service container)→ real-model(可选,从 secrets 注入 key)。 全 suite: 60 passed + 2 skipped(无 key)。tsc rc=0。
This commit is contained in:
+14
-8
@@ -1,19 +1,22 @@
|
||||
# Hub runtime configuration. Copy to .env and fill in.
|
||||
#
|
||||
# For local dev: `cp .env.example .env` then edit.
|
||||
# For tests: integration tests read from .env via dotenv.
|
||||
|
||||
# PostgreSQL connection string. Used by Prisma and the Hub server.
|
||||
# PostgreSQL connection string.
|
||||
DATABASE_URL="postgresql://paradigm:paradigm@127.0.0.1:5432/paradigm"
|
||||
|
||||
# OpenRouter (or any OpenAI-compatible) API key + base URL.
|
||||
# The Hub's agent layer is provider-agnostic (ADR-0017); this points the
|
||||
# OpenAI-compatible client at OpenRouter by default.
|
||||
# OpenRouter (or any OpenAI-compatible) API key.
|
||||
# Get one at https://openrouter.ai/keys
|
||||
# The agent layer is provider-agnostic (ADR-0017); OpenRouter routes to any model.
|
||||
OPENROUTER_API_KEY=""
|
||||
|
||||
# Optional: override the base URL (e.g. direct vendor API, local gateway).
|
||||
# OPENROUTER_BASE_URL="https://openrouter.ai/api/v1"
|
||||
|
||||
# Hub server port. Defaults to 8788.
|
||||
PORT=8788
|
||||
|
||||
# Feishu (lark) bot credentials. The bot receives @mentions in project groups.
|
||||
# Feishu (lark) bot credentials. Create a self-built app at
|
||||
# https://open.feishu.cn/app, add the "Bot" capability, subscribe to
|
||||
# im.message.receive_v1, then fill these in.
|
||||
FEISHU_APP_ID=""
|
||||
FEISHU_APP_SECRET=""
|
||||
FEISHU_BOT_OPEN_ID=""
|
||||
@@ -21,3 +24,6 @@ FEISHU_BOT_OPEN_ID=""
|
||||
# Path to the `cph` binary (the Courseware-side checker, ADR-0016).
|
||||
# Defaults to `cph` on PATH if unset.
|
||||
# CPH_BIN="/usr/local/bin/cph"
|
||||
|
||||
# Hub server port. Defaults to 8788.
|
||||
PORT=8788
|
||||
|
||||
Reference in New Issue
Block a user