Files
moloapp/tests/example/operability/debug_test.cpp
T

22 lines
1.0 KiB
C++
Raw Normal View History

// Route: /operability/debug (snapshot of every lab)
#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;
f.client->post("/operability/slo/bad", "", kForm);
auto res = f.client->get("/operability/debug");
check(res.status == 200, "status 200");
check(contains(res.headers.get("Content-Type"), "application/json"), "json");
check(contains(res.body, "\"labs\""), "labs object");
for (const char* n : {"breaker", "bulkhead", "shedder", "deadline", "slo", "chaos", "deploy", "coord", "supplychain", "client-retry", "client-session", "migrations", "transaction", "query", "singleflight", "ttl"})
check(contains(res.body, std::string("\"") + n + "\":{"), std::string("lab present: ") + n);
check(contains(res.body, "bad event"), "side effect: earlier action visible in log");
check(f.client->post("/operability/debug", "", kForm).status == 405, "405 on post");
return finish("operability/debug");
}