How can I trigger a dramatiq-crontab job for testing? #114
-
I'd like to be able to trigger a cron job so I can test that everything from the dramatiq-crontab -> my function chain is running properly in a unit test. This is especially useful in catching incompatibilities that might arise from updating a library somewhere in the stack. Is there a way to do this? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @hihosilvers 👋, Thanks for reaching out. Yes, you can! Cron-tasks are just normal dramatiq tasks, which are pretty much normal functions. Therefore, you can just call them like any function If you want to test your entire stack, you can refer to dramatiq's testing guide. I hope this helps. Please let us know, should you have more questions. Best |
Beta Was this translation helpful? Give feedback.
Hi @hihosilvers 👋,
Thanks for reaching out. Yes, you can! Cron-tasks are just normal dramatiq tasks, which are pretty much normal functions. Therefore, you can just call them like any function
my_job()
.If you want to test your entire stack, you can refer to dramatiq's testing guide.
I hope this helps. Please let us know, should you have more questions.
Best
Joe