-
Notifications
You must be signed in to change notification settings - Fork 691
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
Add tests for src/module examples #1407
base: unstable
Are you sure you want to change the base?
Conversation
ac7ae7b
to
b6a286e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## unstable #1407 +/- ##
============================================
+ Coverage 70.78% 70.85% +0.07%
============================================
Files 118 118
Lines 63561 63561
============================================
+ Hits 44994 45039 +45
+ Misses 18567 18522 -45 |
b6a286e
to
377c983
Compare
|
||
assert_match [r hello.leftpad td 4 0] "00td" | ||
} | ||
} |
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.
please also do a module unload in the end
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.
When I try to unload hellotype module, I found there is only VM_CreateDataType
function, why don't have any function to delete it? So that I can't unload hellotype module, because of ERR Error unloading module: the module exports one or more module-side data types can't unload.
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.
i think u can skip unload hello_type module
324242e
to
19c8ddb
Compare
Signed-off-by: Codebells <[email protected]>
19c8ddb
to
aeb2109
Compare
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.
Thanks for the contribution. I'm sort of skeptical of maintaining these src modules at all. They originally existed because we didn't have module API tests. I think now that we have module API tests, we should move all of the references to those test modules.
OK,I will move src/modules to test/modules, so we can maintain all these modules in test/modules. |
i think we should either to keep it as a demo module that can guaid people to write the special type module. Or we should just remove it from the code. i think all the content in src/modules are cover by test/modules, we don't need to keep src/modules in the test folder. |
I think that is more what the module API reference is for https://valkey.io/topics/modules-api-ref. I know Redis had an SDK repo as well for modules, maybe we have a module example repo? If we make a module example repo, I would also like to raise the quality of the modules, because I think they're a bit hacky today. |
We need to make a dicision on whether to delete or keep these files. No matter how we deal with these files, we should test command to avoid the problem in hellodict happen again. I think use the function |
We found there is coredump in hellodict #1395 , and there is no tcl test for these example modules.
check_commands_specs
to check command bycommand getkeys
.command getkeys
, except the following two kind of command.CMD_KEY_NOT_KEY
xread
.I recommand all module's tcl test to add this function to check command.