-
Notifications
You must be signed in to change notification settings - Fork 26
feat(test): add redis tcl test #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds TCL test files for Arana/Kiwi, a Redis-compatible database implementation. The changes consist entirely of new test files covering various Redis data types and functionality including strings, lists, sets, hashes, sorted sets, and various Redis features like replication, scripting, pub/sub, and more.
Key changes:
- New comprehensive test suite for Redis-compatible functionality
- Tests adapted from Redis with modifications for Arana/Kiwi compatibility
- Many tests are commented out where Arana/Kiwi doesn't support certain Redis features
Reviewed Changes
Copilot reviewed 68 out of 70 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/tcl/tests/unit/type/zset.tcl | Sorted set (zset) data type tests |
| tests/tcl/tests/unit/type/string.tcl | String operations and commands tests |
| tests/tcl/tests/unit/type/set.tcl | Set data type tests |
| tests/tcl/tests/unit/type/list.tcl | List data type tests with various encodings |
| tests/tcl/tests/unit/type/list-common.tcl | Common list test utilities |
| tests/tcl/tests/unit/type/list-3.tcl | Additional list encoding tests |
| tests/tcl/tests/unit/type/list-2.tcl | List stress testing |
| tests/tcl/tests/unit/type/hash.tcl | Hash data type tests |
| tests/tcl/tests/unit/type.tcl | Basic type command tests |
| tests/tcl/tests/unit/tcl/replication*.tcl | Replication functionality tests |
| tests/tcl/tests/unit/tcl/redis-cli.tcl | Redis CLI tests |
| tests/tcl/tests/unit/tcl/rdb.tcl | RDB persistence tests |
| tests/tcl/tests/unit/tcl/convert-zipmap-hash-on-load.tcl | Hash encoding conversion tests |
| tests/tcl/tests/unit/tcl/aof*.tcl | AOF persistence tests |
| tests/tcl/tests/unit/sort.tcl | SORT command tests |
| tests/tcl/tests/unit/slowlog.tcl | Slowlog functionality tests |
| tests/tcl/tests/unit/scripting.tcl | Lua scripting tests |
| tests/tcl/tests/unit/scan.tcl | SCAN command tests |
| tests/tcl/tests/unit/quit.tcl | QUIT command tests |
| tests/tcl/tests/unit/pubsub.tcl | Pub/Sub functionality tests |
| tests/tcl/tests/unit/protocol.tcl | Protocol handling tests |
| tests/tcl/tests/unit/printver.tcl | Version printing utility |
| tests/tcl/tests/unit/other.tcl | Miscellaneous tests |
| tests/tcl/tests/unit/obuf-limits.tcl | Output buffer limits tests |
| tests/tcl/tests/unit/multi.tcl | MULTI/EXEC transaction tests |
| tests/tcl/tests/unit/limits.tcl | Connection limits tests |
| tests/tcl/tests/tmp/.gitignore | Gitignore for temporary test files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if {$maxinc} {set cmax "\[$max"} else {set cmax "($max"} | ||
| set rev [randomInt 2] | ||
| if {$rev} { | ||
| break |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect indentation: uses tabs instead of spaces. This line has inconsistent whitespace with the rest of the file which uses spaces for indentation.
| # partial resyncs attempts, all this while flooding the master with | ||
| # write queries. | ||
| # | ||
| # You can specifiy backlog size, ttl, delay before reconnection, test duration |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'specifiy' to 'specify'.
| } | ||
|
|
||
| test "Test replication partial resync: $descr" { | ||
| # Now while the clients are writing data, break the maste-slave |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'maste-slave' to 'master-slave'.
| s 0 role | ||
| } {slave} | ||
|
|
||
| test {Test replication with parallel clients writing in differnet DBs} { |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'differnet' to 'different'.
| test {MASTER and SLAVE consistency with expire} { | ||
| createComplexDataset r $numops useexpire | ||
| after 4000 ;# Make sure everything expired before taking the digest | ||
| r keys * ;# Force DEL syntesizing to slave |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'syntesizing' to 'synthesizing'.
|
|
||
| # test {EXEC fail on WATCHed key modified by SORT with STORE even if the result is empty} { | ||
| # r flushdb | ||
| # r lpush foo barsync" |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unclosed string literal. The line appears to have a misplaced or incomplete string with 'barsync"'. This would cause a syntax error.
| a['x'] = b | ||
| local encoded = cmsgpack.pack(a) | ||
| local h = "" | ||
| -- cmsgpack encodes to a depth of 16, but can't encode |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'recusive' to 'recursive' (appears later in line 233 context).
| if n <= 10: | ||
| time.sleep(0.1) | ||
| continue | ||
| res = client.zremrangebyrank(queue_name, 0, 9) |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable res is not used.
| res = client.zremrangebyrank(queue_name, 0, 9) | |
| client.zremrangebyrank(queue_name, 0, 9) |
添加TCL测试,目前很多命令没有实现,所以无法跑通,先把文件提上来