I do have and use eager = True for local developer testing, environment. And I have been able to write test cases and they work in eager mode, fine.
However, I do have a CI test environment, where I would like to be able to run these same test suites with real asynchronous worker processes. To make sure there are no problems when running them in a real world distributed model a Implements well. So What I am trying to do is to create my own custom Django Test Runner that 1. Lets the regular django test runner create/setup the test database 2. Start the Celery worker and have it talk to the same test database. I am having a very tough time finding a way to do this. The closest answer I found was https://stackoverflow.com/questions/42058295/make-celery-use-djangos-test-database-without-task-always-eager But couldn't figure out how to implement/do the Advanced: Step 3 that is suggested there. On Thursday, June 22, 2017 at 11:44:23 AM UTC-7, Avraham Serour wrote: > > Any special reason you are not using eager=true for celery under test? > > On Jun 22, 2017 7:17 PM, "sarvi" <[email protected] <javascript:>> wrote: > >> >> Can someone help me with how can I get my celery worker >> process(standalone app outside of djanog) to talk to a django test database >> ? >> >> I am trying to test a celery/django app. >> I plan on starting the celery worker process with a custom TestRunner. >> So that the worker process starts after the django test runner has >> created the test database. >> >> DATABASES = { >> >> 'default': { >> >> 'ENGINE': 'django.db.backends.oracle', >> >> .............. >> >> 'TEST': { >> >> 'USER': WIT_TEST_DB_USER, >> >> 'PASSWORD': WIT_TEST_DB_USER, >> >> } >> >> } >> >> } >> >> How can I setup the celery app environment so that when the tasks access >> the the app.models.X, they are talk to the "test" database. >> >> Thanks, >> Sarvi >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at https://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/e9ba0c8c-a4e3-4588-99ec-46be91c4ba1b%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/e9ba0c8c-a4e3-4588-99ec-46be91c4ba1b%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b7fd9e9d-ef79-45a6-bdba-762c78a12925%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

