Dockerfile 运行阶段补齐 dws_dingtalk_scan(F12),并新增 runtime-scripts 门禁 做脚本依赖闭包正负例;就绪探测每次解析当前端点/绑定/凭据并区分 404、未配置、 不可达(F13);路由写入来源路径与父目录,历史空值仅按同连接同 item 的意图读时 补齐(F14);目标筛选显示短 ID 与当前绑定/历史并提供快捷筛选(F15);刷新终态 移除后台运行、展示失败时间/旧快照/脱敏原因/作业 ID 与重试(F16)。 验证:make verify 17 项全过(identity 本地按设计 skipped);一次性 schema 的 Monitor 目录/路由集成用例通过;8088 部署与真实 UI 验收仍由父会话执行。
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"time"
|
||||
|
||||
"knowledge-governance/internal/governance"
|
||||
"knowledge-governance/internal/readiness"
|
||||
)
|
||||
|
||||
func testNow() time.Time { return time.Date(2026, 9, 12, 9, 0, 0, 0, time.UTC) }
|
||||
@@ -141,3 +142,31 @@ func TestOverallReadinessTreatsProductionEndpointAsAdvisory(t *testing.T) {
|
||||
t.Fatalf("real dependency failure must still block: ok=%v blocked=%v", ok, blocked)
|
||||
}
|
||||
}
|
||||
|
||||
// F13: 旧 env 绑定 404 是「业务就绪被阻断」,不是「服务不可达」;
|
||||
// 同时必须把脱敏后的探测对象带出来,否则红灯无法归因。
|
||||
func TestWeKnoraReadinessReportsBindingBlockWithoutLosingLiveness(t *testing.T) {
|
||||
server := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) {
|
||||
writer.WriteHeader(http.StatusOK)
|
||||
}))
|
||||
defer server.Close()
|
||||
provider := &RealProvider{
|
||||
httpClient: server.Client(),
|
||||
weknoraBaseURL: server.URL,
|
||||
health: newHealthTracker(),
|
||||
weknoraReadiness: func(context.Context) (string, error) {
|
||||
target := "实例 weknora.test · 知识库 1b52c140"
|
||||
return target, fmt.Errorf("%w(%s)", readiness.ErrKnowledgeBaseMissing, target)
|
||||
},
|
||||
}
|
||||
health := provider.weKnoraProbe(context.Background(), testNow())
|
||||
if health.Liveness != LiveUp || health.Readiness != ReadBlocked {
|
||||
t.Fatalf("404 binding = %+v, want up/blocked", health)
|
||||
}
|
||||
if health.ProbeTarget != "实例 weknora.test · 知识库 1b52c140" {
|
||||
t.Fatalf("probe target = %q", health.ProbeTarget)
|
||||
}
|
||||
if !strings.Contains(health.Reason, "1b52c140") || strings.Contains(health.Reason, "1b52c140-2e18-4676-afc5-4c7d8d190a8c") {
|
||||
t.Fatalf("reason = %q, want short target only", health.Reason)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user