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

56 Коммитов

Автор SHA1 Сообщение Дата
Andrew Williamson 6fdf5bb9bf switch local dev to python3 2019-02-08 21:54:35 +08:00
Christopher Grebs f26a150086
Remove amo-validator, remove support for uploading legacy-addons. (#10553)
* Remove amo-validator, remove more support for uploading legacy-addons.

This is dropping most of our compatibility checks for legacy add-ons and
completely blocks them from being uploaded.

We workaround this block for mozilla-signed add-ons by issuing the same
error, just as a warning instead of an actual error.

This affected *loads* of our tests so the PR contains more test-changes
then I'd like.

In addition to that this PR adds file extension validation for uploads,
we only did that in our JavaScript and never in our code. So from now
on, we have a hard limit to only allow whatever is in
`VALID_EXTENSIONS`.

Further...

* drop amo-validator and related dependencies
* remove `dump_apps` management command
* removed unused fixture files from the repo

Fixes #10502

Future improvement idea for our test-suite: Unify add-on file fixtures
under one single folder to avoid any duplication.

There is most certainly some more improvements that could be made to
code and test structure but I went for the least changes, it's way too
huge already :-/

* Fix syntax error in JavaScript, thus ui tests

* Switch back to passing 'channel' around

* Move valid addon file extensions to constants/base

* Fix validate() call

* Fix more tests

* Update src/olympia/devhub/tests/test_views_validation.py

Co-Authored-By: EnTeQuAk <cg@webshox.org>

* Remove old comment

* Issue description specific only to Thunderbird and Seamonkey if targeting thunderbird or seamonkey
2019-02-01 08:52:04 +01:00
Mathieu Pillard 9214d8c782 Use latest-py3 tag in docker-compose instead of a separate image name 2019-01-23 12:33:12 +01:00
Mathieu Pillard 04f8ebe038 Use separate Dockerfile for Python 3, built from python3.6 base image
Can't use Python 3.7 yet because of issues with celery.
2019-01-22 12:40:40 +01:00
Mathieu Pillard 3181fd0794 Create a separate web3 container, a Python 3 variant of the web container
This doesn't run services yet, and is just useful to run tests. Because
it shares the same image as the regular web container, an initial
make update_deps is necessary to get it working. After that, running
pytest as normal should function normally and be using Python 3.
2019-01-17 14:43:24 +01:00
Christopher Grebs 7f76448708
Upgrade autograph image to 2.7.0
Fixes #10357
2019-01-14 15:42:05 +01:00
Christopher Grebs 4a207aeed2
Split selenium based docker-config into tests/ui/docker-compose.selenium.yml (#10143)
Unfortunately, we'll have to duplicate the environment config but I added
a comment so that should be fine. It's very rarely being used anyway.

Fixes #9288
2018-12-03 17:40:00 +01:00
Christopher Grebs cf629f5ba0
Expose correct addons and user-media paths in docker container. (#9706)
Fixes #9705
2018-10-16 13:45:29 +02:00
Benjamin Forehand Jr fe0084b223
Attempt at serving new dir to user media for addon install test. (#9700) 2018-10-15 15:10:46 -04:00
Greg Guthe 3a44661ed3
bump autograph version to 2.3.0 for travis CI and docker compose 2018-08-30 07:48:35 -04:00
Benjamin Forehand Jr 80bbc69dfd
Added configuration to run multiple ui tests in parallel. (#9266)
* Changed fxa account generation to allow assigning an fxa ID to a created user.
* Moved pytest execution to makefile to access variables.
* Removed second login tests as the devhub tests also log in.
2018-08-28 14:48:35 -04:00
Christopher Grebs 6f3f687790
Unify database configuration, enable 'read committed' transaction level
Fixes #7158
2018-08-21 07:21:01 +02:00
Mathieu Pillard dec7cc87f6 Remove more traces of redis 2018-07-30 11:30:13 +02:00
Christopher Grebs 5585ddcf09
Disable more xpack features, add some documentation.
Fixes #8887
2018-07-26 16:32:19 +02:00
Benjamin Forehand Jr ab1fe7c170 Add ui login tests (#8076)
* Update tests for fxa login.

* Updates to docker compose file to allow localhost logins.

* Updated files.

* Updated readme and circle file.

* Fix typo.

* Removed debugging steps and updated readme and comments.

* April 26 Homepage update.
2018-04-23 08:02:15 +02:00
Benjamin Forehand Jr 9747bb84fe
Updated UI tests to use the new AMO frontend. (#7565)
* Uses addons-frontend docker image to create an instance of the new frontend.
* Add testing for both mobile and desktop resolutions.
2018-03-01 14:05:40 -08:00
Christopher Grebs 818ea06ace
Merge branch 'master' of github.com:mozilla/addons-server into 493-move-olympia-test 2018-02-08 16:43:14 +01:00
Christopher Grebs d52015d365
Default to 'and' operator for match queries. Remove slug search, prioritize exact matches more. (#7303)
* Default to 'and' operator for match queries. Remove slug search, prioritize exact matches more.

References many "component: search" issues. What I tested with a
database of all public add-ons:

Example searches:

tab center redux - should find "Tab Center Redux" while "Tab Mix Plus" is probably second and "Redux DevTools" 4th or so
Open Image in New Tab -> should find "Open Image in New Tab" while "Open Bookmarks in New Tab" should be 2nd or 3rd
CoinHive -> Finds "Coinhive Blocker", "CoinBlock" (prefix search) and "NoMiners" (description)
Privacy -> Finds "Privacy Badger", "Privacy Pass", "Privacy Settings", "Google Privacy" (probably 4th or so) and "Blur" (summary + description + many users). Scores "Ghostery" on the first page but ranks it in the middle
firebu -> Finds "Firebug", "Firebug Autocompleter", "Firefinder for Firebug"
fireb -> Scores "Fire Drag" first, puts "Firebug" approximately 3rd or so
Menu Wizzard -> Finds "Menu Wizard" (fuzzy, typo) first, then "Add-ons Manager Context Menu" apparently because it matches good in the title and has many users
Frame Demolition -> Finds "Frame Demolition"
Demolition -> Finds only "Frame Demolition", same for "Demolation" (typo)
reStyle -> Finds "reStyle" and scores a few add-ons that match on "restore" next since the term is similar
MegaUpload DownloadHelper -> finds "MegaUpload DownloadHelper" first, scores "Video DownloadHelper" and "RadpidShare DownloadHelper" next. Doesn't find "Popup Blocker" anymore as currently happening on -prod
MegaUpload -> only finds "MegaUpload DownloadHelper" and nothing else
No Flash -> Scores "No Flash" first, then depending on users "Download Flash and Video", "YouTube Flash Video Player" and "YouTube Flash Player" (not necessarily in that order)
Disable Hello, Pocket & Reader+ -> finds "Disable Hello, Pocket & Reader+" first (yeay!), then scores "Reader", "Disable WebRTC" and "In My Pocket" next similarly to what's happening on -prod currently

Not working yet:

privacybadger -> "Privacy Badger" -> will probably need some kind of ngram filtering and analyzing (#591)
eyes -> 'decentraleyes' -> Not sure this should actually work, will probably need some more analyzing too (#591)

Not sure if it's specifically only because of these changes but #3248 is fixed.

This potentially fixes #7244, #6891, #6837, #6417, mozilla/addons#359.

Not sure if this fixes #mozilla/addons#567 but the results look much more promising and the amount of results doesn't explode here. I only have 2.8k add-ons for testing though so I'm not too sure.

And might be relevant to #6137.

This is a big step towards #2661, I doubt we can call this fixed though.

* Fix name tests

* Speed up ES tests, make scoring results more predictable by using only one shard and one replica

* Add tests

* Only test on new apiv3 based search.

* Fixup 'get_results'

* Remove debug print

* Isort imports

* Fix test settings, I'm blind.

* Adapt number of shards to what we define in settings_test

* Test search for grapple

* Remove property filtering in legacy api search, fix tests, fix flake8

* Add comment explaining shard config

* Fix tests again, add default platform, fix total counts again.

* Try to do some fixture cleanup, let's see...

* More test refactoring, make use of dfs-query-then-fetch during tests, allow us to test this later too via a waffle flag.

* Don't use waffle flag for legacy search, only for apiv3 searches.

* Fix unused import, fix usage of 'params'

* Use query-then-fetch in a regular addons-view tool, fix a few more tests to be able to handle the waffle-flag

* Create the dfs query then fetch flag only in ESTestCase, delete it properly. More serializer fixes

* precache the waffle flag for autocomplete tests too

* Minor cleanups

* Add docs, fix code style

* Add a todo

* Fix codestyle
2018-01-30 06:26:30 +01:00
Christopher Grebs 17bb6968e5
First part moving to olympia.test 2018-01-26 07:11:48 +01:00
Benjamin Forehand Jr 8a646cadc4 Addon Install Test (#6641)
* Use docker-compose>=1.18 and minimal docker-compose config version to 2.3
* Starts ui-tests in Firefox docker container
* Let's the Firefox docker-container hit directly nginx
* makes use of https://github.com/jrbenny35/selenium-firefox/ firefox+selenium image
* makes use of /user-media/ serving directly via nginx for XPI installs
* Adds a helper that creates an installable add-on
* Update `firefox_options` fixture with all options needed to install add-ons with a test signing signature

Fixes #7270 
Fixes #2488
2018-01-12 06:58:00 +01:00
Christopher Grebs 46f7f1eb7c
serve /user-media/ via nginx.
This change landed in
27fbed27e0
and is primarily used by our future ui-tests to serve XPI files.
2018-01-09 12:49:26 +01:00
Christopher Grebs c2b7f30d24
Add autograph signing server support (#6865)
Fixes #6640
Fixes #6866

This pull request adds support for our new Autograph signing server, adds it to our dockerized services and adds tests that now actually call our signing server.

* Add a waffle-switch for calls to our new autograph signing server
* Add the autograph signing server to docker-compose
* Add the autograph signing server to our travis setup
* avoid us specifying the signing server settings everywhere in the code, one single source of truth
* more use of `responses` instead of mocking, leaning towards
  the future where we can actually hit a signing server instead
  of a mock
* disallow http requests generically, unless configured otherwise
* Add migration for waffle flag
2017-11-13 17:29:57 +01:00
Christopher Grebs 176383b168 Upgrade to Celery 4 (#6667)
* Update celery, config and dependencies to 4.x

* Remove usage of TaskSet, replace with group(), update `ampq`
* Enable redis on travis for better celery 4.x testing
* Fix lib/celery_tests
* Correct test testing email sending retrying on errors
* Fix celery subtask mocking errors.

* Fix celery broker url env variable

* Integrate watchdog for celery autoreload

* Ensure dependencies are updated for worker and web container.

* Restart all services after the dependency update

* Remove explicit celery loader environment variable.

* Restart all services in web and worker after running 'update_docker'

* Increase sleep time a bit
2017-10-16 11:16:41 +02:00
Mathieu Pillard 43d88b4f55 Revert "Upgrade to Celery 4 (#6625)"
This reverts commit 541688d5f2.

This caused some breakage on dev. We suspect it's because newrelic
hooks into the celery task launching code but does not support
celery 4.x yet.
2017-10-13 00:04:27 +02:00
Christopher Grebs 541688d5f2 Upgrade to Celery 4 (#6625)
* Update celery config to seamlessly upgrade to 4.x

* Update celery initialization for new configs and 4.x

* Update dependencies to celery 4.x

* Fix flake8

* Fix typo

* Remove usage of TaskSet, replace with group(), update `ampq`

* Enable redis on travis for better celery 4.x testing

* Fix more test setting names

* Fix lib/celery_tests

* Correct test testing email sending retrying on errors

* Fix celery subtask mocking errors.

* Fix new line

* Fix celery broker url env variable

* Integrate watchdog for celery autoreload

* Try something weird... ui-tests

* do we need extra hosts?

* more sleep?

* Try logging, try docker run to avoid port collisions

* More debugging

* Cleanup again

* Fix logs?

* Ensure dependencies are updated for worker and web container.

* Remove not functioning log saving for onw

* Restart all services after the dependency update
2017-10-12 21:05:21 +02:00
Benjamin Forehand Jr d6bb402a44 Updated UI-tests to run inside of docker and switched to circleci 2.0 (#6457)
* Updated config to use circleci as well as configure ui-tests to run within docker

* Removed hacky certifi installs

* Update requirements to master versions

Fixes #4697 (though not only that)
2017-10-05 13:14:08 +02:00
Christopher Grebs 97342f6a86
Unify and set mysqld collation settings to utf-8.
Fixes #6183
2017-08-17 09:18:06 +02:00
Christopher Grebs ee685116c6
Limit memory ElasticSearch consumes to ~1G, hard limit container to 1G. 2017-07-26 16:18:29 +02:00
Christopher Grebs c35648da19 Potentially fix our reindex issue on -dev.
It took me days to find this and loads of useless refactoring but
apparently these tasks get immediately upgraded to a chord after we
chain them later with the other tasks (after the for-loop).

And, the only requirement for a chord is: do not ignore the results,
never!

Refs #3960

* Make sure index_stats isn't using call_command
* modernize create_subtasks, add support for countdowns, fix queries loading the world...
* half chunk size for stats reindexing
* Refactor stats reindex logging
* Upgrade elasticsearch to 5.4.1 for our docker config
* Make es test setup easier to inherit for our uitests.
* Restore order, make sure to start es before add-on get's created.
* Remove db requirement from es_test fixture
2017-06-16 12:06:12 +08:00
Christopher Grebs efc66b997c Update ElasticSearch, travis and docker-compose configs
* Bump elasticsearch in travis to 2.3.3
* Fix index store config option for es 2.3.3
* Install es 5.1.1
* Fix es reference in travis.yml
* Fix es startup
* Let's try and switch to use jdk8
* Fix bulk_index import
* Set es 5.1 for docker compose too
* Fix docker image to use official elastic images.
* small travis cleanup
* Make sure xpack authentication is disabled for testing (for now)
* Let's try disabling xpack on travis too...
* Stupid hack to support es5 default auth on travis...
* Remove custom travis_es script
* Use ES 5.3 for now...
2017-06-16 12:01:32 +08:00
bqbn 7e6b0a532e Upgrade mysql to v5.7 (#4487) 2017-01-30 12:02:32 -08:00
Stuart Colville ca1fc1a343 Add docs for docker for mac + windows and change port config 2016-09-02 18:28:41 +01:00
Mathieu Pillard ebbc8d3361 Bump elasticsearch version in docker to match other envs 2016-06-21 18:31:26 +01:00
Christopher Grebs 31e104b1ad Set OLYMPIA_SITE_URL to olympia.dev by default. (#2826)
This may fix #2792.
2016-06-02 09:37:03 +02:00
Jason Thomas b793be96bf Change default CELERY_RESULT_BACKEND to redis 2016-05-13 12:37:15 -04:00
Mark Striemer 0d1edc19f2 Allow setting the recursion limit with RECURSION_LIMIT (fixes #1911) 2016-03-15 17:31:26 +01:00
Christopher Grebs 0bc619d312 Fix #1747, remove single quotes as they aren't interpreted as quotes. 2016-02-24 17:45:35 +01:00
Christopher Grebs abac5ea5b3 Update redis configuration.
Use urls from environment and convert them to dictionaries
for redisutil.
2016-02-24 17:13:31 +01:00
Christopher Grebs 81845f9f84 First steps towards Django 1.7 support.
* Upgrade to Django 1.7.10
* Upgrade to Jingo 0.9
* Make sure the app minimalistically runs with Django 1.7
* Upgrades django-waffle and django-cache-machine
* Upgrades to a forked hack of django-piston
* Fixes systems checks
* update redisutils config
* Get rid of Jingo monkey patch.
* Update to proper SafeData support (which now supports __html__)
2016-02-24 17:11:46 +01:00
Kumar McMillan b1c2111262 Update docker image source 2016-02-09 15:16:49 -06:00
Stuart Colville 0eb1637fb3 Fix moz_header CSS refs 2016-01-12 14:46:34 +00:00
Christopher Grebs de65bad022 Fix rabbitmq container configuration, use correct 'expose' format. 2015-12-10 06:32:43 -05:00
Christopher Grebs 8746752006 Pin rabbitmq, redis and memcached images to use our prod-like versions. 2015-12-03 17:52:39 +01:00
Stuart Colville ec4ef86316 Remove name for rabbitmq to fix validation error 2015-11-23 18:27:14 +00:00
Kumar McMillan cb047c39c3 Add SITE_URL to local server from environ variable 2015-10-30 12:39:15 -05:00
Andy McKay bed5082225 run celery through supervisord, plus we can see logs 2015-10-27 14:18:19 -07:00
Kumar McMillan f6a973f753 Lock mysql image into 5.6
The mysql:latest image just got bumped to 5.7 which we're not ready to run yet
2015-10-26 10:38:36 -05:00
Andy McKay dbe399ab6e add in nginx and listen on port 80 2015-10-02 14:15:13 -07:00
Stuart Colville 5bf6773865 Use supervisord for runserver in docker 2015-09-18 12:59:08 +01:00
Stuart Colville 63e035bf25 Run from the hub build 2015-09-16 15:49:40 +01:00