package release_test import ( "strings" "testing" "github.com/carlosframework/platform/internal/release" ) // canary -> stable is the jump that would make the ladder decorative: it is // exactly what a production app parked on a migration canary channel would do // if nothing stopped it. func TestCanaryToStableIsRefused(t *testing.T) { err := release.PromotionAllowed(release.RungCanary, release.RungStable) if err == nil { t.Fatal("canary -> stable was ALLOWED — the ladder is decorative") } if !strings.Contains(err.Error(), "-hotfix") { t.Errorf("refusal %q does not name --hotfix", err) } t.Logf("refusal: %v", err) // And the same jump for beta, for completeness. if release.PromotionAllowed(release.RungCanary, release.RungBeta) == nil { t.Error("canary -> beta was allowed") } }