addons-server/setup.cfg

54 строки
1.6 KiB
INI
Исходник Обычный вид История

2016-08-22 16:10:48 +03:00
[tool:pytest]
addopts = -vs --reuse-db --showlocals --tb=short
2014-11-19 19:36:40 +03:00
python_files=test*.py
markers =
es_tests: mark a test as an elasticsearch test.
needs_locales_compilation: mark a test as needing compiled locales to work.
allow_external_http_requests: mark a test to allow external http requests and disable responses.
Upgrade Celery to 4.3 (#12073) Upgrade Celery to 4.3.0 This PR upgrades to Celery 4.3, introduces a small hack because of a regression in celery. This PR does not introduce any helpers to make use of celery workers inside the tests, we delayed that to a later point to unblock the upgrade. This PR does fix some inconsistencies with elasticsearch mocks along the way as they were making some tests fail (see comment logs), the mocks are now applied and rolled back much less than before which makes them easier to reason about and to debug. Notes: * acks_late now doesn't acknowledge in case of failures or timeouts (which is the case for index_addons). We could use task_acks_on_failure_or_timeout but I figured the new behavior should be fine. * any CELERY_ALWAYS_EAGER setting in local_settings.py must be replaced by CELERY_TASK_ALWAYS_EAGER commit log: * Implement proper wait_for_tasks helper, make TestTaskQueued work with celery worker * Revert changes removing threading code from es reindex tests * Fix es reindex test, correct always eager usage. * Small cleanups, fix docs, don't reload session worker. * Ensure docker-compose celery result doesn't use the same database as any potential tests * Monkeypatch for celery regression * Actually use our own app where all tasks are already bound to. This also enables logging * Experiment: Group celery worker tests together with elasticsearch and dont run them multitasked * Remove envlist as it doesn't add anything to our specific setup * Fix es-and-celery marker selection * Remove completely redundant tests * Fix hanging tasks, let's see what travis thinks... I'll follow up with cleanups and much more docs once tests are actually succeeding * Define celery.ping in amo.celery, use redis result backend * Cleanup celery worker implementation a bit. Mimic our usage of elasticsearch specific tests, this avoids various necessary workarounds and environment cleanups because django handles things like settings properly in the first place. * Untangle es mocks a bit, raise error in case of not properly stopped patches. * Re-implement state test by using celery manager to wait for results * Explicitly re-reinitialize the workers event loop and dont reuse anything existing * Remove celery worker thread specific code. * Reset default celery result backend setting
2019-09-18 18:36:01 +03:00
static_assets: Tests that are depending on `compress_assets` and require to be separated with other tests.
internal_routes_allowed: mark a test as needing INTERNAL_ROUTES_ALLOWED=True.
norecursedirs =
node_modules locale static media site-static user-media tmp
templates fixtures migrations
.* *.egg dist cache venv __pycache__
DJANGO_SETTINGS_MODULE = settings_test
# Ignoring csp deprecation warnings,
# we have control over the module and currently it warns
# for child-src which is deprecated in CSPv3 but we're
# still on CSP 2 while CSP 3 is still in working draft (sept 2018)
filterwarnings =
default
ignore:::csp.utils
# Ignore ResourceWarning for now. It's a Python 3 thing :-/
ignore::ResourceWarning
[flake8]
2018-11-05 15:39:42 +03:00
ignore = F999,F405,W504
exclude =
src/olympia/wsgi.py,
docs,
node_modules,
.npm,
build*.py
2015-12-08 22:15:50 +03:00
.tox,
media,
2018-11-05 15:39:42 +03:00
storage,
2015-12-08 22:15:50 +03:00
logs,
site-static,
static,
.git,
*/migrations/*.py
[isort]
atomic=true
lines_after_imports=2
lines_between_types=1
multi_line_output=4
combine_as_imports = true
default_section = THIRDPARTY
include_trailing_comma = false
known_django = django
known_olympia = olympia
line_length = 79
sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,OLYMPIA,FIRSTPARTY,LOCALFOLDER