python - How can I write tests to make sure celery tasks go into the right queue -
due complicated callback/chaining setup tasks in our infrastructure seem going queues not assigned to. want write automated tests make sure celery task sent queue specified handled by.
setup example:
from celery import celery celery = celery() @celery.task(base=mytask, queue='mytasks.add') def add(x, y): = x + y return @celery.task(base=mytask, queue='mytasks.dadd') def double_add(a, y): b = + y def caller(x, y): add.apply_async(args=(2, 1), kwargs={''callback': double_add.subtask(args=(3)) })
so here "add" should handled queue='mytasks.add', , "double_add" should handled queue='mytasks.dadd'
i understand basic result based testing celery such shown here: how unit test celery task?
but appreciate insight testing process above scenario.
Comments
Post a Comment