From 497b3093790cafb32428af8f4c7802f9d567d3c1 Mon Sep 17 00:00:00 2001 From: Raycho Mukelov Date: Fri, 1 Sep 2023 02:14:45 +0300 Subject: [PATCH] Add extended test scaffold for Basic Raft Cluster --- all_test.md | 3 +++ tests/test_basic_cluster.nim | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 all_test.md diff --git a/all_test.md b/all_test.md new file mode 100644 index 0000000..17e4d94 --- /dev/null +++ b/all_test.md @@ -0,0 +1,3 @@ +* testbasictimers - 503 milliseconds, 739 microseconds, and 790 nanoseconds +* testbasicstatemachine - 1 millisecond, 551 microseconds, and 593 nanoseconds +* testbasiccluster - 1 millisecond, 333 microseconds, and 100 nanoseconds diff --git a/tests/test_basic_cluster.nim b/tests/test_basic_cluster.nim index b4b6110..dfe2e18 100644 --- a/tests/test_basic_cluster.nim +++ b/tests/test_basic_cluster.nim @@ -17,11 +17,24 @@ proc basicClusterMain*() = suite "Basic Raft Cluster Tests": - test "Test Basic Raft Cluster Init (5 nodes)": + test "Basic Raft Cluster Init (5 nodes)": for i in 0..4: nodesIds[i] = genUUID() cluster = BasicRaftClusterInit(nodesIds) + check cluster.nodes.len == 5 + + test "Generate Random Client SmCommands Queue": + discard + + test "Start Basic Raft Cluster And wait it to converge (Elect a Leader)": + discard + + test "Simulate Basic Raft Cluster Client SmCommands Execution / Log Replication": + discard + + test "Evaluate results": + discard if isMainModule: basicClusterMain() \ No newline at end of file