36 lines
1.1 KiB
Haskell
Raw Permalink Normal View History

module Main where
import MiniAudit.Rollout
( Environment (Production)
, ReleaseJob (ReleaseJob)
, RolloutMode (Canary)
, RolloutReport (RolloutReport)
, parseJob
, renderAudit
, renderReport
, runRollout
)
import System.Exit (die)
main :: IO ()
main =
case parseJob "api:production:canary:20:3" of
Left err -> die err
Right job ->
case runRollout job of
( RolloutReport "api" Production 3 [20, 100] True
, auditLog
) | lines (renderAudit auditLog)
== [ "start api in production"
, "scale target replicas to 3"
, "run schema migration for api"
, "shift 20% traffic to canary"
, "observe error budget after canary window"
, "shift remaining 80% traffic"
, "mark rollout complete for api"
]
&& renderReport (RolloutReport "api" Production 3 [20, 100] True)
== "api -> production, replicas 3, milestones [20,100], schema migrated yes" ->
putStrLn "test passed"
_ -> die "unexpected Writer rollout result"