Commit Graph

97 Commits

Author SHA1 Message Date
Kelvin Clement Mwinuka
393700b71d Updated TLS/mTLS listener log 2024-05-31 19:47:11 +08:00
Kelvin Clement Mwinuka
3bd09ab376 Added test coverage for empty command and write command to non-leader node 2024-05-31 19:31:08 +08:00
Kelvin Clement Mwinuka
5de2cc8a53 Admin tests are no longer parallel as module loading interferes with other test results. ForwardCommand test now retries until all values are found in a quorum or a 5 second limit is reached. 2024-05-31 18:55:50 +08:00
Kelvin Clement Mwinuka
b48ee54228 Updated test suites to retry connection to tcp server. Use concurrency to setup cluster in Test_Cluster suite. 2024-05-31 18:17:36 +08:00
Kelvin Clement Mwinuka
502e804459 Removed logic to get unexported methods from the echovault package in all tests. 2024-05-30 19:33:01 +08:00
Kelvin Clement Mwinuka
e1d5e8203f Disabled cluster test until a more efficient method is found. 2024-05-29 23:15:27 +08:00
Kelvin Clement Mwinuka
e8840cbc35 Added test for forward command 2024-05-29 19:04:40 +08:00
Kelvin Clement Mwinuka
ae5a675929 Added test for TLS connection 2024-05-29 15:08:41 +08:00
Kelvin Clement Mwinuka
06ce6bfeaf Instead of checking if a value is replicated across the entire cluster, only check if it's present in a cluster quorum. Fixed race conditions in pubsub API by replacing connections map with sync.Map 2024-05-28 20:26:03 +08:00
Kelvin Clement Mwinuka
7691ec432d Added test coverave for sorted set api methods 2024-05-28 16:49:40 +08:00
Kelvin Clement Mwinuka
bb667cf7f7 Added test coverave + fixed some bugs with pubsub api methods. 2024-05-27 18:48:08 +08:00
Kelvin Clement Mwinuka
30b8b205a7 Implemented tests for api_acl.go file 2024-05-27 15:50:25 +08:00
Kelvin Clement Mwinuka
7807569975 Created MakeCluster function to reuse logic for creating clusters. Created test files in raft and memberlist packages to add them to test coverage statistics. 2024-05-27 13:10:26 +08:00
Kelvin Clement Mwinuka
0108444d69 Replaced fmt.Println statements with log.Println.
Return "empty command" error from handleCommand method if an empty command is passed to the server.
Wait until connection is no longer nil in acl package tests.
2024-05-27 11:45:48 +08:00
Kelvin Clement Mwinuka
9904fcdbb7 Wait for cluster followers to join cluster before proceeding with raft test in echovault package. 2024-05-27 11:12:34 +08:00
Kelvin Clement Mwinuka
93a616c5c1 Updated RAFT layer to use new keyspace methods. Fixed API methods for HSET and SINTERCARD to match new key overwriting behaviour. 2024-05-26 15:49:51 +08:00
Kelvin Clement Mwinuka
abee9ea858 Uncommented AddCommand method 2024-05-26 15:26:04 +08:00
Kelvin Clement Mwinuka
15191dccee Implemented new param methods and testing through resp connection in set commands package 2024-05-26 08:41:29 +08:00
Kelvin Clement Mwinuka
43361cdd42 Updated keyspace methods' signatures and made them all private. Ditched lock-per-key for a store-wide rwmutex. Updated HandlerFuncParams to match new keyspace method signatures. 2024-05-22 22:44:59 +08:00
Kelvin Clement Mwinuka
f894a531b0 Added happy path test case for data replication 2024-05-22 16:11:00 +08:00
Kelvin Clement Mwinuka
a9c11adcd6 Fixed users unlock in ACL LOAD command handler 2024-05-19 04:28:06 +08:00
Kelvin Clement Mwinuka
c634b1b20e Return ok boolean instead of OK string in embedded api methods that return ok status. Updated tests to match new return types 2024-05-18 22:49:21 +08:00
Kelvin Clement Mwinuka
7fb236e631 Added HGet to embedded API 2024-05-14 03:30:51 +08:00
Kelvin Clement Mwinuka
aa7b5fa8cc Added ZRemRangeByLex and ZRemRangeByRank to embedded API. 2024-05-14 02:11:10 +08:00
Kelvin Clement Mwinuka
26a709a469 Added test case for command handler in modules test in api_admin 2024-05-09 02:24:01 +08:00
Kelvin Clement Mwinuka
1981fe9d1d Added unit tests for COMMAND COUNT and COMMAND LIST commands in admin module 2024-05-09 02:06:31 +08:00
Kelvin Clement Mwinuka
df51142217 Implemented test for LoadModule, ListModules, and UnloadModule. Added check for existence of module file using os.Stat before attempting to open the file. Added build-module-tests step in makefile to simplify building modules for unit and race tests 2024-05-09 01:36:52 +08:00
Kelvin Clement Mwinuka
cfa8e35997 Use path.Join instead of hardcoded path to load mdules in admin tests. 2024-05-09 00:05:01 +08:00
Kelvin Clement Mwinuka
ba48a517e4 Re-enabled cleanup of testdata folder after completing Test_AdminCommand suite 2024-05-08 23:54:31 +08:00
Kelvin Clement Mwinuka
63524c0996 Fixed type in admin module test file 2024-05-08 23:20:23 +08:00
Kelvin Clement Mwinuka
d28bda98bb Added makefile command to build modules for admins module tests.
Implemented more sensible logic for testing the COMMANDS command instead of just printing each returned command.
Implemented tests for MODULE LOAD, MODULE UNLOAD, and MODULE LIST commands.
Implemented testdata folder cleanup after finishing admin command tests.
2024-05-08 23:17:45 +08:00
Kelvin Clement Mwinuka
291d4e9451 Added makefile command to compile .so modules for testing in admin module 2024-05-08 18:33:46 +08:00
Kelvin Clement Mwinuka
229b10863f Fixed data race in snapshot engine and lfu cache test 2024-05-06 17:22:08 +08:00
Kelvin Clement Mwinuka
040f246ea2 Implemented test for LRU cache implementation 2024-05-06 17:16:33 +08:00
Kelvin Clement Mwinuka
028fb7ccdf Updated expired entry filter function to accept time boundary 'now'. Implemented tests for snapshot package 2024-05-06 14:35:55 +08:00
Kelvin Clement Mwinuka
915c34d9f6 Refactored Write function of append store to use tidwall/resp to parse commands.
AOF log no longer prints an empty line between each command.
Return error on NewAppendStore instead of just logging.
Implemented test for AppendStore
2024-05-04 22:27:05 +08:00
Kelvin Clement Mwinuka
193871ec72 Removed test folder and moved all commands tests to their respective internal modules. Moved api tests into echovault package. This change has been made because the speratate test folder is not idiomatic and caused test coverage report to not be generated. 2024-05-04 17:45:10 +08:00
Kelvin Clement Mwinuka
3e04b7a822 Moved tests for module commands and apis into 'test' folder 2024-04-24 21:36:59 +08:00
Kelvin Clement Mwinuka
fce0258e53 Added embedded parameter in handleCommand method which will cause handleCommand to skip ACL auth when it's true 2024-04-21 03:48:14 +08:00
Kelvin Clement Mwinuka
c2c887cd75 Updated KeyExtractionFunc for all the modules 2024-04-21 02:59:07 +08:00
Kelvin Clement Mwinuka
be44d23c47 Commend refactoring in pubsub module. Variable renaming in api_pubsub.go 2024-04-20 22:40:18 +08:00
Kelvin Mwinuka
64bbda6205 wg.Done intead of wg.Add in goroutine that starts server in pubusub test module init function 2024-04-06 02:37:44 +08:00
Kelvin Mwinuka
16743a36df Implemented t.Run in generic, hash, list, and set module tests 2024-04-06 02:21:29 +08:00
Kelvin Mwinuka
7a77d4fd81 Leverage t.Run for sorted_set module tests 2024-04-06 00:24:04 +08:00
Kelvin Mwinuka
9df42f2179 Leverage t.Run in string module tests 2024-04-05 23:23:14 +08:00
Kelvin Mwinuka
3bf9e25002 Fixed race conditions in acl module tests 2024-04-05 23:05:23 +08:00
Kelvin Mwinuka
25ffb3004c Added waitgroup for control flow on acl tests 2024-04-05 03:27:48 +08:00
Kelvin Mwinuka
1e421cb64a Implemented a Clock interface that is injected everywhere time.Now and time.After are used. 2024-04-05 03:11:03 +08:00
Kelvin Mwinuka
6e510976fb Removed timeNow implementation in generic module. This will be replaced by a mock implementation of the time interface 2024-04-05 01:06:57 +08:00
Kelvin Mwinuka
72e1445ee8 Updated test coverage 2024-04-04 23:43:25 +08:00