Kitura / Kitura-redis

Swift Redis library
Apache License 2.0
94 stars 25 forks source link

Sorted Set Decimal Support #78

Closed scuml closed 3 years ago

scuml commented 4 years ago

Description

Adds double support for sorted sets. Adds WITHSCORES parameter for ZRANGE

Motivation and Context

Sorted sets will use doubles (for microsecond timestamps and popularity algorithms for example). This adds support for doubles, while retaining integer support for backward-compatibility.

A withscores: parameter was also added to ZRANGE. It existed on ZREVRANGE, but previously was not carried over.

How Has This Been Tested?

A unit test test_ZAddFloat has been added to the test suite. This, and code that uses integer scores have both been tested.

Checklist:

CLAassistant commented 4 years ago

CLA assistant check
All committers have signed the CLA.

mbarnach commented 3 years ago

Thanks for your PR. Could you check your test, it seems to be failing on Travis.

scuml commented 3 years ago

Tests pass, but failure occurs on the swift_test_backtrace step - perhaps something wrong in Kitura/Package-Builder? Any ideas?

mbarnach commented 3 years ago

There is 2 failures in the test suite (see the end of the test command). They occurs in test_ZAddFloat. Could you have a look at it @scuml please? Thanks.

scuml commented 3 years ago

Thanks for pointing that out - didn't see those errors.

scuml commented 3 years ago

This should be passing now. Failure seems to be a timeout issue on Travis.

scuml commented 3 years ago

Comments added. Tests have been updated to test the new functionality.

sonarcloud[bot] commented 3 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

dannys42 commented 3 years ago

@mbarnach If swift 4 is not working on macOS, I think it's safe enough to drop. It's good to know Swift 4 on Linux is still working, though.