This commit is contained in:
2026-08-12 11:03:16 +08:00
parent 0910b73ea4
commit 898a58b554
18 changed files with 521 additions and 277 deletions
+21 -5
View File
@@ -276,6 +276,8 @@ TEST(RenderiveWebGallery, ObserverTelemetryAndDashboardUseAdminiveDescriptors) {
const auto& observer_descriptor = observer_contract.at("descriptor");
const auto& feedback_descriptor =
observer_contract.at("consumer_feedback_descriptor");
EXPECT_EQ(observer_descriptor.at("label"), "内核观察器");
EXPECT_EQ(feedback_descriptor.at("label"), "消费者反馈");
Gallery_Plot_Session session;
const auto opened = response_json(session.handle(gallery_request(
@@ -356,16 +358,26 @@ TEST(RenderiveWebGallery, AdminiveResourcesPatchTheRealRenderableState) {
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("label"), "固定分区数");
EXPECT_EQ(partition_field->at("presentation").at("description"),
"0 = automatic, 1 = single task, N = N parallel partitions");
"固定模式下的并行任务数;1 表示不分区");
const auto partition_mode_field = std::find_if(
spectrum.at("descriptor").at("fields").begin(),
spectrum.at("descriptor").at("fields").end(),
[](const auto& field) { return field.at("name") == "partition_mode"; });
ASSERT_NE(partition_mode_field, spectrum.at("descriptor").at("fields").end());
EXPECT_EQ(partition_mode_field->at("presentation").at("label"), "任务分区模式");
EXPECT_EQ(spectrum.at("descriptor").at("label"), "实时频谱");
response = response_json(session.handle(gallery_request(
Gallery_Request_Kind::Patch,
R"({"category":"event","type":"gallery_patch","target":"spectrum","patch":{"frequency_point_size":1024,"partition_count":4,"frequency_range":{"origin":90000000},"current_pen":{"color":"#ff8844"},"interpolation_mode":"Cubic_Value"}})")));
R"({"category":"event","type":"gallery_patch","target":"spectrum","patch":{"frequency_point_size":1024,"partition_mode":"Fixed","partition_count":4,"frequency_range":{"origin":90000000},"current_pen":{"color":"#ff8844"},"interpolation_mode":"Cubic_Value"}})")));
ASSERT_EQ(response.at("type"), "case_state");
const auto& updated = find_resource(response, "spectrum").at("data");
EXPECT_EQ(updated.at("frequency_point_size"), 1024);
EXPECT_EQ(updated.at("partition_count"), 4);
EXPECT_EQ(updated.at("partition_mode"), "Fixed");
EXPECT_EQ(updated.at("frequency_range").at("origin"), 90'000'000);
EXPECT_EQ(updated.at("current_pen").at("color"), "#ff8844");
EXPECT_EQ(updated.at("interpolation_mode"), "Cubic_Value");
@@ -394,7 +406,9 @@ TEST(RenderiveWebGallery, PartitionControlRebuildsTheObservedTaskGraph) {
return invoke_action(session, "mode_render").at("telemetry").at("kernel_observer");
};
ASSERT_EQ(patch_controls(session, {{"partition_count", 1}}, "spectrum").at("type"),
ASSERT_EQ(patch_controls(session,
{{"partition_mode", "Fixed"}, {"partition_count", 1}},
"spectrum").at("type"),
"case_state");
const auto single = render();
EXPECT_EQ(single.at("task_execution_state"), "Completed");
@@ -448,7 +462,8 @@ TEST(RenderiveWebGallery, AxisSwapAndEveryPlotDirectionAreEditableAndRenderable)
{{"orientation", "Horizontal"},
{"coordinates", {{"origin", -20.0}, {"target", -120.0}}}});
ASSERT_EQ(state.at("type"), "case_state");
state = patch(session, case_id, {{"partition_count", 4}});
state = patch(session, case_id,
{{"partition_mode", "Fixed"}, {"partition_count", 4}});
ASSERT_EQ(state.at("type"), "case_state");
EXPECT_EQ(resource_data(state, "frequency_axis").at("orientation"), "Vertical");
EXPECT_EQ(resource_data(state, "value_axis").at("orientation"), "Horizontal");
@@ -467,7 +482,8 @@ TEST(RenderiveWebGallery, AxisSwapAndEveryPlotDirectionAreEditableAndRenderable)
state = patch(waterfall, "time_axis",
{{"orientation", "Horizontal"}, {"newest_at_start", true}});
ASSERT_EQ(state.at("type"), "case_state");
state = patch(waterfall, "waterfall", {{"partition_count", 4}});
state = patch(waterfall, "waterfall",
{{"partition_mode", "Fixed"}, {"partition_count", 4}});
ASSERT_EQ(state.at("type"), "case_state");
EXPECT_EQ(resource_data(state, "frequency_axis").at("orientation"), "Vertical");
EXPECT_EQ(resource_data(state, "time_axis").at("orientation"), "Horizontal");