This commit is contained in:
2026-08-12 09:45:18 +08:00
parent 9331b4cbf6
commit 0910b73ea4
22 changed files with 439 additions and 98 deletions
+48 -1
View File
@@ -232,7 +232,7 @@ TEST(RenderiveWebGallery, AdminiveCatalogCoversEveryControlCaseAndThreeModes) {
TEST(RenderiveWebGallery, CatalogOwnsDashboardFieldsAndDynamicBehavior) {
const nlohmann::json catalog = parse_json(Gallery_Protocol::catalog_json());
const auto& dashboard = catalog.at("dashboard");
EXPECT_EQ(dashboard.at("performance").at("fields").size(), 15U);
EXPECT_EQ(dashboard.at("performance").at("fields").size(), 22U);
EXPECT_EQ(dashboard.at("limits").at("fields").size(), 4U);
EXPECT_EQ(dashboard.at("observer").at("sections").size(), 4U);
std::set<std::string> client_sources;
@@ -291,6 +291,13 @@ TEST(RenderiveWebGallery, ObserverTelemetryAndDashboardUseAdminiveDescriptors) {
for (const auto& field : feedback_descriptor.at("fields"))
EXPECT_TRUE(feedback.contains(field.at("name").get<std::string>()));
EXPECT_EQ(observer.at("mode"), "manual");
EXPECT_GT(observer.at("task_worker_count").get<std::size_t>(), 0U);
EXPECT_TRUE(observer.contains("task_execution_state"));
EXPECT_TRUE(observer.contains("task_graph_node_count"));
EXPECT_TRUE(observer.contains("task_running_node_count"));
EXPECT_TRUE(observer.contains("task_pending_node_count"));
EXPECT_TRUE(observer.contains("task_peak_parallelism"));
EXPECT_TRUE(observer.contains("task_graph_duration_ns"));
EXPECT_FALSE(telemetry.contains("low_latency_limit"));
}
@@ -344,6 +351,13 @@ TEST(RenderiveWebGallery, AdminiveResourcesPatchTheRealRenderableState) {
EXPECT_EQ(spectrum.at("descriptor").at("name"), "spectrum");
EXPECT_TRUE(spectrum.at("data").at("frequency_range").is_object());
EXPECT_EQ(spectrum.at("data").at("frequency_point_size"), 512);
const auto partition_field = std::find_if(
spectrum.at("descriptor").at("fields").begin(),
spectrum.at("descriptor").at("fields").end(),
[](const auto& field) { return field.at("name") == "partition_count"; });
ASSERT_NE(partition_field, spectrum.at("descriptor").at("fields").end());
EXPECT_EQ(partition_field->at("presentation").at("description"),
"0 = automatic, 1 = single task, N = N parallel partitions");
response = response_json(session.handle(gallery_request(
Gallery_Request_Kind::Patch,
@@ -367,6 +381,39 @@ TEST(RenderiveWebGallery, AdminiveResourcesPatchTheRealRenderableState) {
EXPECT_EQ(foreign.at("type"), "error");
}
TEST(RenderiveWebGallery, PartitionControlRebuildsTheObservedTaskGraph) {
Gallery_Plot_Session session;
ASSERT_EQ(response_json(session.handle(gallery_request(
Gallery_Request_Kind::Open,
open_message("spectrum", "manual")))).at("type"),
"case_state");
const auto render = [&session] {
EXPECT_EQ(invoke_action(session, "mode_prepare").at("type"), "case_state");
EXPECT_EQ(invoke_action(session, "mode_refresh").at("type"), "case_state");
return invoke_action(session, "mode_render").at("telemetry").at("kernel_observer");
};
ASSERT_EQ(patch_controls(session, {{"partition_count", 1}}, "spectrum").at("type"),
"case_state");
const auto single = render();
EXPECT_EQ(single.at("task_execution_state"), "Completed");
EXPECT_EQ(single.at("task_completed_node_count"),
single.at("task_graph_node_count"));
EXPECT_EQ(single.at("task_running_node_count"), 0);
EXPECT_EQ(single.at("task_pending_node_count"), 0);
ASSERT_EQ(patch_controls(session, {{"partition_count", 4}}, "spectrum").at("type"),
"case_state");
const auto partitioned = render();
EXPECT_EQ(partitioned.at("task_graph_node_count").get<std::size_t>(),
single.at("task_graph_node_count").get<std::size_t>() + 3U);
EXPECT_EQ(partitioned.at("task_completed_node_count"),
partitioned.at("task_graph_node_count"));
EXPECT_GT(partitioned.at("task_peak_parallelism").get<std::size_t>(), 0U);
EXPECT_GT(partitioned.at("task_graph_duration_ns").get<std::uint64_t>(), 0U);
}
TEST(RenderiveWebGallery, AxisSwapAndEveryPlotDirectionAreEditableAndRenderable) {
const auto patch = [](Gallery_Plot_Session& session, std::string_view target,
nlohmann::json value) {