feat: require production infrastructure evidence
This commit is contained in:
@@ -71,6 +71,32 @@ func TestAcceptancePlatformHealthSummaryCoversMissingAndCounts(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestEvaluateAcceptanceProductionInfrastructure(t *testing.T) {
|
||||
readyChecks := []PlatformHealthCheck{
|
||||
{Name: "deployment_profile", Status: "healthy", Value: "production"},
|
||||
{Name: "offsite_backup", Status: "healthy", Value: "age_seconds=120"},
|
||||
{Name: "external_alert_receiver", Status: "healthy", Value: "configured"},
|
||||
{Name: "mock_services", Status: "healthy", Value: "disabled"},
|
||||
}
|
||||
ready := evaluateAcceptanceProductionInfrastructure("PRODUCTION", readyChecks)
|
||||
if !ready.Applicable || !ready.GateSatisfied || !ready.OffsiteBackupReady || !ready.ExternalAlertReceiverReady || !ready.MockServicesDisabled {
|
||||
t.Fatalf("ready=%+v", ready)
|
||||
}
|
||||
demo := evaluateAcceptanceProductionInfrastructure("PRODUCTION", []PlatformHealthCheck{
|
||||
{Name: "deployment_profile", Status: "healthy", Value: "demo"},
|
||||
{Name: "offsite_backup", Status: "healthy", Value: "not_required"},
|
||||
{Name: "external_alert_receiver", Status: "healthy", Value: "not_configured"},
|
||||
{Name: "mock_services", Status: "healthy", Value: "enabled_for_demo"},
|
||||
})
|
||||
if demo.GateSatisfied || demo.DeploymentProfile != "demo" || !strings.Contains(acceptanceProductionInfrastructureSummary(demo), "异地备份") {
|
||||
t.Fatalf("demo=%+v summary=%q", demo, acceptanceProductionInfrastructureSummary(demo))
|
||||
}
|
||||
lab := evaluateAcceptanceProductionInfrastructure("LAB", nil)
|
||||
if lab.Applicable || !lab.GateSatisfied {
|
||||
t.Fatalf("lab=%+v", lab)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAcceptanceSnapshotAllowsAllProductionExternalDependencies(t *testing.T) {
|
||||
input := AcceptanceSnapshotInput{
|
||||
CandidateVersion: "0.64.0-rc.1", BuildDigest: "sha256:" + strings.Repeat("b", 64),
|
||||
|
||||
Reference in New Issue
Block a user