kafka_prefix = 'bqhkorllfh', kafka_server = '127.0.0.1:40039'
consumer = <cimpl.Consumer object at 0x7f23503fb048>
def test_storage_direct_writer_anonymized(
kafka_prefix: str, kafka_server, consumer: Consumer
):
writer_config = {
"cls": "kafka",
"brokers": [kafka_server],
"client_id": "kafka_writer",
"prefix": kafka_prefix,
"anonymize": True,
}
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():
if obj_type == "origin_visit":
# these have non-consistent API and are unrelated with what we
# want to test here
continue
method = getattr(storage, obj_type + "_add")
method(objs)
expected_messages += len(objs)
existing_topics = set(
topic
for topic in consumer.list_topics(timeout=10).topics.keys()
if topic.startswith(kafka_prefix)
)
> assert existing_topics == {
f"{kafka_prefix}.{obj_type}"
for obj_type in (
"content",
"directory",
"metadata_authority",
"metadata_fetcher",
"origin",
"origin_visit",
"origin_visit_status",
"raw_extrinsic_metadata",
"release",
"revision",
"snapshot",
"skipped_content",
)
} | {
f"{kafka_prefix}_privileged.{obj_type}" for obj_type in ("release", "revision",)
}
E AssertionError: assert {'bqhkorllfh....release', ...} == {'bqhkorllfh....n_visit', ...}
E Extra items in the right set:
E 'bqhkorllfh.metadata_authority'
E 'bqhkorllfh.raw_extrinsic_metadata'
E 'bqhkorllfh.metadata_fetcher'
E Full diff:
E {
E 'bqhkorllfh.content',...
E
E ...Full output truncated (15 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_kafka_writer.py:127: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Jul 31 2020, 10:20 AM