feat: filter daemon actions by kind; show registry release detail
This commit is contained in:
1 parent
624016d904
commit
691560a369
11 files changed
+228
-21
No files matched your search
+25
-2
@@ -1460,8 +1460,13 @@ void build(Void::Build::Project &project) {
|
||||
|
||||
auto listed =
|
||||
request_object(socket, R"({"op":"actions","limit":5})", std::chrono::seconds{120});
|
||||
auto filtered =
|
||||
request_object(socket, R"({"op":"actions","target":"nope"})", std::chrono::seconds{120});
|
||||
auto filtered = request_object(socket, R"({"op":"actions","target":"nope"})",
|
||||
std::chrono::seconds{120});
|
||||
auto by_kind = request_object(socket, R"({"op":"actions","kind":"link"})",
|
||||
std::chrono::seconds{120});
|
||||
auto unknown_kind = request_object(socket, R"({"op":"actions","kind":"nope"})",
|
||||
std::chrono::seconds{120});
|
||||
auto invalid_kind = request_object(socket, R"({"op":"actions","kind":5})");
|
||||
auto invalid = request_object(socket, R"({"op":"actions","limit":1001})");
|
||||
auto shutdown = Void::Build::Daemon::request(socket, R"({"op":"shutdown"})");
|
||||
Void::Testing::expect(shutdown.has_value());
|
||||
@@ -1485,6 +1490,24 @@ void build(Void::Build::Project &project) {
|
||||
Void::Testing::require(filtered.has_value());
|
||||
Void::Testing::expect(bool_field(*filtered, "ok"));
|
||||
Void::Testing::expect_eq(int_field(*filtered, "total"), std::int64_t{0});
|
||||
|
||||
Void::Testing::require(by_kind.has_value());
|
||||
Void::Testing::expect(bool_field(*by_kind, "ok"));
|
||||
Void::Testing::expect(int_field(*by_kind, "total") >= 1);
|
||||
const auto *kind_actions = field(*by_kind, "actions");
|
||||
Void::Testing::require(kind_actions != nullptr);
|
||||
const auto *kind_array = std::get_if<JsonValue::Array>(&kind_actions->value);
|
||||
Void::Testing::require(kind_array != nullptr);
|
||||
for (const auto &item : *kind_array) {
|
||||
const auto *entry = std::get_if<JsonObject>(&item.value);
|
||||
Void::Testing::require(entry != nullptr);
|
||||
Void::Testing::expect_eq(str_field(*entry, "kind"), std::string{"link"});
|
||||
}
|
||||
Void::Testing::require(unknown_kind.has_value());
|
||||
Void::Testing::expect_eq(int_field(*unknown_kind, "total"), std::int64_t{0});
|
||||
Void::Testing::require(invalid_kind.has_value());
|
||||
Void::Testing::expect(!bool_field(*invalid_kind, "ok", true));
|
||||
|
||||
Void::Testing::require(invalid.has_value());
|
||||
Void::Testing::expect(!bool_field(*invalid, "ok", true));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user