引入动态流量门禁、隔离验收身份与协议级 Gemini/Volces 模拟器,覆盖双站点 API、Worker、PostgreSQL、River、账务、回调和媒体物化链路。 新增 P24/P28/P32 容量阶梯、Worker 强杀恢复、真实小流量 canary、CAS 放量和失败保持 validation 的生产编排;Worker 执行槽、连接池、媒体并发和双站点副本数改为环境配置。 验证:Go 全量测试、真实 PostgreSQL 迁移集成测试、迁移安全检查、OpenAPI 生成、ShellCheck、Kustomize、gofmt 和 git diff --check。
38 lines
1.0 KiB
Go
38 lines
1.0 KiB
Go
package store
|
|
|
|
import "testing"
|
|
|
|
func TestAcceptanceMetadataRedactsSecrets(t *testing.T) {
|
|
value := sanitizeAcceptanceMetadata(map[string]any{
|
|
"token": "raw-token",
|
|
"nested": map[string]any{
|
|
"databaseUrl": "postgresql://example.invalid/database",
|
|
"taskCount": 1200,
|
|
},
|
|
})
|
|
next := value.(map[string]any)
|
|
if next["token"] != "[REDACTED]" {
|
|
t.Fatalf("token=%v", next["token"])
|
|
}
|
|
nested := next["nested"].(map[string]any)
|
|
if nested["databaseUrl"] != "[REDACTED]" || nested["taskCount"] != 1200 {
|
|
t.Fatalf("nested=%v", nested)
|
|
}
|
|
}
|
|
|
|
func TestAcceptanceURLsMustBeAbsoluteAndCredentialFree(t *testing.T) {
|
|
for _, raw := range []string{
|
|
"http://acceptance-emulator.easyai.svc.cluster.local:8090",
|
|
"https://acceptance.example.invalid/callbacks",
|
|
} {
|
|
if !validAcceptanceURL(raw) {
|
|
t.Fatalf("valid URL rejected: %s", raw)
|
|
}
|
|
}
|
|
for _, raw := range []string{"relative/path", "ftp://example.invalid/file", "https://user:pass@example.invalid"} {
|
|
if validAcceptanceURL(raw) {
|
|
t.Fatalf("invalid URL accepted: %s", raw)
|
|
}
|
|
}
|
|
}
|