Open sabledb-io opened 2 weeks ago
The approach here is using Rust
itself to test the code.
Been adding new API:
// Create shard of 3 instances: 1 primary + 2 replicas
let shard = shard::start_shard(3).unwrap();
// Use `shard` (of type `Shard`) to access the shard nodes
// Connect to the primary node
let mut conn = shard.primary().borrow().connect().unwrap();
// Call 'set hello world'
let res: redis::Value = conn.set("hello", "world").unwrap();
assert_eq!(res, redis::Value::Okay);
The current code is tested extensively with roughly 300 tests, however, these tests are focused on the data path and data integrity.
Logic for managing replication and automatic failover is tested manually. This needs to be changed. Adding a testing framework using scripting language (python?) could be very beneficial and increase the resilience of the code