- classify enrich sources: encyclopedia, platform pages (hongguo, kuaikaw, video platforms), douban (search snippet only) and other sites' search snippets (snippet mode, pages never opened); one extractor per source, fields carry source kind and confidence, merged by noisy-OR across hosts - new cast field (applied as MediaCredit with placeholder ids) - robots.txt check (cached per host 1 day) and login-wall/captcha give-up - per-enrichment source attempts + GET /identity/enrich-stats, 30-day hit-rate table under settings -> metadata -> identity - setting identity.enrichSnippetAllSites (default on); default domains add baike.com and kuaikaw.cn - replay fixtures from the real run on the 4 user-library short dramas (sanitized Brave responses, hongguo page, robots.txt) Co-Authored-By: Claude Opus 5.5 <[email protected]>
44 lines
1.5 KiB
TypeScript
44 lines
1.5 KiB
TypeScript
import { defineConfig } from "vitest/config";
|
|
|
|
// 两组测试:
|
|
// unit —— 纯内存、无 PG,文件并行;
|
|
// pg —— 真实 PG 的集成/e2e(每文件独立业务 schema + 引擎 schema,真实 worker/后台循环),文件级串行,
|
|
// 并排在 unit 之后(groupOrder)。并发全量跑时多个 e2e 的 worker/轮询/迁移互相抢 CPU 与连接,
|
|
// 会把"入库→状态推进"这类时序拉长到超时,也会放大竞态;串行让每个文件拿到稳定的时序预算。
|
|
// 新测试文件缺省归入 pg(串行,安全);确认不碰 PG 的才加进 UNIT。
|
|
const UNIT = [
|
|
"test/api-registry.test.ts",
|
|
"test/file-manager/preview-parse.test.ts",
|
|
"test/auth.test.ts",
|
|
"test/health.test.ts",
|
|
"test/sources-identity/identity-differential.test.ts",
|
|
"test/sources-identity/enrich-sources.test.ts",
|
|
"test/invoke-limits.test.ts",
|
|
"test/logger.test.ts",
|
|
"test/mapping-compat.test.ts",
|
|
"test/modules.test.ts",
|
|
"test/sse.test.ts",
|
|
"test/static.test.ts",
|
|
];
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
// 建/删 schema 在一把咨询锁上排队(withSchemaLock),迁移 + 引擎 schema 在负载下可能超过缺省 10s
|
|
hookTimeout: 120_000,
|
|
teardownTimeout: 60_000,
|
|
projects: [
|
|
{ extends: true, test: { name: "unit", include: UNIT } },
|
|
{
|
|
extends: true,
|
|
test: {
|
|
name: "pg",
|
|
include: ["test/**/*.test.ts", "src/**/*.test.ts"],
|
|
exclude: UNIT,
|
|
fileParallelism: false,
|
|
sequence: { groupOrder: 1 },
|
|
},
|
|
},
|
|
],
|
|
},
|
|
});
|