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

45 Коммитов

Автор SHA1 Сообщение Дата
Ed Morley 19a87884b3 Bug 1219889 - Travis: Move the job config under matrix.include
So that in a later commit we can split it into several jobs. See:
http://docs.travis-ci.com/user/customizing-the-build/#Explicity-Including-Builds

This is a no-op, done to make later commit diffs clearer.
2015-10-29 20:26:57 +00:00
Mauro Doglio 160be6af71 Bug 1193836 - let django create the test db on travis
Now that we have better integration between  pytest and django we don't
need to create the test db upfront. The test db will be created on the
first test that requiring it,
2015-10-27 11:19:18 +00:00
Mauro Doglio 5930b4f4c1 Bug 1193836 - Use pytest-django to run tests
pytest-django doesn't setup a test database for every single test, but
only for those tests that actually require a db. Tests that require a db
need to either be marked with `@pytest.mark.django_db` or use a fixture
that has a dependency on `db` or `transactional_db`.
Using a non transactional db would make tests execution much faster, but
unfortunately it doesn't play well with the treeherder datasource
creation so I used a transactional_db.

pytest-django also allows you to specify a settings file to use for
tests in a pytest.ini file, which is nicer than monkeypatch the original
settings file in the pytest session start function 😃.
2015-10-27 11:19:13 +00:00
Mauro Doglio d5f847e559 Bug 1193836 - Decouple the jobs and reference databases for test
We were previously using the same database (test_treeherder) for both the
jobs and reference data model. I centralized the new db name in the test
settings file. All the test requiring the jobs db or its repository counterpart
can now access it using the `test_project` fixture, while utility functions use
directly the metioned setting. Where the project name is hardcoded in a static
file, I just replaced it with the new name `test_treeherder_jobs`
2015-10-27 11:18:29 +00:00
Mauro Doglio 247cc3de64 Bug 1193836 - Use a dedicated settings file for testing 2015-10-27 11:18:19 +00:00
Ed Morley f0aac8884a Bug 1205316 - Travis: Use the beta Trusty infra & update to mysql 5.6
Stage/production/Vagrant/Heroku's RDS all use mysql 5.6, however Travis
is currently running v5.5. Installing mysql 5.6 manually on the Travis
container infra is currently broken:
https://github.com/travis-ci/apt-package-whitelist/issues/1206#issuecomment-149884653

To use sudo (for apt-get) we either have to fall back to the legacy
non-container infra, or else use the new Trusty beta infra:
http://blog.travis-ci.com/2015-10-14-opening-up-ubuntu-trusty-beta/
http://docs.travis-ci.com/user/trusty-ci-environment/#Runtimes

The Trusty beta infra is also non-container, but at least isn't EOL.
Unfortunately similar to the legacy non-container infra, it doesn't
offer caching, so incurs a setup time penalty of approx 3 minutes
(including the mysql 5.6 install, npm install and peep install). See:
https://github.com/travis-ci/travis-ci/issues/4997

If/when the container infra uses mysql 5.6 by default, or the bug
preventing installing it using the apt travis.yml option is fixed, we
should switch back to the container infra, to speed up the Travis run.

In this commit, we use `--user` with the peep install, since the
non-container infra doesn't set up a virtualenv, and we cannot use sudo
due to:
https://github.com/travis-ci/travis-ci/issues/4989

In addition, the current user ("travis") now doesn't have permissions to
create the Treeherder DB, so we have to use `-u root` (the password is
blank).

The new infra is running Python 2.7.10 (rather than the v2.7.9 of the
container infra) which now matches what runs in the Vagrant environment.
In future bugs we should update stage/prod and Heroku to 2.7.10 too.
2015-10-22 15:36:18 +01:00
Ed Morley c554745a2c Bug 1192957 - Add isort to the Travis run
Any import style deviations will cause the Travis run to fail, with the
diff output to the Travis log.
2015-10-02 17:55:29 +01:00
Ed Morley 47f807375f Bug 1210546 - Run `grunt build` on Travis
To ensure build script/parsing breakage is detected early.
2015-10-01 21:43:49 +01:00
Ed Morley ad3dc73715 Bug 1199179 - Remove default Django SECRET_KEY
Previously if TREEHERDER_DJANGO_SECRET_KEY was not set, we'd silently
fall back to a default value for SECRET_KEY, meaning we wouldn't realise
we were using an insecure key on a live deployment instance.

With this change, TREEHERDER_DJANGO_SECRET_KEY being missing from the
environment is fatal, resulting in:
"ImproperlyConfigured: The SECRET_KEY setting must not be empty."
2015-08-28 10:03:15 +01:00
Ed Morley 90ba77e596 Bug 1192801 - Remove per-file MPL boilerplate since it's unnecessary
The MPL 2.0 terms state that as long as a LICENSE file is present, the
per-file header text is not required. See "Exhibit A" at the end of:
https://www.mozilla.org/MPL/2.0/
2015-08-18 23:32:11 +01:00
Ed Morley 1af312e0cc Bug 1175432 - Use dj-database-url to simplify DB environment variables
dj-database-url extracts DB host, port, username, password and database
name from the env variable 'DATABASE_URL' (unless another env variable
name is specified). If the env variable is not defined, it falls back to
the default passed to dj_database_url.config().

