Skip to content

Commit

Permalink
Remove RDB compatibility test and data (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
joehu21 authored Dec 14, 2024
1 parent 788a53a commit 09612c9
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 53 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
24 changes: 0 additions & 24 deletions tst/integration/rdb_rejson/README.md

This file was deleted.

Binary file removed tst/integration/rdb_rejson/rejson-1.0.8.rdb
Binary file not shown.
Binary file removed tst/integration/rdb_rejson/rejson-2.0.11.rdb
Binary file not shown.
Binary file removed tst/integration/rdb_rejson/rejson-2.0.6.rdb
Binary file not shown.
Binary file removed tst/integration/rdb_rejson/rejson-2.0.7.rdb
Binary file not shown.
Binary file removed tst/integration/rdb_rejson/rejson-2.0.8.rdb
Binary file not shown.
Binary file removed tst/integration/rdb_rejson/rejson-2.2.0.rdb
Binary file not shown.
Binary file removed tst/integration/rdb_rejson/rejson-2.6.12.rdb
Binary file not shown.
28 changes: 0 additions & 28 deletions tst/integration/test_rdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,3 @@ def test_rdb_saverestore(self):
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')

0 comments on commit 09612c9

Please sign in to comment.