Skip to content
Snippets Groups Projects

publisher: Simplify publisher initialization and add journal cli

3 unresolved threads

This allows to pass the configuration needed to the publisher.

I extracted that from the current work i'm doing on testing kafka. That allows to unblock other coming changes needed (impact on swh-docker-dev, swh-site).

Related swh-core#1410

Test Plan

tox


Migrated from D1249 (view on Phabricator)

Merge request reports

Approved by

Closed by Phabricator Migration userPhabricator Migration user 6 years ago (Mar 15, 2019 12:50pm UTC)

Merge details

  • The changes were not merged into generated-differential-D1249-target.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
139 145
140 146 class TestPublisher(unittest.TestCase):
141 147 def setUp(self):
142 self.publisher = JournalPublisherTest()
148 self.publisher = JournalPublisherNoKafkaInMemoryStorage(TEST_CONFIG)
  • vlorentz
    vlorentz @vlorentz started a thread on the diff
  • 62 'publisher_id', 'object_types', 'storage'
    63 ]
    64
    65 conf = ctx.obj['config']
    66 missing_keys = []
    67 for key in mandatory_keys:
    68 if not conf.get(key):
    69 missing_keys.append(key)
    70
    71 if missing_keys:
    72 raise click.ClickException(
    73 'Configuration error: The following keys must be'
    74 ' provided: %s' % (','.join(missing_keys), ))
    75
    76 publisher = JournalPublisher(conf)
    77 try:
  • mentioned in merge request swh-docker-dev!129 (closed)

  • vlorentz mentioned in merge request !242 (closed)

    mentioned in merge request !242 (closed)

  • Accepted, but let's not forget to add tests for the CLI

  • Merge request was accepted

  • vlorentz approved this merge request

    approved this merge request

  • vlorentz
    vlorentz @vlorentz started a thread on the diff
  • 58
    59 """
    60 mandatory_keys = [
    61 'brokers', 'temporary_prefix', 'final_prefix', 'consumer_id',
    62 'publisher_id', 'object_types', 'storage'
    63 ]
    64
    65 conf = ctx.obj['config']
    66 missing_keys = []
    67 for key in mandatory_keys:
    68 if not conf.get(key):
    69 missing_keys.append(key)
    70
    71 if missing_keys:
    72 raise click.ClickException(
    73 'Configuration error: The following keys must be'
  • Thanks for the remarks.

    Yes, for the test on cli. I planned to do that but not right now. My main focus right now is being able to test the kafka layer for now ;)

  • Adapt according to review

  • Merge request was merged

  • Please register or sign in to reply
    Loading