chore: 发布前检查在途任务;断言核心任务都由业务模块注册
- release.sh 替换容器前列出引擎里未结束的任务(任务名@版本、状态),有则停下, --allow-inflight 放行(新版本只认领自己注册的任务版本) - modules.test:生产模块装配下每个核心任务都由业务模块正式注册,不落到空壳兜底 - 刮削 / 任务入队的关联写回与引擎查询异常两处边界已在 v0.3.14 修复并有故障注入测试 (test/acquisition-organize/enqueue-recovery.test.ts) Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
b61335eaf6
commit
7cc3742d31
2 files changed
+37
-6
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { createRoute, z } from "@hono/zod-openapi";
|
||||
import { apiResponse, CAPABILITY_IDS, capabilitySpec } from "@umt/contracts";
|
||||
import { defineTask, TASK_NAMES } from "@umt/tasks";
|
||||
import { defineTask, TASK_NAMES, TaskRegistry } from "@umt/tasks";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { buildTaskRegistry, collectOutboxRoutes, DeferredTaskEngine } from "../src/context.ts";
|
||||
import { createApp } from "../src/http/app.ts";
|
||||
@@ -91,6 +91,16 @@ describe("ServerModule 骨架", () => {
|
||||
expect(() => buildTaskRegistry([pingModule, { ...pingModule, name: "dup" }], fakeCtx)).toThrow(/重复注册/);
|
||||
});
|
||||
|
||||
it("生产装配:每个核心任务都由业务模块正式注册,不落到空壳兜底", () => {
|
||||
const owned = new Set<string>();
|
||||
for (const m of SERVER_MODULES) {
|
||||
const own = new TaskRegistry();
|
||||
m.registerTasks(own, fakeCtx);
|
||||
for (const name of own.names()) owned.add(name);
|
||||
}
|
||||
expect(TASK_NAMES.filter((n) => !owned.has(n))).toEqual([]);
|
||||
});
|
||||
|
||||
it("outbox 路由合并;同一事件被两个模块认领报错", () => {
|
||||
const merged = Object.keys(collectOutboxRoutes([...SERVER_MODULES, pingModule], fakeCtx));
|
||||
expect(merged).toContain("test.ping");
|
||||
|
||||
Reference in new issue
Block a user