kafka_prefix = 'objmrhxert', kafka_server = '127.0.0.1:40469'
consumer = <cimpl.Consumer object at 0x7f3a3c5275e8>
def test_storage_direct_writer(kafka_prefix: str, kafka_server, consumer: Consumer):
writer_config = {
"cls": "kafka",
"brokers": [kafka_server],
"client_id": "kafka_writer",
"prefix": kafka_prefix,
"anonymize": False,
}
storage_config: Dict[str, Any] = {
"cls": "pipeline",
"steps": [{"cls": "memory", "journal_writer": writer_config},],
}
storage = get_storage(**storage_config)
expected_messages = 0
for obj_type, objs in TEST_OBJECTS.items():
method = getattr(storage, obj_type + "_add")
if obj_type in (
"content",
"skipped_content",
"directory",
"extid",
"metadata_authority",
"metadata_fetcher",
"revision",
"release",
"snapshot",
"origin",
"origin_visit_status",
"raw_extrinsic_metadata",
):
> method(objs)
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_kafka_writer.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/storage/cassandra/storage.py:237: in content_add
return self._content_add(list(contents), with_data=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.in_memory.InMemoryStorage object at 0x7f38755924a8>
contents = [Content(sha1=b'O\xb7kk\x9f\xd9Au\xa3U\x81\xffz\xe5\xe4Ml\xb8\xaa\xbb', sha1_git=b'\x86\xbck7~\x9d%\xf9\xd2gw\xa4\xa2\...s='visible', data=b'foo5', ctime=datetime.datetime(2021, 4, 29, 8, 22, 14, 415087, tzinfo=datetime.timezone.utc)), ...]
with_data = True
def _content_add(self, contents: List[Content], with_data: bool) -> Dict:
# Filter-out content already in the database.
> if not self._allow_overwrite:
E AttributeError: 'InMemoryStorage' object has no attribute '_allow_overwrite'
.tox/py3/lib/python3.7/site-packages/swh/storage/cassandra/storage.py:155: AttributeError
TEST RESULT
TEST RESULT
- Run At
- Apr 29 2021, 10:23 AM