config.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. from __future__ import absolute_import
  2. import os
  3. from kombu import Queue
  4. BROKER_TRANSPORT = "memory"
  5. #: Don't want log output when running suite.
  6. CELERYD_HIJACK_ROOT_LOGGER = False
  7. CELERY_RESULT_BACKEND = "cache"
  8. CELERY_CACHE_BACKEND = "memory"
  9. CELERY_RESULT_DBURI = "sqlite:///test.db"
  10. CELERY_SEND_TASK_ERROR_EMAILS = False
  11. CELERY_DEFAULT_QUEUE = "testcelery"
  12. CELERY_DEFAULT_EXCHANGE = "testcelery"
  13. CELERY_DEFAULT_ROUTING_KEY = "testcelery"
  14. CELERY_QUEUES = (
  15. Queue("testcelery", routing_key="testcelery"),
  16. )
  17. CELERY_ENABLE_UTC = True
  18. CELERYD_LOG_COLOR = False
  19. # Tyrant results tests (only executed if installed and running)
  20. TT_HOST = os.environ.get("TT_HOST") or "localhost"
  21. TT_PORT = int(os.environ.get("TT_PORT") or 1978)
  22. # Redis results tests (only executed if installed and running)
  23. CELERY_REDIS_HOST = os.environ.get("REDIS_HOST") or "localhost"
  24. CELERY_REDIS_PORT = int(os.environ.get("REDIS_PORT") or 6379)
  25. CELERY_REDIS_DB = os.environ.get("REDIS_DB") or 0
  26. CELERY_REDIS_PASSWORD = os.environ.get("REDIS_PASSWORD")
  27. # Mongo results tests (only executed if installed and running)
  28. CELERY_MONGODB_BACKEND_SETTINGS = {
  29. "host": os.environ.get("MONGO_HOST") or "localhost",
  30. "port": os.environ.get("MONGO_PORT") or 27017,
  31. "database": os.environ.get("MONGO_DB") or "celery_unittests",
  32. "taskmeta_collection": os.environ.get("MONGO_TASKMETA_COLLECTION") or
  33. "taskmeta_collection",
  34. }
  35. if os.environ.get("MONGO_USER"):
  36. CELERY_MONGODB_BACKEND_SETTINGS["user"] = os.environ.get("MONGO_USER")
  37. if os.environ.get("MONGO_PASSWORD"):
  38. CELERY_MONGODB_BACKEND_SETTINGS["password"] = \
  39. os.environ.get("MONGO_PASSWORD")