feat(workflow): example covers security, platform, enterprise and resilience features
105 route tests, matrix crawl, spec and README updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
// Route: /operability/deploy (rolling, blue-green, rollback)
|
||||
#include "support/Assert.hpp"
|
||||
|
||||
using namespace molo::example::test;
|
||||
using molo::example::fw::Method;
|
||||
|
||||
static const char* kForm = "application/x-www-form-urlencoded";
|
||||
|
||||
int main() {
|
||||
Fixture f;
|
||||
check(f.client->get("/operability/deploy").status == 200, "status 200");
|
||||
f.client->post("/operability/deploy/start", "strategy=rolling&version=v2", kForm);
|
||||
f.client->post("/operability/deploy/step", "", kForm);
|
||||
check(contains(f.client->get("/operability/deploy").body, "v2,v1,v1,v1"), "one instance replaced");
|
||||
auto again = f.client->post("/operability/deploy/start", "strategy=rolling", kForm);
|
||||
check(contains(again.body, "already in progress"), "second rollout refused");
|
||||
auto rb = f.client->post("/operability/deploy/rollback", "", kForm);
|
||||
check(contains(rb.body, "v1,v1,v1,v1") && contains(rb.body, "rolled back"), "rollback restores fleet");
|
||||
f.client->post("/operability/deploy/start", "strategy=bluegreen&version=v3", kForm);
|
||||
f.client->post("/operability/deploy/step", "", kForm);
|
||||
check(contains(f.client->get("/operability/deploy").body, "v1,v1,v1,v1"), "green prepared, blue serves");
|
||||
f.client->post("/operability/deploy/step", "", kForm);
|
||||
auto done = f.client->get("/operability/deploy");
|
||||
check(contains(done.body, "v3,v3,v3,v3") && contains(done.body, "done"), "switched");
|
||||
auto bad = f.client->post("/operability/deploy/start", "strategy=canary", kForm);
|
||||
check(bad.status == 422 && contains(bad.body, "must be one of: rolling, bluegreen"), "422 unknown strategy");
|
||||
return finish("operability/deploy");
|
||||
}
|
||||
Reference in New Issue
Block a user