Skip to content
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

refactore: Move test to seprate module to can be run separetly #441

Open
wants to merge 3 commits into
base: unstable
Choose a base branch
from

Conversation

aliraad79
Copy link

Hi, I think this will help with #428 merge request.
This is my first merge request on this repo and any comment is helpful for me.
Thank you in advance.
Fix #428

kaf.ahmadi added 2 commits May 5, 2024 12:22
Signed-off-by: aliraad79 <a.ahmadi.k.79@gmail.com>
Signed-off-by: aliraad79 <a.ahmadi.k.79@gmail.com>
Copy link

codecov bot commented May 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.45%. Comparing base (9ebbd5f) to head (bac2529).
Report is 6 commits behind head on unstable.

❗ Current head bac2529 differs from pull request most recent head ebe3eb3. Consider uploading reports for the commit ebe3eb3 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable     #441      +/-   ##
============================================
+ Coverage     68.40%   68.45%   +0.04%     
============================================
  Files           109      109              
  Lines         61673    61673              
============================================
+ Hits          42189    42219      +30     
+ Misses        19484    19454      -30     
Files Coverage Δ
deps/hiredis/sds.h 46.87% <ø> (ø)
src/dict.c 96.93% <ø> (ø)
src/endianconv.c 47.22% <ø> (ø)
src/kvstore.c 96.40% <ø> (ø)
src/listpack.c 90.05% <ø> (ø)
src/quicklist.c 83.94% <ø> (ø)
src/sds.c 86.91% <ø> (ø)
src/sds.h 74.73% <ø> (ø)
src/server.c 88.12% <ø> (ø)
src/sha1.c 98.66% <ø> (ø)
... and 4 more

... and 12 files with indirect coverage changes

@madolson
Copy link
Member

madolson commented May 6, 2024

Thanks for helping, it looks like some of the tests are failing. Did you run:

make valkey-unit-tests
./src/valkey-unit-tests 

To make sure they all run?

@aliraad79
Copy link
Author

No i don't do that. I fix the tests and push it again.

Signed-off-by: aliraad79 <a.ahmadi.k.79@gmail.com>
@aliraad79
Copy link
Author

Hi. I fix some problems but there is some bigger problems.
for test_dict for example we want to use dict_force_resize_ratio variable but it is declared in .c file and not in header. What should i do? can i move this thing to header or there is a trick to include this type of thing only in test?
another problem is that some functions and # defines are also in .c file.

@madolson
Copy link
Member

for test_dict for example we want to use dict_force_resize_ratio variable but it is declared in .c file and not in header. What should i do? can i move this thing to header or there is a trick to include this type of thing only in test?
another problem is that some functions and # defines are also in .c file.

For other tests like listpack we've just been including the .c file. Since some other folks have already ported some of the other tests, do you mind just re-submitting the PR just for the dict.c test case? It's a bit easier to merge as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate unit tests to new framework
2 participants