replayer_storage_and_client = (<swh.storage.in_memory.InMemoryStorage object at 0x7fb77bceb7f0>, <swh.journal.client.JournalClient object at 0x7fb77bcebf60>)
caplog = <_pytest.logging.LogCaptureFixture object at 0x7fb7a10a5438>
def test_storage_replayer(replayer_storage_and_client, caplog):
"""Optimal replayer scenario.
This:
- writes objects to a source storage
- replayer consumes objects from the topic and replays them
- a destination storage is filled from this
In the end, both storages should have the same content.
"""
src, replayer = replayer_storage_and_client
# Fill Kafka using a source storage
nb_sent = 0
for object_type, objects in TEST_OBJECTS.items():
method = getattr(src, object_type + "_add")
> method(objects)
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_replay.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.in_memory.InMemoryStorage object at 0x7fb77bceb7f0>
directories = [Directory(entries=(), id=b'K\x82]\xc6B\xcbn\xb9\xa0`\xe5K\xf8\xd6\x92\x88\xfb\xeeI\x04'), Directory(entries=(Director...7<&z\xdcw\xc2\x90\x8ed\xe0\xc1\xcbjD1', perms=57344)), id=b'\x87\xb39\x10O}\xc2\xa8\x16=\xec\x98\x84E\xe3\x98y\x95T_')]
def directory_add(self, directories: List[Directory]) -> Dict[str, int]:
to_add = {d.id: d for d in directories}.values()
if not self._allow_overwrite:
# Filter out directories that are already inserted.
missing = self.directory_missing([dir_.id for dir_ in to_add])
directories = [dir_ for dir_ in directories if dir_.id in missing]
self.journal_writer.directory_add(directories)
for directory in directories:
# Add directory entries to the 'directory_entry' table
rows = [
DirectoryEntryRow(directory_id=directory.id, **entry.to_dict())
for entry in directory.entries
]
> if self._directory_entries_insert_algo == "one-by-one":
E AttributeError: 'InMemoryStorage' object has no attribute '_directory_entries_insert_algo'
.tox/py3/lib/python3.7/site-packages/swh/storage/cassandra/storage.py:451: AttributeError
TEST RESULT
TEST RESULT
- Run At
- Aug 26 2021, 11:17 AM