Remove RDB compatibility test and data (#27)

This commit is contained in:
Joe Hu 2024-12-13 19:51:13 -05:00 committed by GitHub
parent 788a53a462
commit 09612c9ba5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 1 additions and 53 deletions

View File

@ -4,7 +4,7 @@ on: [push, pull_request]
jobs:
build-ubuntu-latest:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:

View File

@ -1,24 +0,0 @@
#### How to create rdb file for a new ReJSON release?
e.g., testing RDB compatibility with rejson 2.2.0.
1. Run docker image redis-stack:
```text
docker run -d -p 6379:6379 --name rejson redislabs/rejson:2.2.0
```
2. Load store.json and create a key named "store":
```text
python3 utils/load_1file_hostport.py tst/integration/data/store.json store
```
3. Save rdb:
```text
valkey-cli save
```
4. Copy out the RDB file:
```text
docker cp $(docker ps -q):/data/dump.rdb tst/integration/rdb_rejson/rejson-<version>.rdb
```
5. run test_json_rdb_import.py:
```text
TEST_PATTERN=test_import_rejson_rdbs make test
```

View File

@ -34,31 +34,3 @@ class TestRdb(JsonTestCase):
assert True == client.execute_command('save')
client.execute_command('FLUSHDB')
assert b'OK' == client.execute_command('DEBUG', 'RELOAD', 'NOSAVE')
def test_import_rejson_rdbs(self):
'''
Verify we can load RDBs generated from ReJSON.
Each RDB file contains JSON key "store" (data/store.json).
'''
self.load_rdbs_from_dir('rdb_rejson')
def load_rdbs_from_dir(self, dir):
src_dir = os.getenv('SOURCE_DIR')
rdb_dir = f"{src_dir}/tst/integration/{dir}"
assert os.path.exists(rdb_dir)
for (dirpath, dirnames, filenames) in os.walk(rdb_dir):
for filename in filenames:
if pathlib.Path(filename).suffix == '.rdb':
file_path = os.path.join(dirpath, filename)
self.load_rdb_file(file_path, filename)
def load_rdb_file(self, rdb_path, rdb_name):
new_path = os.path.join(self.testdir, rdb_name)
os.system(f"cp -f {rdb_path} {new_path}")
logging.info(f"Loading RDB file {new_path}")
self.client.execute_command(f"config set dbfilename {rdb_name}")
self.client.execute_command("debug reload nosave")
self.verify_keys_in_rejson_rdb()
def verify_keys_in_rejson_rdb(self):
assert b'["The World Almanac and Book of Facts 2021"]' == self.client.execute_command('json.get', 'store', '$..books[?(@.price>10&&@.price<22&&@.isbn)].title')