All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m20s
21 lines
592 B
Go
21 lines
592 B
Go
package releasegate
|
|
|
|
import "testing"
|
|
|
|
func TestReportBlocksOnlyOnBlockingFindings(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
report := Report{Phase: PhasePre, Findings: []Finding{{
|
|
Code: "FOUNDATION_OBJECT_MISSING", Severity: SeverityInfo, Object: "tb_outbox_event",
|
|
}}}
|
|
if !report.Passed() {
|
|
t.Fatal("迁移前公共对象尚未创建不应单独阻断发布")
|
|
}
|
|
report.Findings = append(report.Findings, Finding{
|
|
Code: "OUTBOX_UNDELIVERED", Severity: SeverityBlock, Object: "tb_outbox_event", Count: 1,
|
|
})
|
|
if report.Passed() {
|
|
t.Fatal("存在未投递事件时必须阻断发布")
|
|
}
|
|
}
|