This means for Heroku and similar we can replace the multiple DB env
variables with just one URL for default & one for read_only.

This also effectively makes the setting of the read only DB variable
mandatory for stage/production/heroku, since DEFAULT_DATABASE_URL won't
be valid for them - so prevents us inadvertently not using the read only
DB.

The deployment script also had to be updated, so that we set the
prod/stage-specific environment variables before using manage.py, since
dj-database-url cannot rely on what's in the stage/prod local.py config
(which isn't a bad thing, since we're deprecating that file).
2015-07-15 14:58:46 +01:00
William Lachance 658927bdf7 Bug 1183367 - Add a grunt target to run eslint on JS frontend 2015-07-14 13:40:18 -04:00
Ed Morley 9371347bc2 Revert "Bug 1175432 - Use dj-database-url to simplify DB environment variables"
This reverts commit 3330b3c567.
2015-07-09 23:05:49 +01:00
Ed Morley 3330b3c567 Bug 1175432 - Use dj-database-url to simplify DB environment variables
dj-database-url extracts DB host, port, username, password and database
name from the env variable 'DATABASE_URL' (unless another env variable
name is specified). If the env variable is not defined, it falls back to
the default passed to dj_database_url.config().

This means for Heroku and similar we can replace the multiple DB env
variables with just one URL for default & one for read_only.

This also effectively makes the setting of the read only DB variable
mandatory for stage/production/heroku, since DEFAULT_DATABASE_URL won't
be valid for them - so prevents us inadvertently not using the read only
DB.

Before this is deployed, we'll need to update the stage/prod puppet
configs & Heroku settings to add the new environment variable.
2015-07-09 17:54:29 +01:00
Ed Morley 58813b0c51 Bug 1169916 - Stop using Cython to build the log parser
Since it only speeds up parsing by a few percent of total runtime, and
is therefore not worth the added complexity for deployment and local
hack-test-debug cycles when working on the log parser.

The .gitignore and update.py entries will be removed in a later commit,
once the stage/prod src directories have been cleaned up.
2015-06-30 14:51:57 +01:00
Ed Morley 82de9c16fd Bug 1160561 - Consolidate rabbitmq prefs
Sets the default values (and now also those used by Vagrant) to the same
as those used by Travis, so we can avoid specifying different values all
over the place.
2015-05-28 16:09:48 +01:00
Ed Morley b10646e74e Bug 1160561 - Consolidate memcached prefs 2015-05-28 16:09:47 +01:00
Ed Morley dec412e12d Bug 1160561 - Consolidate DB prefs
Sets the default values to something sensible, to reduce the number of
prefs we have to set in the environment everywhere.
2015-05-28 16:09:46 +01:00
Ed Morley 27d8f69dee Bug 1169178 - Consolidate peep invocations
There's no need to make multiple calls to peep - we can just combine
them into one. Not changing the puppet instances for Vagrant, since the
calls are made in two separate puppet modules and so would require a bit
of refactoring, which is going to occur in bug 1074151 and friends.
2015-05-28 09:40:20 +01:00
Ed Morley 5ca4afd464 Bug 1166901 - Get the UI tests running as part of the travis run
This merges the service and UI Travis configs, to get the Karma UI tests
running on Travis in the new repo. We can only set 'language' to one
value, however that doesn't matter, since nodejs is installed by default
and all the 'language: node_js' did was set a few default build cycle
steps - and we can define those ourselves manually.

