test(library): 隔离数据契约与 r11 身份自然键矩阵

真实本机 PG/ES/MinIO:v071 目录镜像 10 模式、结构引用/游标 15 模式、
8 表×2 外部范围身份矩阵、13 模式自然键(含软删除与合法同 parent 正例)、
备份期间三注入、收尾故障与授权撤销两个真实治理 PG 用例。

需隔离服务的用例在 test-scope.json 显式声明:普通 CI 跳过不算通过。
This commit is contained in:
姚章浩
2026-11-01 11:35:09 +08:00
parent 5eef13b615
commit 8febe12d7d
62 changed files with 7329 additions and 167 deletions
@@ -30,6 +30,7 @@ func TestEmptyTargetOverviewAndEnqueueAgree(t *testing.T) {
}
return true, nil, nil
}}
sourceID := bindSourceFixture(t, &config, store, &target)
rec := httptest.NewRecorder()
libraryOverviewHandler(rec, httptest.NewRequest(http.MethodGet, "/api/v1/library/overview?scope=internal", nil), config)
var overview libraryOverview
@@ -40,7 +41,7 @@ func TestEmptyTargetOverviewAndEnqueueAgree(t *testing.T) {
t.Fatalf("failed=%v gate=%+v", failed, overview.Gate)
}
rec = httptest.NewRecorder()
librarySyncEnqueue(rec, httptest.NewRequest(http.MethodPost, "/api/v1/library/syncs", strings.NewReader(`{"scope":"internal","target_snapshot_id":"`+target+`"}`)), config)
librarySyncEnqueue(rec, httptest.NewRequest(http.MethodPost, "/api/v1/library/syncs", strings.NewReader(sourceRequestBody(t, `{"scope":"internal","target_snapshot_id":"`+target+`"}`, sourceID))), config)
if failed {
if rec.Code != http.StatusServiceUnavailable || store.createN != 0 {
t.Fatalf("unreachable target enqueued: %d %s", rec.Code, rec.Body.String())