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

174 Коммитов

Автор SHA1 Сообщение Дата
Dyex719 f305816fd1 Bug 1389592 - Ensure requirements files are compatible with Python 3 (#2722) 2017-09-03 22:35:00 +01:00
Ed Morley a5772e2014 Bug 1388513 - Travis: Switch back to latest Firefox release
Since after bug 1390517 the timeouts are gone.
2017-08-24 11:09:53 +01:00
Ed Morley 81c19cf213 Bug 1392546 - Travis: Store /var/lib/mysql on a ramdisk
This reduces Python test runtime by another 30% on top of the previous
changes. Inspired by:
https://github.com/travis-ci/travis-ci/issues/3049#issuecomment-215084577
2017-08-23 09:39:22 +01:00
Ed Morley a26144306d Bug 1390598 - Upgrade to nodejs 8
This speeds up yarn build by 22% and yarn test by 14%, which helps
with Heroku deploy times.

Changelog:
https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V7.md#7.10.1
https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V8.md#8.4.0
2017-08-18 11:34:31 +01:00
Ed Morley 65abca3fba Bug 1390517 - Travis: Rebalance Python test job chunks
The split of test directories between each Python chunk has been
adjusted to more evenly balance runtime. The `tests/e2e` directory
has been moved from chunk B to chunk A, and the `tests/webapp/embed`
+ `tests/webapp/graphql` directories from chunk C to chunk A.

Short of moving tests in the `tests/webapp/api` directory around,
this is the best we can do for now. Hopefully bug 1348947 can
improve the situation in the future.
2017-08-16 00:54:51 +01:00
Ed Morley ea4440d817 Bug 1390517 - Travis: Reduce duplication in .travis.yml
All but one of the jobs is using `sudo: required`, so it makes more
sense to set it globally, and override on just that one job.
2017-08-16 00:54:51 +01:00
Ed Morley 64099faa72 Bug 1390517 - Travis: Switch to the edge (latest) Trusty image
Travis occasionally update the stable release Trusty image, however
not as often as would be ideal. The newer images now have recent
yarn pre-installed, meaning the manual install steps can be removed.
In addition, the `$HOME/bin` directory now exists by default in the
image.
2017-08-16 00:54:51 +01:00
Ed Morley e66210f691 Bug 1390517 - Travis: Make the selenium job cache node_modules too
Previously the selenium job was spending 20 seconds in `yarn install`.
2017-08-16 00:54:51 +01:00
Ed Morley ca8f46c23e Bug 1390517 - Travis: Switch the JS job to the GCE infrastructure
Whilst the sudo-less EC2 container builds have a faster boot time than
the fully virtualised GCE jobs (1s vs 20-30s), they have less CPU/RAM
available due to resource contention, so are slower than GCE for
longer running jobs.

Switching roughly halves the runtime of this job.
2017-08-16 00:54:51 +01:00
Ed Morley cc490c85ee Bug 1390517 - Travis: Remove sleep after starting xvfb
Since the yarn build takes so long that xvfb already has plenty of
time to start before the tests are run.
2017-08-16 00:54:51 +01:00
Ed Morley f76ae07b97 Bug 1390517 - Travis: Remove redundant upgrade of pip
Since the pre-installed version of pip has now been updated to 9.0.1
already.
2017-08-16 00:54:51 +01:00
Ed Morley 50e583ccff Bug 1388513 - Travis: Downgrade to Firefox 54.0.1 to avoid timeouts
As of a few days ago, the `latest` alias now maps to Firefox 55 rather
than Firefox 54.0.1. However the JS tests for some reason frequently
time out with Firefox 55, so until that's resolved we must explicitly
use the older version.
2017-08-09 10:57:36 +01:00
Ed Morley 270b2b25c1 Bug 1317275 - Run pip check on Travis
Verifies installed packages have compatible dependencies, to help
prevent issues like bug 1324707. This will reduce the time taken to
review pyup bot PRs.

Example output if errors found:
```
Running pip check
celery 3.1.25 has requirement kombu<3.1,>=3.0.37, but you have kombu 4.1.0.
```
2017-08-03 11:40:11 +01:00
Ed Morley e63c8e7f2f Bug 1378361 - Update Elasticsearch from 5.3.1 to 5.5.0
This updates the version used in Vagrant and on Travis to the latest
release. The Heroku addon version will be updated separately to match.

Changes between the two versions:
https://www.elastic.co/guide/en/elasticsearch/reference/5.5/release-notes-5.3.2.html
https://www.elastic.co/guide/en/elasticsearch/reference/5.5/release-notes-5.3.3.html
https://www.elastic.co/guide/en/elasticsearch/reference/5.5/release-notes-5.4.0.html
https://www.elastic.co/guide/en/elasticsearch/reference/5.5/release-notes-5.4.1.html
https://www.elastic.co/guide/en/elasticsearch/reference/5.5/release-notes-5.4.2.html
https://www.elastic.co/guide/en/elasticsearch/reference/5.5/release-notes-5.4.3.html
https://www.elastic.co/guide/en/elasticsearch/reference/5.5/release-notes-5.5.0.html
2017-07-14 13:10:00 +01:00
Ed Morley 225c772e38 Bug 1378433 - Stop vendoring libmysqlclient in Vagrant/Travis
Now that we're using MySQL 5.7 server, there is no longer a conflict
between our desired choice of client library (which had to be 5.7 to
avoid security vulnerabilities) and the server version.

The library is still vendored on Heroku for now (in `bin/pre_compile`),
but that can stop too, once we switch to the Heroku-16 stack which is
based on Ubuntu 16.04 (bug 1365567).
2017-07-07 18:56:12 +01:00
Ed Morley fd75e9ae15 Bug 1378433 - Update to MySQL 5.7 in Vagrant/Travis
The Vagrant environment is running Ubuntu 16.04, which has a native
mysql-server-5.7 package available, so doesn't need a custom APT
repository to be set.

Travis is still on Ubuntu 14.04 (since they don't offer 16.04 yet),
so has to use the upstream mysql.com repository instead.

In the future I'll be switching both Travis and local development to
use the same Docker images to avoid these kind of differences.

After this lands, we'll want to open a PR against the Terraform configs
to switch the treeherder-dev RDS instance to MySQL 5.7, before doing
the same for stage/prod.
2017-07-07 18:56:12 +01:00
William Lachance 5cb5046e41 `yarn run foo` -> `yarn foo` (#2597)
The run is redundant.
2017-06-29 11:32:54 -07:00
Ed Morley 7f20e37437 Bug 1374593 - Travis: Manually update yarn to ensure it's recent
Works around:
https://github.com/travis-ci/travis-ci/issues/7951
2017-06-22 16:39:48 +01:00
Ed Morley 658fcfd24d Bug 1374593 - Travis: Fix Elasticsearch install on new Trusty images
Works around:
https://github.com/travis-ci/travis-ci/issues/7924
2017-06-22 16:39:32 +01:00
Ed Morley 7633331597 Bug 1372180 - Travis: Update geckodriver from 0.14.0 to 0.17.0
In the hope it might fix the intermittent connection timeouts.
2017-06-12 13:59:11 +01:00
Rebecca Billings 1d1f651ce4 Bug 1286686 - Import Selenium tests from treeherder-tests repo (#2302)
Initially these will continue to be run in Jenkins, however later they
will be converted to run on Travis along with the existing local
Selenium tests.
2017-05-16 23:27:45 +01:00
Ed Morley 7aeee8383d Bug 1364010 - Update to nodejs 7.10.0
https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V7.md#7.10.0
2017-05-11 23:10:46 +01:00
Ed Morley 1dc398786a Bug 1364020 - Travis: Remove the now redundant yarn install step
Since as of travis-ci/travis-build#989 the latest yarn is already
installed even when the default `install` step is overridden.
2017-05-11 22:15:32 +01:00
Ed Morley 1e9113c651 Bug 1363333 - Vagrant/Travis: Update pip to 9.0.1
https://pip.pypa.io/en/stable/news/
2017-05-09 12:56:56 +01:00
Ed Morley 18e8971532 Bug 1340554 - Update from Elasticsearch 2.x to 5.x
* ES 5.x now requires JDK 8, and Ubuntu 14.04 only ships with openjdk 7,
  so a third party PPA must be used in Vagrant:
  https://launchpad.net/~openjdk-r/+archive/ubuntu/ppa
* ES 5.x changed the way it manages the heap size, such that:
  - The variables for controlling it have changed (now set via eg
    `ES_JAVA_OPTS="-Xms1g -Xmx1g"` or in the jvm.options file). See:
    https://www.elastic.co/guide/en/elasticsearch/reference/5.2/heap-size.html
  - The default heap size has increased from ~(min:256MB, max:1GB) to
    (min: 2GB, max: 2GB) which causes OOM in the VM, unless either
    lowered back down or the VM RAM increased.
* The Python ES clients must be updated to the latest releases:
  https://elasticsearch-py.readthedocs.io/en/master/#compatibility
* The previous test failures were fixed in #2403.
* The Vagrant provision now also waits for Elasticsearch to be ready
  before trying to run the Django migrations, since Elasticsearch can
  take a while to start (and always has). This prevents failures when
  the pip/yarn install steps are no-ops (when already up to date),
  causing the Django migration to run immediately after the ES install
  step.
2017-04-21 14:38:00 +01:00
Ed Morley 2dc7f227bb Bug 1357491 - Update Vagrant/Travis Elasticsearch from 2.3.5 to 2.4.4
For parity with that already running on Heroku prototype.
2017-04-19 00:47:32 +01:00
Ed Morley 178bfdf385 Bug 1357389 - Update to nodejs 7.9.0
https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V7.md#7.9.0
2017-04-18 13:37:04 +01:00
Casey Williams afa7d63d1d Bug 1336556 - Replace grunt build system with neutrino/webpack 2017-03-29 22:07:24 +01:00
Ed Morley 70fbac5db3 Bug 1318295 - Vagrant: Move mysql setup to shell provisioner
The MySQL service takes several seconds to restart, so we skip doing so
if the config file already exists with the expected content.

The privileges/database creation steps are idempotent and extremely
fast, so it's not worth the boilerplate of checking before running.
2017-03-21 22:48:51 +00:00
Ed Morley 51c386ee21 Bug 1343928 - Switch from npm to yarn
Since it's faster, deterministic and doesn't given obscure errors when
using `--no-bin-links` (which is required for both npm and yarn on
Windows hosts), and as such unblocks the work in bug 1343624.

Many of the commands are the same as with npm. See:
https://yarnpkg.com/en/docs/usage
2017-03-13 15:27:46 +00:00
Ed Morley 245696ef53 Bug 1343624 - Add `npm run lint` as an alias of `grunt checkjs`
For the same reason as the previous commit.

Ideally we'd remove the grunt abstraction entirely and call eslint from
the `lint` command, but we might as well save that to the Neutrino PR.
2017-03-13 15:27:46 +00:00
Ed Morley 21abe6ed75 Bug 1343624 - Add `npm run build` as an alias of `grunt build`
Routing commands via npm/yarn is preferred, since it avoids
having to do global installs of grunt-cli, which simplifies contributor
setup, and means less effort when we switch to Yarn (since it requires
manual PATH setup for globally installed packages).
2017-03-13 15:27:46 +00:00
Ed Morley e1d9a10e71 Bug 1343932 - Update nodejs used on Heroku/Travis from 7.7.1 to 7.7.2
Vagrant uses the latest 7.x.x release, which is now 7.7.2. To reduce
differences between environments whilst the Neutrino/webpack work is
stabilised, it makes sense to update Heroku/Travis again too.
2017-03-10 11:04:38 +00:00
Ed Morley 35ff05e23f Bug 1343932 - Update nodejs used on Heroku/Travis from 6.2.0 to 7.7.1
The npm shrinkwrap was also updated since new nodejs versions come with
new npm, and the format for the shrinkwrap sometimes changes:
https://treeherder.readthedocs.io/common_tasks.html#updating-packages-in-package-json
2017-03-07 17:02:19 +00:00
Casey Williams c4427609a3 Bug 1336556 - Remove unused UI tests
Remove old js test stubs and e2e tests superseded by selenium
2017-03-01 21:35:55 +00:00
William Lachance 70dadece6f Bug 1339547 - Basic set of selenium tests for treeherder 2017-02-16 17:13:30 -05:00
Ed Morley f397b9819b Bug 1326207 - Replace Django system check hack with --fail-level
Django 1.10 added a new `--fail-level` option that allows overriding the
default of only exiting 1 for ERROR and above, avoiding the need to rely
on awk hacks:
https://docs.djangoproject.com/en/1.10/ref/django-admin/#check
2017-01-10 20:39:37 +00:00
Ed Morley 3990b40450 Bug 1292720 - Update Python from 2.7.12 to 2.7.13
For Heroku this also means we'll switch to a Python that was built using
the preferred UCS-4 unicode mode.
2017-01-03 22:01:54 +00:00
William Lachance bfa3def90f Bug 1315808 - New log viewer (#2050)
* Written in react.js for speed
* Does not require custom treeherder backend API's
* Improved scrolling
* Fixes issues in URL when linking directly to line numbers
2016-12-29 15:14:48 -05:00
Ed Morley 2e5ed349ca Bug 1323559 - Travis: Move the Elasticsearch readiness check later
The Elasticsearch background process takes up to 8 seconds to start but
isn't required until the tests run, so needn't block the other setup
tasks from running in parallel.
2016-12-16 08:51:08 -08:00
Ed Morley 1bb5de95b9 Bug 1323559 - Travis: Don't try to start memcached since already running
The service is running by default, so no need to get Travis to start it,
particularly since Travis adds a `sleep` between each service:
00982bc740/lib/travis/build/appliances/services.rb (L30)
2016-12-16 08:51:08 -08:00
Ed Morley 6bd83b3b7d Bug 1323559 - Travis: Switch the container builds to the new Trusty beta
Travis have just announced a beta for container-based Ubuntu Trusty
builds:
https://blog.travis-ci.com/2016-11-08-trusty-container-public-beta/

This means the linter runs can now run on the same version of Ubuntu
used by the other tests and production. This also reduces runtime since
Travis can skip the glibc patching step required on the older image.
2016-12-16 08:51:07 -08:00
Ed Morley 3a42b567f2 Bug 1323559 - Travis: Switch to the newer sudo-enabled image
The image has received several updates, including now defaulting to
mysql-server 5.6:
https://docs.travis-ci.com/user/build-environment-updates/2016-12-01/
...which means we can skip the 20-25s install of mysql-server-5.6.

The issue with Java on the newer image has now been fixed, so we no
longer need to remain on the older (`group: deprecated`) release.
2016-12-16 08:51:07 -08:00
Ed Morley 2633e73d6f Bug 1323584 - Update Python from 2.7.11 to 2.7.12 on Heroku/Travis
To match that being used in Vagrant.

Changelog:
https://hg.python.org/cpython/raw-file/v2.7.12/Misc/NEWS
2016-12-16 08:50:55 -08:00
William Lachance 19ef26b40e Work around travis issue with java (#2012) 2016-12-02 10:33:17 -05:00
James Graham b379a10759 Bug 1315933 - Update npm dependencies, r=emorley
This is required because the older version of grunt-angular-templates
was hanging with component templates. In order to upgrade everything it
was also necessary to switch from grunt-cache-busting, which is no longer
maintained, to grunt-cache-bust, which is.
2016-11-08 12:43:14 +00:00
Ed Morley 36d11bfe0b Bug 1310016 - Remove read_only DB config
Since we no longer have a master-slave setup, and in all environments
DATABASE_URL is identical to DATABASE_RO_URL.
2016-10-14 18:16:50 +01:00
Ed Morley 863925c59d Bug 1296047 - Travis: Use the same MySQL config file as Vagrant
To reduce duplication and ensure the configurations remain in sync.

Note: The Vagrant config does set `bind-address` to allow non-localhost
connections, which isn't necessary on Travis, however this is fine since
(a) it's only Travis, (b) the user grants on Travis won't actually allow
non-localhost connections anyway, even if Travis' network settings
allowed connections between test nodes.
2016-08-23 00:31:48 +01:00
Ed Morley 8e6ef210f1 Bug 1296267 - Travis: Update Elasticsearch to 2.3.5
In addition:
* Quietens curl's output to avoid progress bar logspam.
* Removes the unnecessary dpkg option `--force-confnew` (since it's only
needed if overwriting an existing Elasticsearch installation).
* Reduces the number of places where we duplicate the version number.
2016-08-19 13:11:05 +01:00
Ed Morley a5a899ccd4 Bug 1296267 - Travis: Start rather than restart elasticsearch
Since the service isn't running already, so doesn't need to be stopped
before starting.
2016-08-19 13:11:05 +01:00
Ed Morley 3b1e45ce0c Bug 1289156 - Vendor libmysqlclient 5.7 to protect against CVE-2015-3152
The latest versions of libmysqlclient 5.5/5.6 (used by mysqlclient) are
still vulnerable to TLS stripping, even after last year's backports of
5.7.x fixes:
  - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3152
  - http://bugs.mysql.com/bug.php?id=82383

Ideally we'd just use the standalone Connector/C library instead of the
libmysqlclient packages, however the latest release is too old:
  - http://bugs.mysql.com/bug.php?id=82448

Heroku's cedar-14 stack comes with libmysqlclient 5.5.x, so until it is
updated to 5.7.x (see https://github.com/heroku/stack-images/pull/38) we
must manually vendor 5.7.x ourselves, so that connections between the
Heroku dynos and our public RDS instances are secure. We can do this and
still remain on MySQL server 5.6, since newer client releases are
backwards compatible with older server versions.

Whilst the Vagrant/Travis MySQL instances don't use TLS (and so aren't
affected), we still want them to use libmysqlclient 5.7, to be
consistent with production.

Installing the newer libmysqlclient isn't sufficient on it's own. Any
packages compiled against the older version (in our case mysqlclient)
need to be recompiled. We ensure this happens by pip uninstalling the
existing package if it was already installed.
2016-08-10 11:45:08 +01:00
Ed Morley 07ea1c4db1 Bug 1285539 - Fix 'manage.py check --deploy' on Travis
The `manage.py check --deploy` command causes the Django models to be
initialised, which requires Elasticsearch to be accessible, if
`ELASTICSEARCH_URL` is set. The variable is set globally for the Travis
runs, however for the linters job (which is where `check --deploy` was
previously being run) Elasticsearch isn't actually installed.

Whilst we could have just unset `ELASTICSEARCH_URL` for the linters job,
it's best to move the test to the main Python job chunk, since:
* The command doesn't only hit Elasticsearch, but also the DB, and the
linters job is running the older mysql 5.5, rather than mysql 5.6.
* Whilst Elasticsearch isn't currently enabled for anywhere other than
the prototype Heroku instance, we'll soon be using it everywhere, so
should get `check --deploy` to actually test what we plan to deploy.

Note: The exception during `check --deploy` was not turning the Travis
run red, due to `check --deploy` being piped to awk. When we update to
Django 1.10 the awk workaround can be removed, however in the meantime
we can use the bash `pipefail` option to ensure the exit code from the
`manage.py` command propagates through to the one that Travis sees.
2016-07-11 16:04:15 +01:00
jgraham 52607c2a57 Bug 1268484 - Add elastic-search based matcher for test failure lines (#1488)
Add support for matching test failures where the test, subtest, status,
and expected status are all exact matches, but the message is not an
exact match. The matching uses ElasticSearch and is initially optimised
for cases where the messages differ only in numeric values since this is
a relatively common case.

This commit also adds ElasticSearch to the travis environment.
2016-06-29 11:25:38 +01:00
Ed Morley 7328cc20d8 Bug 1272207 - Update from nodejs 5.3.0 to 6.2.0 on Travis/Heroku
Since it includes improvements to npm as well as nodejs security fixes.
2016-05-26 15:47:12 +01:00
Ed Morley 7240adb939 Bug 1272207 - Travis: Split out webapp/ tests to their own job
Since they are now taking much longer than before (40% of the total
test suite runtime). Prior to this change, chunk A was taking ~9mins
and chunk B ~4 mins. After, the chunk times should be ~{4,4,6}.
2016-05-26 15:47:12 +01:00
Ed Morley 1137d1b229 Bug 1272207 - Travis: Use the APT addon rather than 'apt-get install'
Since it's now the recommended way to install mysql 5.6 (and Travis
maintain the options passed to apt-get install, so will pick the best
defaults):
https://docs.travis-ci.com/user/database-setup/#MySQL-5.6
2016-05-26 15:47:12 +01:00
Ed Morley 940c054c1a Bug 1272207 - Travis: Force virtualenv to use Python 2.7.11
Since if not specified it defaults to `/usr/bin/python`, which on
Travis Precise containers is 2.7.6 and Trusty GCE is 2.7.3, since the
Python 2.7.11 install they provide is not system-installed but instead
just placed on the `PATH`.

This means that until now we've not actually been testing using the
same version of Python as has been running in production :-/
2016-05-26 15:47:12 +01:00
Ed Morley 34b9c631cf Bug 1275796 - Travis: Revert change to apt-get command
One instance was fixed after review comments, this changes the other.
2016-05-26 15:31:31 +01:00
James Graham 18d0fdc8aa Bug 1275425 - Hacky workaround for issues storing astral characters.
Test names, messages, etc. may contain UTF8 characters from beyond the
Basic Multilingual Plane ("astral" characters). Unfortunately MySQL's
"utf8" character set is nothing of the sort and will only store a
maximum of three bytes per character, thus restricting it to BMP
characters. The correct fix to this is to switch to the utf8mb4
character set. Since such a change is somewhat involved, however, we
address the immediate problem with a hack.

When storing failure lines, if the operation fails for character set
related reasons, try again with any non-BMP characters replaced by a
marker of the form <U+codepoint> e.g. <U+10FFFF>.

Note further that whether or not MySQL fails here or silently replaces
each byte of the original character with a U+FFFD replacement character
depends on the value of the sql_mode setting. If this is set to
STRICT_ALL_TABLES, we get an error, otherwise silent data
loss. Therefore it is important this setting is consistent across all
environments.
2016-05-26 14:30:58 +01:00
Ed Morley 9e20b7934d Bug 1247344 - Enable Django system checks during testing and deployment
`manage.py check --deploy` is now run during Travis testing and as part
of stage/prod/Heroku deployment. It checks for a number of common
configuration mistakes & ensures security best practices are being
followed:
https://docs.djangoproject.com/en/1.8/ref/checks/
2016-05-06 16:09:11 +01:00
Ed Morley bf1696eec9 Bug 1247344 - Make the Django secret key longer for testing/development
The Django deploy checks output errors if the secret key is shorter than
50 characters, and we're about to enable it on Travis and in runtest.sh:
https://docs.djangoproject.com/en/1.8/ref/django-admin/#cmdoption-check--deploy
2016-05-06 14:21:54 +01:00
Ed Morley 82373329ca Bug 1270182 - Travis: Enabling caching for the Ubuntu trusty jobs
Since it's now supported:
https://blog.travis-ci.com/2016-05-03-caches-are-coming-to-everyone

This will reduce the job runtime by 60-80s.

Similar to the container job (job chunk 1), since we're now caching the
virtualenv, we have to workaround the default virtualenv being polluted
with existing packages (by creating a clean one in another directory),
to avoid constant cache churn.
2016-05-05 09:32:23 +01:00
Ed Morley fcec28129a Bug 1270182 - Travis: Improve file comments 2016-05-05 09:32:23 +01:00
Ed Morley 531b253528 Bug 1270182 - Travis: Add missing `--disable-pip-version-check`s
Makes all `pip install` invocations consistent.
2016-05-05 09:32:23 +01:00
Ed Morley a1fb2a52e8 Bug 1258676 - Update to pip 8.1.1
https://pip.pypa.io/en/stable/news/
https://github.com/pypa/pip/compare/8.1.0...8.1.1
2016-03-22 12:39:52 +00:00
James Graham 5ff72285c4 Bug 1255087 - Create a lint for ensuring that the heroku Procfile contains the same queues as CELERY_QUEUES in the settings file 2016-03-16 17:46:16 +00:00
Ed Morley fd76450879 Bug 1254961 - Update to pip 8.1.0
To pick up require-hashes improvements, amongst other things:
https://pip.pypa.io/en/stable/news/
https://github.com/pypa/pip/compare/8.0.2...8.1.0

The Vagrant environment's virtualenv has been updated to 15.0.0, since
that includes pip 8.1.0:
https://virtualenv.pypa.io/en/latest/changes.html
https://github.com/pypa/virtualenv/compare/14.0.1...15.0.0
2016-03-09 18:04:54 +00:00
Ed Morley a83f930296 Bug 1213230 - Use pip 8's require-hashes feature instead of peep
As of pip 8, peep has now been integrated into pip.

Migrating from peep to this native feature has several advantages:
* It avoids the complexity/learning curve of using a wrapper around pip.
* It means we do not need to fork the official Heroku Python buildpack
  (which handles pip installation of requirements files) in order to use
  hash verification on Heroku. (Once the buildpack updates to pip 8.)
* Omitted sub-dependencies result in install-time errors rather than
  the user discovering omissions at run-time.
* pip's native caching is used, and all packages are installed in one
  pip invocation, so it's significantly faster.
* It has better handling of errors and corner cases.

Key facts about the native feature:
* hash-checking mode is enabled if at least one hash is found in the
  requirements files passed to pip, or can be force enabled by passing
  `--requires-hashes` when running `pip install`.
* Once enabled, hash-checking mode enforces that all packages:
  - are pinned to a specific version
  - have hashes listed
  - have all sub-dependencies specified
* Older versions of pip will error out if either `--require-hashes` or
  the requirements file `--hash` syntax is used, meaning it's not
  possible to accidentally lose hash-checking protection if the pip used
  is older than expected.

For more details, see:
https://pip.pypa.io/en/stable/user_guide/#hash-checking-mode
https://pip.pypa.io/en/stable/reference/pip_install/#hash-checking-mode

The pip version on Travis and in the Vagrant virtualenv has been updated
to 8.0.2 in bug 1241144, and the stage/prod virtualenv in bug 1241519.
The Heroku Python buildpack pip was updated in bug 1241909.

The requirements files hashes were ported using `peep port`, and then
comments/URLs re-added by hand.
2016-02-15 12:06:17 +00:00
Ed Morley 6382279b98 Bug 1241144 - Travis: Update pip from 8.0.0 to 8.0.2
https://pip.pypa.io/en/stable/news/
2016-01-22 11:58:31 +00:00
Ed Morley e8de12c253 Bug 1241144 - Travis: Update pip from v7.1.2 to v8.0.0
So that we can confirm that peep still operates under pip v8, prior to
the transition from peep to pip v8's new hashing feature.

https://pip.readthedocs.org/en/stable/news/
2016-01-21 11:12:06 +00:00
Ed Morley 9c80f8b885 Bug 1234897 - Use nodejs v5.3.0 on Travis for parity with Heroku 2015-12-23 19:39:11 +00:00
Ed Morley 24de0871f4 Bug 1233091 - Update to Python 2.7.11 on Heroku/Travis 2015-12-21 15:28:57 +00:00
Ed Morley cd353f5e3c Bug 1160561 - Add support for setting BROKER_URL via the environment
The individual RABBITMQ_* variables are never used on their own, so it
makes more sense to switch to a URL variable that combines all of them.

Travis/Vagrant have also had BROKER URL explicitly set, since we're
generally moving away from having testing defaults set in settings.py.

Once stage/prod have BROKER_URL set, we can remove the fallback to the
old variable names, and also remove defaults entirely, making missing
settings fail fast.
2015-11-25 21:48:15 +00:00
Ed Morley 4d7d9f3d3b Bug 1223739 - Travis: Put etl tests in the 2nd chunk to balance runtimes
Previously the python chunks were approx 3m55s and 2m55s respectively,
since we couldn't move one of the largest running directories (etl) to
the second chunk, since the tests would fail due to bug 1219922.

After this change the python chunk runtimes are 3m15s and 3m25s.
2015-11-11 13:07:08 +00:00
Ed Morley 6c5721cee0 Bug 1219889 - Travis: Split the log parser/E2E tests into their own job
Since they take approx 35% of the py.test run time. Ideally we'd move
the ETL tests instead of the E2E ones to this separate job (since they
are more related to the log parsing tests than some of the others, and
would make the split more even), but they currently break when run
standalone, so we'll do that once bug 1219922 is fixed.
2015-10-29 22:11:13 +00:00
Ed Morley 7eb602e41a Bug 1219889 - Travis: Misc command syntax cleanup 2015-10-29 21:51:52 +00:00
Ed Morley 2bde0993db Bug 1219889 - Travis: Use pip rather than peep for the python-tests job
The python-tests job is run on non-container infra so can't use caching.
Peep install takes 60s compared to 30s for pip (part hashing cost, part
peep's unavoidable design inefficiencies due to not being built into
pip), which is painful given that we do a fully install every time due
to lack of caching.

The linters step (which can use caching) is already testing the peep
install works, so we can fall back to plain pip for this job part to
save an extra 30s from the runtime.

This also adds the `language: python` key which was the missing
ingredient to getting a virtualenv set up for us. Now that we're not
using peep, it doesn't matter that the provided virtualenv is using
pip v7.x (which is incompatible with peep).
2015-10-29 21:51:51 +00:00
Ed Morley 99fd1617ec Bug 1219889 - Travis: Break out the JS tests to their own job
Move the JS karma tests and the grunt build smoketest to their own job,
that runs on the container infra. The results are now available after
~50s rather than ~4mins previously. Ad added advantage is that since
we can now use `language: node_js`, we can pin to a specific version,
reducing the chance of breakage.

In addition, the python test run now no longer needs to npm install
(which isn't cacheable) and doesn't have the JS test/grunt build
runtime, saving ~120s.
2015-10-29 21:51:47 +00:00
Ed Morley cfdd90efeb Bug 1219889 - Travis: Break out the linter steps to their own job
Since this job sets `sudo: false`, it will run on the container infra,
so be able to use caching. The `env: linters` is so that a nice label
appears in the Travis sub-job UI, eg see:
https://travis-ci.org/mozilla/treeherder/builds/87763293

We install the full set of node and python dependencies, since
hardcoding just the packages we need here could lead to the versions
getting out of sync with package.json/the pip requirements files. In
addition isort requires a populated virtualenv, and npm sucks if
passing package names directly (it reinstalls them even if installed).
It's worth noting that with the cache, full dependency installation
only takes 2.5s, so this is all moot.

This job (once it has populated the cache) now only takes 24s
end-to-end, whereas previously it would have been ~3.5 mins before the
linters steps had completed.
2015-10-29 20:26:58 +00:00
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