Mark DigestWorker and PushNotificationsWorker as nocoverage.

These two classes are tricky to test, and nocoverage-ing them
allows us to mark queue_processors.py as fully covered. We
still want to cover these two workers at some point, but for
now, it's nice to enforce full coverage for any future changes
to queue_processors.py.

Fixes (sort of) #6542.
This commit is contained in:
Robert Hönig 2018-02-25 17:52:38 -05:00 committed by Tim Abbott
parent 93b2f0ea35
commit 81ba7a1e40
2 changed files with 3 additions and 2 deletions

View File

@ -37,6 +37,7 @@ target_fully_covered = {path for target in [
# Once we have a nice negative tests system, we can add these: # Once we have a nice negative tests system, we can add these:
# 'zerver/webhooks/*/*.py', # 'zerver/webhooks/*/*.py',
# 'zerver/webhooks/*/*/*.py', # 'zerver/webhooks/*/*/*.py',
'zerver/worker/queue_processor.py',
] for path in glob.glob(target)} ] for path in glob.glob(target)}
not_yet_fully_covered = { not_yet_fully_covered = {

View File

@ -322,7 +322,7 @@ class MissedMessageSendingWorker(EmailSendingWorker): # nocoverage
pass pass
@assign_queue('missedmessage_mobile_notifications') @assign_queue('missedmessage_mobile_notifications')
class PushNotificationsWorker(QueueProcessingWorker): class PushNotificationsWorker(QueueProcessingWorker): # nocoverage
def consume(self, data): def consume(self, data):
# type: (Mapping[str, Any]) -> None # type: (Mapping[str, Any]) -> None
handle_push_notification(data['user_profile_id'], data) handle_push_notification(data['user_profile_id'], data)
@ -430,7 +430,7 @@ class MessageSenderWorker(QueueProcessingWorker):
respond_send_message) respond_send_message)
@assign_queue('digest_emails') @assign_queue('digest_emails')
class DigestWorker(QueueProcessingWorker): class DigestWorker(QueueProcessingWorker): # nocoverage
# Who gets a digest is entirely determined by the enqueue_digest_emails # Who gets a digest is entirely determined by the enqueue_digest_emails
# management command, not here. # management command, not here.
def consume(self, event): def consume(self, event):