Extend dummy test

This commit is contained in:
Marko Budiselic 2023-03-14 12:07:47 +00:00
parent f42bd3237e
commit 491b651dcb
2 changed files with 12 additions and 19 deletions

View File

@ -405,8 +405,8 @@ class RequestRouter : public RequestRouterInterface {
}
std::vector<msgs::GraphResponse> GetGraph(msgs::GraphRequest req) override {
LOG_FATAL("Implement GetGraph request");
return {};
SPDLOG_WARN("RequestRouter::GetGraph(GraphRequest) not fully implemented");
return {msgs::GraphResponse{}};
}
std::optional<storage::v3::PropertyId> MaybeNameToProperty(const std::string &name) const override {

View File

@ -44,40 +44,23 @@ using CompoundKey = coordinator::PrimaryKey;
using coordinator::Coordinator;
using coordinator::CoordinatorClient;
using coordinator::CoordinatorRsm;
using coordinator::HlcRequest;
using coordinator::HlcResponse;
using coordinator::ShardMap;
using coordinator::ShardMetadata;
using coordinator::Shards;
using coordinator::Status;
using io::Address;
using io::Io;
using io::ResponseEnvelope;
using io::ResponseFuture;
using io::Time;
using io::TimedOut;
using io::rsm::Raft;
using io::rsm::ReadRequest;
using io::rsm::ReadResponse;
using io::rsm::StorageReadRequest;
using io::rsm::StorageReadResponse;
using io::rsm::StorageWriteRequest;
using io::rsm::StorageWriteResponse;
using io::rsm::WriteRequest;
using io::rsm::WriteResponse;
using io::simulator::Simulator;
using io::simulator::SimulatorConfig;
using io::simulator::SimulatorStats;
using io::simulator::SimulatorTransport;
using msgs::CreateVerticesRequest;
using msgs::CreateVerticesResponse;
using msgs::ScanVerticesRequest;
using msgs::ScanVerticesResponse;
using msgs::VertexId;
using storage::v3::LabelId;
using storage::v3::SchemaProperty;
using storage::v3::tests::MockedShardRsm;
using utils::BasicResult;
namespace {
@ -234,6 +217,15 @@ void TestGetProperties(query::v2::RequestRouterInterface &request_router) {
template <typename RequestRouter>
void TestAggregate(RequestRouter &request_router) {}
void TestGetGraph(query::v2::RequestRouterInterface &rr) {
msgs::GraphRequest req;
auto graphs = rr.GetGraph(req);
MG_ASSERT(graphs.size() == 1);
auto graph = graphs[0];
MG_ASSERT(graph.data.vertices.size() == 0);
MG_ASSERT(graph.data.edges.size() == 0);
}
void DoTest() {
SimulatorConfig config{
.drop_percent = 0,
@ -356,6 +348,7 @@ void DoTest() {
TestCreateVertices(request_router);
TestCreateExpand(request_router);
TestGetProperties(request_router);
TestGetGraph(request_router);
simulator.ShutDown();