1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-14 11:58:02 +00:00
Commit graph

20 commits

Author SHA1 Message Date
Stepan Bagritsevich
ea9dc9c454
chore(fakeredis): Enable JSON tests in the Fakeredis tests (#3773)
* chore(fakeredis): Enable JSON tests in the Fakeredis tests

fixes dragonflydb#3671

Signed-off-by: Stsiapan Bahrytsevich <stefan@dragonflydb.io>

* refactor: address comments

Signed-off-by: Stsiapan Bahrytsevich <stefan@dragonflydb.io>

* tmp commit

Signed-off-by: Stsiapan Bahrytsevich <stefan@dragonflydb.io>

* refactor: address comments 2

Signed-off-by: Stsiapan Bahrytsevich <stefan@dragonflydb.io>

---------

Signed-off-by: Stsiapan Bahrytsevich <stefan@dragonflydb.io>
2024-10-23 08:53:14 +02:00
Daniel M
1958e09a9a
refactor: refactor fakeredis tests (#3852)
* refactor:fakeredis tests
2024-10-03 12:41:05 +03:00
Borys
3804076ea9
fix: setrange with empty value doesn't modify the DB (#3771) 2024-09-23 19:09:53 +03:00
Roman Gershman
b7b96424e4
deprecate RecordsPopper and serialize channel records during push (#3667)
chore: deprecate RecordsPopper and serialize channel records during push

Records channel is redundant for DFS/replication because we have single producer/consumer
scenario and both running on the same thread. Unfortunately we need it for RDB snapshotting.

For non-rdb cases we could just pass a io sink to the snapshot producer,
so that it would use it directly instead of StringFile inside FlushChannelRecord.

This would reduce memory usage, eliminate yet another memory copy and generally would make everything simpler.
For that to work, we must serialize the order of FlushChannelRecord, and that's implemented by
this PR. Also fixes #3658.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-09-09 06:19:04 +00:00
Daniel M
eef5be1729
test: remove redundant tests (#3642)
* test: remove redundant tests

* remove more tests

* add test_bitmap_commands

* add test_bitmap_commands and test_geo_commands to ignore list
2024-09-04 23:55:35 +03:00
Roman Gershman
e6f5a2073c
fix: crash when passing empty arguments (#3627)
* fix: crash when passing empty arguments

Fix the case where we pass an empty argument, which then is parsed as an
empty string view with null pointer. The null pointer is not handled correctly
by our low level c code, hence switch to using ""sv for that.


* chore: add more list asserts + improve test_hypothesis
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-09-03 12:43:12 +03:00
Roman Gershman
1a0d44354f
fix: limit parsing in zrange commands (#3626)
1. The offset value can be negative, in that case we should return an empty array.
2. Fix edge cases of inf*0 and -inf + inf, so they will result in 0 and non NaN (similarily to Valkey).

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-09-03 10:08:45 +03:00
Roman Gershman
879f2950e5
fix: edge cases around mismatched path in json code (#3609)
For legacy mode:
1. For mutate commands, an empty result should throw an error
2. For read commands, it returns nil if path was not found, but if it was matched
   but only with a wrong types, it will throw an error.

For non-legacy mode, objlen should throw an error for non existing key.

Simplified JsonCallbackResult a bit and made sure more fakeredis tests are passing.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-09-02 21:37:59 +03:00
Roman Gershman
10de338926
chore: run fakeredis flow with the debug build (#3612)
1. Fix html publishing code
2. Upload dragonfly logs
3. Run it on pull requests

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-09-01 14:51:00 +03:00
Roman Gershman
5c48320496
fix: debug crash inside parsing of ZRANGE (#3611)
Also, fix error msg for EXEC command and finally tune more fakeredis tests.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-08-31 08:02:21 +03:00
Roman Gershman
fa2d67b8a8
fix: xreadgroup replies as a map for RESP3 (#3576)
* fix: xreadgroup replies as a map for RESP3

Moreover, it returns data for all the strings, irrespective whether they have results or not
(unlike with XREAD)

Signed-off-by: Roman Gershman <roman@dragonflydb.io>

* fix: properly handle xpending with 0 results

Also reject ENTRIESREAD instead of silently accepting it.

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-08-29 20:05:57 +00:00
Roman Gershman
b74bd5a7b2
fix: JSON.STRAPPEND (#3597)
* fix: JSON.STRAPPEND

JSON.STRAPPEND was completely broken.

First, it accepts exactly 3 arguments, i.e. a single value to append.
Secondly, the value must be a json string, not the regular string. Meaning it must be in double quotes.
So, before we parsed: `JSON.STRAPPEND key $.field bar` and now we parse:
`JSON.STRAPPEND key $.field "bar"`

In addition fixed the behavior of JSON.STRLEN to return "no such key" error in case the
json key does not exist and path is specified.
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-08-29 12:29:34 +00:00
Roman Gershman
dc040b53ad
fix: return an error when invalid number of arguments is passed. (#3584)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-08-28 06:20:29 +00:00
Roman Gershman
908290a268
chore: improve compatibility of set and ping commands (#3569)
* chore: improve compatibility of set and ping commands

smismember should return an array of longs and not array of strings.
ping in subscribe mode returns an array for resp2.
Also, fix double rounding for legacy float mode.
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-08-26 13:33:03 +03:00
Roman Gershman
20b8817148
fix: compatibility around list,string and sort commands (#3568)
1. Fix corner cases around non existing keys
2. Fix matching logic for * glob, as well as '' glob.
3. Improve SORT option parsing.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-08-25 16:30:55 +03:00
Roman Gershman
be822ae9e1
fix: compatibility around list and string commands (#3565) 2024-08-25 10:41:25 +03:00
Daniel M
7ed686ebf9
fix: add unsupported_server_types to fakeredis tests (#3560)
* fix: add unsupported_server_types to fakeredis tests

* update versions

* fix
2024-08-24 20:25:34 +03:00
Daniel M
c87fcedf1f
docs: Fakeredis tests README (#3552)
* fix:change to py3.10

* doc: tests README
2024-08-24 08:51:38 +03:00
Daniel M
a66cbe150e
fix: fakeredis tests support python 3.10 (#3550)
* fix:change to py3.10

* fix:change to py3.10
2024-08-23 22:31:35 +03:00
Daniel M
e3016a6f83
test: tests using fakeredis to check compatibility (#3534)
* fakeredis tests
2024-08-22 22:30:42 +03:00