2016-08-22 16:10:48 +03:00
|
|
|
[tool:pytest]
|
2016-04-08 10:21:52 +03:00
|
|
|
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.
|
2018-02-01 19:00:58 +03:00
|
|
|
needs_locales_compilation: mark a test as needing compiled locales to work.
|
2019-01-16 14:26:45 +03:00
|
|
|
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.
|
2020-05-25 12:51:18 +03:00
|
|
|
internal_routes_allowed: mark a test as needing INTERNAL_ROUTES_ALLOWED=True.
|
2015-08-23 02:18:21 +03:00
|
|
|
norecursedirs =
|
|
|
|
node_modules locale static media site-static user-media tmp
|
|
|
|
templates fixtures migrations
|
2015-12-17 09:59:16 +03:00
|
|
|
.* *.egg dist cache venv __pycache__
|
2015-08-23 02:18:21 +03:00
|
|
|
DJANGO_SETTINGS_MODULE = settings_test
|
2018-09-26 10:08:30 +03:00
|
|
|
# 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
|
2019-07-16 13:01:31 +03:00
|
|
|
# Ignore ResourceWarning for now. It's a Python 3 thing :-/
|
|
|
|
ignore::ResourceWarning
|
2015-12-08 22:11:38 +03:00
|
|
|
|
|
|
|
[flake8]
|
2018-11-05 15:39:42 +03:00
|
|
|
ignore = F999,F405,W504
|
2015-12-08 22:11:38 +03:00
|
|
|
exclude =
|
2015-12-16 11:46:10 +03:00
|
|
|
src/olympia/wsgi.py,
|
2015-12-08 22:11:38 +03:00
|
|
|
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,
|
2019-09-12 18:39:30 +03:00
|
|
|
.git,
|
|
|
|
*/migrations/*.py
|
2018-01-08 14:05:14 +03:00
|
|
|
|
|
|
|
[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
|