Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/test_backfill.py
Show All 15 Lines | |||||
from swh.storage.tests.test_replay import check_replayed | from swh.storage.tests.test_replay import check_replayed | ||||
TEST_CONFIG = { | TEST_CONFIG = { | ||||
"journal_writer": { | "journal_writer": { | ||||
"brokers": ["localhost"], | "brokers": ["localhost"], | ||||
"prefix": "swh.tmp_journal.new", | "prefix": "swh.tmp_journal.new", | ||||
"client_id": "swh.journal.client.test", | "client_id": "swh.journal.client.test", | ||||
}, | }, | ||||
"storage_dbconn": "service=swh-dev", | "storage": {"cls": "local", "db": "service=swh-dev"}, | ||||
} | } | ||||
def test_config_ko_missing_mandatory_key(): | def test_config_ko_missing_mandatory_key(): | ||||
"""Missing configuration key will make the initialization fail | """Missing configuration key will make the initialization fail | ||||
""" | """ | ||||
for key in TEST_CONFIG.keys(): | for key in TEST_CONFIG.keys(): | ||||
▲ Show 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | ): | ||||
# now apply the backfiller on the storage to fill the journal under prefix2 | # now apply the backfiller on the storage to fill the journal under prefix2 | ||||
backfiller_config = { | backfiller_config = { | ||||
"journal_writer": { | "journal_writer": { | ||||
"brokers": [kafka_server], | "brokers": [kafka_server], | ||||
"client_id": "kafka_writer-2", | "client_id": "kafka_writer-2", | ||||
"prefix": prefix2, | "prefix": prefix2, | ||||
}, | }, | ||||
"storage_dbconn": swh_storage_backend_config["db"], | "storage": swh_storage_backend_config, | ||||
} | } | ||||
# Backfilling | # Backfilling | ||||
backfiller = JournalBackfiller(backfiller_config) | backfiller = JournalBackfiller(backfiller_config) | ||||
for object_type in TEST_OBJECTS: | for object_type in TEST_OBJECTS: | ||||
backfiller.run(object_type, None, None) | backfiller.run(object_type, None, None) | ||||
# now check journal content are the same under both topics | # now check journal content are the same under both topics | ||||
Show All 25 Lines |