treeherder/tests/settings.py

31 строка
1.2 KiB
Python
Исходник Обычный вид История

from treeherder.config.settings import * # noqa: F403
DATABASES["default"]["TEST"] = {"NAME": "test_treeherder"} # noqa: F405
KEY_PREFIX = 'test'
TREEHERDER_TEST_REPOSITORY_NAME = 'test_treeherder_jobs'
# this makes celery calls synchronous, useful for unit testing
Bug 1337717 - Update to newer Celery, Kombu, py-amqp and billiard (#4722) Updating in one go, since the Celery 4 release only supports the newer versions of its dependencies and vice versa. Of note, this fixes the unhelpful connection error messages shown when in fact there was an authentication problem, and brings Celery/Kombu support for Python 3.7. It's also likely that this will fix the pulse listener hang seen in bug 1529404. The new Celery release has renamed a number of the settings. Most changes were performed by running: ``` celery upgrade settings treeherder/config/settings.py --django celery upgrade settings tests/settings.py --django ``` The Django integration in celery.py has been cleaned up by following: https://celery.readthedocs.io/en/latest/django/first-steps-with-django.html The bug being hit that caused this to be reverted back in #2119/bug 1333079 was due to Celery 4 no longer supporting calling `apply_async()` with just the `routing_key` - it now has to be called with either just the `queue`, or else both the `routing_key` and `queue`, otherwise the task ends up in the `default` queue. Sadly this isn't mentioned in the Celery breaking changes list - I'll file an upstream issue shortly. Changes: http://docs.celeryproject.org/en/master/history/whatsnew-4.0.html http://docs.celeryproject.org/en/master/changelog.html#rc1 https://github.com/celery/celery/compare/v3.1.26...v4.3.0rc1 http://docs.celeryproject.org/projects/kombu/en/stable/changelog.html#version-4-3-0 https://github.com/celery/kombu/compare/v3.0.37...v4.3.0 https://amqp.readthedocs.io/en/stable/changelog.html https://github.com/celery/py-amqp/compare/v1.4.9...v2.4.1 https://github.com/celery/billiard/blob/v3.6.0/CHANGES.txt https://github.com/celery/billiard/compare/v3.3.0.23...v3.6.0
2019-02-28 22:52:22 +03:00
CELERY_TASK_ALWAYS_EAGER = True
CELERY_TASK_EAGER_PROPAGATES = True
# Make WhiteNoise look for static assets inside registered Django apps, rather
# than only inside the generated staticfiles directory. This means we don't
# have to run collectstatic for `test_content_security_policy_header` to pass.
WHITENOISE_USE_FINDERS = True
# Set a fake api key for testing bug filing
BUGFILER_API_KEY = "12345helloworld"
BUGFILER_API_URL = "https://thisisnotbugzilla.org"
# some of the auth/login tests can be faster if we don't require "django_db"
# access. But if we use the defaults in config.settings, we also get the
# ``ModelBackend``, which will try to access the DB. This ensures we don't
# do that, since we don't have any tests that use the ``ModelBackend``.
AUTHENTICATION_BACKENDS = (
'treeherder.auth.backends.AuthBackend',
)
# For Push Health Usage dashboard
NEW_RELIC_INSIGHTS_API_KEY = "123"