We install the deps using npm install, ensure they are cached by adding
the node_modules directory to the cache list, get xvfb running for Karma
(see http://docs.travis-ci.com/user/gui-and-headless-browsers/) and use
|npm test| to run Karma using karma.conf.js.

The end to end tests (karma-e2e.conf.js) are not currently running, same
as before the repo merge.
2015-05-27 22:18:25 +01:00
Ed Morley 8e67030a35 Bug 1143350 - Use peep instead of pip locally, on Travis & in Docker
We want to start using peep in production, to alleviate security
concerns with the idea of auto-updating packages from PyPI on deploy.
As a first step, we switch to using peep in the Vagrant environment,
on Travis and in the Docker build - so we can confirm the hashes are
correct.

Close bug 1143350.
2015-03-19 12:26:07 +00:00
Ed Morley 25db851ee4 Bug 1143086 - Travis: Run flake8 first & end the job early if it fails
Steps in before_script (and any other part of the build lifecycle apart
from 'script') terminate the run immediately on failure. This means in
the case of flake8 failures, the job changes from "in progress" to
"errored" virtually immediately (with the virtualenv caching changes) so
the user can see the problem and re-push straight away. See:
http://docs.travis-ci.com/user/build-lifecycle/
2015-03-16 12:16:16 +00:00
Ed Morley 3e3bd7c908 Bug 1137278 - Travis: Re-use the virtualenv rather than the pip cache
Whilst making Travis store the pip cache saves us from having to
download the packages from PyPI each time, the vast majority of time
spent during Travis run setup is compiling the packages that contain
binary components. As such, let's try caching the virtualenv itself so
we don't have to repeat this each time. We no longer get Travis to
store the pip cache since it will only be used when the virtualenv is
first created & will bloat the Travis cache archive that has to be
downloaded from AWS at the start of each run.
2015-03-13 15:08:15 +00:00
Ed Morley bfb7f690b7 Bug 1140849 - Travis: Enable email notifications in the case of failures 2015-03-12 20:02:53 +00:00
Ed Morley 71ed4c3ce0 Bug 1070470 - Rename compiled.txt to common.txt
The packages in this file are already a mixture of pure and compiled
packages. It's not worth moving the pure packages to checked-in.txt,
since we'll eventually be removing checked-in.txt and the associated
vendor/ and moving everything in there to this file. As such, common.txt
more accurately reflects the purpose of this file.
2015-03-12 19:04:11 +00:00
Ed Morley da55cc3a1d Bug 1137278 - Travis: Cache the .cache/pip/ directory explicitly
Travis |cache: pip| should do this for us, except it only works if we
don't set our own install step, due to:
https://github.com/travis-ci/travis-ci/issues/3239

Instead, let's manually specify the directory to cache.
2015-03-10 20:42:13 +00:00
Ed Morley 6273d32f7e Bug 1107523 - Run flake8 as part of the Travis build
flake8 is pyflakes+pep8. In a later PR I'll add a mention of it to the
docs - particularly how to set it up as a local git commit hook, but for
now I'm just keen to not regress the passing flake8 run. We may also
need to further tweak the ignore settings in setup.cfg if we find
certain warning types to be too annoying.
2015-03-05 13:51:49 +00:00
Ed Morley e20f4d26fd Bug 1133268 - Travis: Turn off code coverage checks
The code coverage report isn't used anywhere & we'd be better off
hooking coveralls.io or similar up to our repo instead.
2015-03-03 18:47:51 +00:00
Ed Morley 37f998db4c Bug 1137278 - Travis: Move the Cython build step to before_script
The install step is usually only used for dependency installation.
(The Travis build cycle is install -> before_script -> script)
2015-03-03 18:47:51 +00:00
Ed Morley c896e9401b Bug 1137278 - Travis: Switch on caching of pip installed dependencies
From:
http://docs.travis-ci.com/user/caching/#pip-cache
2015-03-03 18:47:50 +00:00
Ed Morley cb5600711f Bug 1137278 - Travis: Remove deprecated --use-mirrors pip option 2015-03-03 18:47:50 +00:00
Ed Morley c2bcb2182e Bug 1137278 - Travis: Allow jobs to run on the new container based infra
Travis have a newer container based stack that runs on EC2, that is both
faster & allows the use of extra features (such as dependency caching):
http://docs.travis-ci.com/user/workers/container-based-infrastructure/
2015-03-03 18:47:49 +00:00
Ed Morley d3bd03a5f4 Bug 1137278 - Travis: Don't pip install packages already in the repo
Dependencies in pure.txt are used directly from the in-repo vendor
directory, so we should not waste time installing them in the virtualenv
during Travis runs.
2015-03-03 18:47:49 +00:00
Cameron Dawson 5cbe0fd843 Bug 1119479 - Remove python 2.6 testing 2015-02-10 11:34:07 -08:00
Jonathan French dbb4d11e09 Bug 1090689 - Add MPL2.0 headers to the repo 2014-11-03 13:06:03 -05:00
mdoglio 86f0202ae6 fix regexp list in the log parser 2013-11-25 16:28:09 +01:00
Jonathan Eads 5f92f0fc45 added memcached to the env 2013-11-21 14:27:51 +00:00
mdoglio a610b95e32 add slow tests to travis config 2013-07-29 15:18:43 +02:00
mdoglio 2d31b7e44d turn off travis notifications 2013-06-27 17:58:04 +01:00
mdoglio 2d12961572 set travis branch to master only 2013-06-27 12:33:42 +01:00
mdoglio 5def56004e add again db creation for travis setup 2013-06-26 00:30:37 +01:00
mdoglio 018a7aab85 add again db creation for travis setup 2013-06-26 00:24:43 +01:00
mdoglio f3afcf23b7 remove db creation from travis config 2013-06-25 23:53:55 +01:00
mdoglio 3b75afe449 set travis env variables as global 2013-06-25 18:05:18 +01:00
mdoglio e5e70a26a0 add travis config file 2013-06-25 15:00:48 +01:00