Граф коммитов

29 Коммитов

Автор SHA1 Сообщение Дата
William Durand 20a7bd35c0
remove isort (#16456) 2021-02-03 17:06:42 +01:00
William Durand 30ac3bf03e
Get rid of tox (#16443) 2021-02-03 13:52:30 +01:00
William Durand e61d8b0de7
"Black" all the things! (#16123) 2020-12-09 19:24:56 +01:00
William Durand 18bf215bd6
Introduce new setting for internal routes (#14254) 2020-05-25 11:51:18 +02:00
Andrew Williamson d7ae3e5797
Merge pull request #12349 from eviljeff/12333-switch-to-django-migrations
switch to django migrations
2019-09-30 11:08:57 +01:00
Christopher Grebs 0bd4815d37
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 17:36:01 +02:00
Andrew Williamson 35b1260c4f create testapp migrations and enable in pytest 2019-09-17 14:41:31 +01:00
Andrew Williamson 70b240f2b3 ignore migrations for codestyle + disable for pytest 2019-09-12 18:07:31 +01:00
Christopher Grebs 2de22598bd
Remove all usage of 'six' and as much compat code as I could f… (#11730)
* Remove all usage of 'six' and as much compat code as I could find.

Cleans up some imports along the way.

Fixes #11728

* Fix typo

* Fix rta related code paths, I actually misread the comment…

* Move ResourceWarning filtering to setup.cfg
2019-07-16 12:01:31 +02:00
Christopher Grebs 9e8468f8cd
Replace pytest-responses with our own custom implementation. (#10410)
Fixes #10399

Closes #10378
Closes #10317

This also updates pytest to 4.1.1
2019-01-16 12:26:45 +01:00
pyup.io bot 60dd98e48f Update flake8 to 3.6.0 (#9795) 2018-11-05 12:39:42 +00:00
pyup.io bot e4234d33f7 Update pytest to 3.8.1 (#9493)
* Update pytest from 3.7.4 to 3.8.1

* Update pytest from 3.7.4 to 3.8.1

* Update pytest from 3.7.4 to 3.8.1

* Ignore csp.utils deprecation warnings

* Ignore command outpout for static assets test, the 'assets' job is running the collecting manually too

* Remove pytest from prod_common

* Make requirements/uitests depend on tests.txt, remove pytest-cache
2018-09-26 09:08:30 +02:00
Mathieu Pillard f46c764d30 Run tests needing locales in a specific tox job on travis 2018-02-01 18:28:50 +01:00
Christopher Grebs 57915e2480
Add isort to our codebase. (#7118)
* Add isort to our codebase.

This is the first draft, please feel free to discuss this but I'm
generally open to change that style later on.

I just want to start making more and more of our code-style a rule
instead of something we have to take care of during code reviews.

* Ignore safe_xml file

* Don't change safe_lxml_etree

* Fix import unifification going bonkers, I don't blame isort though, this was creepy.

* Fix signin.test_views

* More flake8

* Use style number 4, hanging grid

* django group only contains django now, move above 3rd party group

* Remove pytest-isort for now to avoid isort being imported during tests.

isort has a super bad module that sets the defaultsystemencoding to
utf-8 and breaks our tests that ensure that our settings are *never*
unicode strings. If the default system encoding is set to utf-8 these
tests just work since the bytestring will be implicitly encoded to utf-8
instead of ascii which is the python2 default.

https://github.com/timothycrosley/isort/blob/develop/isort/pie_slice.py#L145
2018-01-08 12:05:14 +01:00
Benjamin Forehand Jr c1f2db3c19 Added complete configuration to enable UI testing. 2017-03-24 08:38:50 -07:00
Andrew Williamson 39cda74573 Remove coverage (#4178) 2017-01-03 12:49:24 +00:00
Andreas Wagner 836a81228b Upgrade pytest to 3.0.0 2016-09-07 18:47:42 +02:00
Mathieu Pillard e5d6848609 Ignore pyflakes F405 (variable defined by star import) for the time being
We have many of these and flake8 2.6.x started complaining about them.
2016-07-20 12:50:34 +02:00
Christopher Grebs d46dc65e8b Ignore tests/ui for regular pytest runs. Fixes #3058 (#3059) 2016-07-08 11:24:12 +02:00
Christopher Grebs 54af2204a7 Include services/ code in coverage report. 2016-06-21 21:49:18 +02:00
Mathieu Pillard 62d367a7cd Remove Hera since we no longer use Zeus. 2016-06-17 15:27:29 +01:00
Christopher Grebs 46859e279d Integrate coverage and codecov reports. 2016-05-18 11:18:10 +02:00
Christopher Grebs a9c0f82d5c Improve travis test runs.
* Remove instafail, show shorter tracebacks
 * Cache .tox, node_modules and pip
 * Upgrade pip and wheel to make sure we're using cached wheel packages
 * Fail the whole suite if one build already failed. This should give faster feedback for PRs
2016-04-15 16:46:13 +02:00
Christopher Grebs e9fb38a665 Merge branch 'master' of github.com:mozilla/olympia into feature/restructure-modules 2016-02-04 19:43:32 +01:00
Mathieu Agopian 50107ad081 Display test failure tracebacks straight away 2016-01-29 17:14:25 +01:00
Christopher Grebs c6d1cc2d66 Update django-waffle, django-piston, more import path fixes.
* Pull in django-waffle 0.10 and a fixed version of django-piston.
  Both provide late-initialization support by not calling get_user_model
  on import-time.
* Add alias for addons.buttons.js
2016-01-06 10:48:03 +01:00
Christopher Grebs 7ec38cc446 Update setup.cfg, fix package imports, syntax errors, various cleanups.
* Update installed apps, fix grouping and naming.
* Fix app-names in settings
* re-add startup import to manage.py for now

Various more import fixes, all import rewrites are now done.

This unfortunately still failes because of some circular imports
depending on django not being setup early enough.
2016-01-06 10:48:03 +01:00
Christopher Grebs e701533acf Add more flake8 excludes. 2015-12-08 14:15:50 -05:00
Christopher Grebs 74fa9aee4b Add proper setup.cfg file.
This adds pytest and flake8 configuration
to a setup.cfg file which we can use to
add more lint/pytest related configuration
later too.
2015-12-08 14:11:38 -05:00