Support ZRANK and ZREVRANK: Added the optional WITHSCORE argument
Description
Describe your pull request here
Checklist
- [ ] Does
npm testpass with this change (including linting)? - [ ] Is the new or changed code fully tested?
- [ ] Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
fix https://github.com/redis/node-redis/issues/2463 and https://github.com/redis/node-redis/issues/2464
@codrin-ch thanks for contributing!
The WITHSCORE argument should be implemented as a separate command since it has other return type (ZRANK_WITHSCORE and ZREVRANK_WITHSCORE). See ZDIFF_WITHSCORES for example.
Codecov Report
Patch coverage: 83.33% and project coverage change: -0.08% :warning:
Comparison is base (
a217cc1) 95.71% compared to head (25939e5) 95.64%. Report is 1 commits behind head on master.
:exclamation: Current head 25939e5 differs from pull request most recent head d2dbea6. Consider uploading reports for the commit d2dbea6 to get more accurate results
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## master #2489 +/- ##
==========================================
- Coverage 95.71% 95.64% -0.08%
==========================================
Files 458 460 +2
Lines 4531 4543 +12
Branches 506 506
==========================================
+ Hits 4337 4345 +8
- Misses 127 131 +4
Partials 67 67
| Files Changed | Coverage Δ | |
|---|---|---|
| packages/client/lib/commands/ZRANK_WITHSCORE.ts | 80.00% <80.00%> (ø) |
|
| packages/client/lib/commands/ZREVRANK_WITHSCORE.ts | 80.00% <80.00%> (ø) |
|
| packages/client/lib/cluster/commands.ts | 100.00% <100.00%> (ø) |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I think the coverage missing is due to the redis version from the testing cluster. The tests have the min version 7.2 and as a result I suspect that the tests are skipped for the new functions
@codrin-ch this is exactly what is happening. I'll add Redis 7.2 to the tests matrix soon.
@codrin-ch sorry for the long delay, but looks like the tests are failing (you can ignore the "ACL GETUSER" test, but:
- "client.zRankWithScore empty response"
- "client.zRankWithScore"
- "client.zRevRankWithScore empty response"
- "client.zRevRankWithScore" are all failing...
https://github.com/redis/node-redis/actions/runs/5037516252/jobs/9034411168?pr=2489#step:7:2430
If you don't have time to work on it, I'll take it from here and finish it, just let me know.. :)
Can something be done to finish this?