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

198 Коммитов

Автор SHA1 Сообщение Дата
Armen Zambrano 5ca21043df
Make poetry the default method for generating the docs (#6424)
This makes sure that serving the documentation via poetry does not regress
and we have a single way of generating them.

Setting the build backend in `pyproject.toml` makes `pip` to use `poetry` to install the dependencies. By doing so, readthedocs will be able to install the required dependencies to generate the docs (since they don't support poetry directly).
2020-05-15 15:12:35 -04:00
Cameron Dawson da8296d219
Upgrade React Testing Library and React (#6387) 2020-05-07 07:58:26 -07:00
Shubhank Saxena 946b7cf800
Use tox to run Travis tests locally (deprecate runtests.sh) (#6194) 2020-04-17 15:56:33 -04:00
Shubham Kumar 10a2040774 Add markdownlint pre-commit hook and fixed docs
We also add it as part of the Travis execution.
2020-04-07 09:41:54 -04:00
Sarah Clements 29ffbe0ae2
Revert "Run markdown checks in Travis and add it as a pre-commit hook (#6236)" (#6269)
This reverts commit bf67e894b7.
2020-04-03 16:41:16 -04:00
Shubham Kumar bf67e894b7
Run markdown checks in Travis and add it as a pre-commit hook (#6236)
Closes #6185 

- Add markdownlint default rules
- Add `pre-commit` in `dev.txt` with proper hashing required when running Travis
- Add hook in `.pre-commit-config.yaml`
- Refer [here](https://github.com/igorshubovych/markdownlint-cli) for documentation
2020-04-03 09:50:26 -04:00
Kyle Lahnakoski 0fe0362759
Use pip-tools for requirements (#6140)
* update imports, add pip-tools

* first compiled output

* add *.in files (copy of *.txt)

* common.txt from master

* update *.in

* allow upgrade on big-query requirements.txt

* run --upgrade

* example upgrade

* docs

* fix install order

* show how to slim requirements/common.in

* isort

* slim common.in

* isort

* run pip-compile

* fix formatting

* ensure requirements/common.txt is installed last

Co-authored-by: Kyle Lahnakoski <kyle@lahnakoski.com>
2020-04-01 08:15:15 -04:00
Armen Zambrano a3a50d4ccd
Travis: Run Python tests outside of Docker container (#5943)
* Add Travis job to run Python tests outside of Docker
* `runtests.sh` is renamed to `runchecks.sh` and it does not run Python tests
* `manage.py check --deploy` was duplicated in Travis
* Update testing documentation
* Remove `-bb` since it is not needed since Python 3.5
2020-03-20 14:58:11 -04:00
Armen Zambrano 66f8f5d344
Travis: Add Heroku's Python build execution path (#6057)
This increases the chances of not having a Heroku build fail and catch it in Travis instead.

It also cleans up a bit the file and removes incorrect usage of `env` values.
2020-03-10 08:20:24 -04:00
Armen Zambrano b6951b9b89
codecov: Make coverage reporting fluctuate less (#6029)
If any step on the Travis run fails (like formatting checks or a test) then
we don't report the code coverage for it.

Unfortunately, this can be distracting when we see status checks
reporting a failure or a big change.

This change makes code coverage to report even if there are minor
failures.
2020-02-25 08:07:20 -05:00
Armen Zambrano c9d0ec610e
Add missing pytest flag to enable Python code coverage (#5923)
Add removed coverage flag #5860
2020-02-04 08:09:23 -05:00
Armen Zambrano 82efbe2967
Add Python test coverage to codecov (#5921)
Fixes #5853 

Co-authored-by: Shubhank Saxena <saxena.shubhank.19@gmail.com>
2020-02-03 12:03:17 -05:00
Armen Zambrano G fcf6fbd54a travis: Use recommended cache value for yarn 2019-11-13 08:23:12 -05:00
Armen Zambrano G 3e10e1f4df travis: Use specific version of Yarn 2019-11-13 08:23:12 -05:00
Renovate Bot 0a5f430e92 Update Node.js 2019-11-12 13:41:56 -05:00
Armen Zambrano G 3bf343fc9b Fix Node version for Selenium tests 2019-11-11 18:57:28 -05:00
Armen Zambrano G 3ef5bd0785 Be more specific about the node version used for Travis
Sometimes Travis fails because `nvm` would not be able to reach the node package with:

> Failed to install 12. Remote repository may not be reachable.

Perhaps being more specific will help with timing of node releases or more likely hitting the cache.
2019-10-31 10:53:07 -04:00
Armen Zambrano G e02ebacaef Bug 1586777 - Upgrade to Node 12 2019-10-07 14:22:11 -04:00
Armen Zambrano G b418949411 Codecov tweaks
* Only run test coverage in automation
* Fail project status check if it decreases by 2%
2019-09-10 13:51:09 -07:00
Armen Zambrano G f482d2a359 Report code coverage results to codecov 2019-09-10 08:45:22 -04:00
Armen Zambrano G 68fa9d62b1 Add test for generating production build
Up until now we were not testing the same code path that Heroku follows to
generate the front-end build.

Heroku runs the `yarn install` command under `NODE_ENV=production` which causes
only the production dependencies to be installed. In the case of
[PR 5283](#5283), we moved `neutrino`
from `dependencies` to `devDependencies` and went unnoticed until Heroku tried to deploy
the change. See output [1].

This change adds one more entry for Travis where we only install the production dependencies
before running `yarn build`.

[1]
```shell
2019-08-16 19:34:49 -----> Build
2019-08-16 19:34:49        Detected both "build" and "heroku-postbuild" scripts
2019-08-16 19:34:49        Running heroku-postbuild (yarn)
2019-08-16 19:34:50        yarn run v1.17.3
2019-08-16 19:34:50        $ yarn build
2019-08-16 19:34:50        $ node ./node_modules/webpack/bin/webpack.js --mode production
/tmp/build_375161ca12e2f192c2c9b1caab8276cd/node_modules/webpack-cli/bin/cli.js:93
				throw err;
				^
Error: Cannot find module 'neutrino'
```
2019-08-21 12:06:13 -04:00
Armen Zambrano G 76871f8fac Revert "Add test for generating production build"
This reverts commit 0de7751485.
2019-08-16 17:22:46 -04:00
Armen Zambrano G 0de7751485 Add test for generating production build
Up until now we were not testing the same code path that Heroku follows to
generate the front-end build.

Heroku runs the `yarn install` command under `NODE_ENV=production` which causes
only the production dependencies to be installed. In the case of
[PR 5283](https://github.com/mozilla/treeherder/pull/5283), we moved `neutrino`
from `dependencies` to `devDependencies` and went unnoticed until Heroku tried to deploy
the change. See output [1].

This change adds one more entry for Travis where we only install the production dependencies
before running `yarn build`.

[1]
```shell
2019-08-16 19:34:49 -----> Build
2019-08-16 19:34:49        Detected both "build" and "heroku-postbuild" scripts
2019-08-16 19:34:49        Running heroku-postbuild (yarn)
2019-08-16 19:34:50        yarn run v1.17.3
2019-08-16 19:34:50        $ yarn build
2019-08-16 19:34:50        $ node ./node_modules/webpack/bin/webpack.js --mode production
/tmp/build_375161ca12e2f192c2c9b1caab8276cd/node_modules/webpack-cli/bin/cli.js:93
				throw err;
				^
Error: Cannot find module 'neutrino'
```
2019-08-16 17:07:28 -04:00
Armen Zambrano deaf8c850c Bug 1169263 - Switch from Vagrant to docker-compose (#4901)
* Change permissions for docker/entrypoint.sh
* Allow using Django in localhost
* Documentation changes
Allow running shellcheck tests
Use docker-compose for the Selenium tests
Install docs updates
Switch to yarn cache instead of npm
Install UI dependencies
* Add ability to override DATABASE_URL and use a .env file
2019-05-16 14:56:02 -07:00
Sarah Clements 89900be7d9 change node version back to 11 in travis.yml file 2019-03-28 17:54:33 -07:00
Sarah Clements 6127d1134f update node version in travis.yml file 2019-03-15 17:44:45 -07:00
Ed Morley 6945c4c471
Bug 1165259 - Add infrastructure documentation (#4766)
- Adds a new "infrastructure" section to the docs, which describes
  architecture, administration and troubleshooting (fixes bug 1165259).
- Adds code comments to any deployment-related files in the repository.
- Adds documentation for the various ways in which users can access
  Treeherder data (fixes bug 1335172).
- Reorganises the structure of some of the existing non-infrastructure
  docs, to make the documentation easier to navigate.
2019-03-11 21:39:34 +00:00
Sarah Clements 6761c341e6
Make travis use same node version as package.json (#4762)
Ensure node versions for package.json and travis.yml are the same by adding renovate support
2019-03-06 14:08:33 -08:00
Ed Morley 39ba1395ff
Bug 1529243 - Update Python from 3.6 to 3.7 (#4723)
Now possible since Celery/Kombu have been updated in #4722 to version
that are compatible with Python 3.7.

Notable changes:
https://docs.python.org/3/whatsnew/3.7.html
2019-02-28 20:24:02 +00:00
Ed Morley a0d1f5fccf
Bug 1330474 - Travis: Stop testing against Python 2 (#4675)
Since we've been using Python 3 in production for long enough that we're
confident we won't need to roll back to Python 2.
2019-02-25 06:54:46 +00:00
Ed Morley ff2993d2fb
Bug 1330474 - Switch from Python 2.7 to Python 3.6 (#4668)
This makes Heroku/Vagrant use Python 3.6.8 instead of Python 2.7, and
inverts the versions used in the Travis testing matrix - leaving all
unit tests running against Python 2.7 to make it easier to roll back
if needs be. The Vagrant provision script and Heroku Python buildpack will
automatically detect the changed Python version and purge the existing
installation/site-packages prior to installing the new version.

We're using Python 3.6 rather than 3.7, since latest Celery/Kombu do not
yet support Python 3.7 (and we're on an older version anyway; bug 1337717).
Bug 1529243 is filed for updating to Python 3.7 later.
2019-02-21 07:38:24 +00:00
Ed Morley 54fb828ae7
Bug 1528601 - Surface 'BytesWarning's and make them fail the tests (#4655)
Invalid comparisons between bytes and strings will now cause the tests
to fail, making it easier to spot bugs that would appear under Python 3.

If there are any false positives in the future, the errors can be
suppressed using `filterwarnings` in `setup.cfg`.

See:
https://docs.python.org/3.6/using/cmdline.html#cmdoption-b
https://docs.python.org/3.6/library/exceptions.html#BytesWarning
2019-02-20 06:47:39 +00:00
Ed Morley ff26a140ee
Bug 1527020 - Travis: Use Python 3.6.8 instead of 3.7.2 (#4630)
Since Celery/kombu don't yet support Python 3.7:
https://github.com/celery/celery/issues/4500

This isn't seen in tests due to bug 1349362.
2019-02-12 16:43:46 +00:00
Cameron Dawson deb71d65e0 Bug 1364045 - Convert all unit tests to Jest (#4603)
Also remove all Karma support and update the docs to only mention ``Jest``.

One of the test files was testing some AngularJS filters. I converted these
tests to test the equivalent helper functions.
2019-02-12 07:49:50 +00:00
Ed Morley 7060eef007
Bug 1527020 - Travis: Enable unit tests under Python 3 (#4619)
To help prevent regressions whilst the remaining xfailed tests are fixed.
2019-02-11 20:31:20 +00:00
Ed Morley 65287fed30
Bug 1466084 - Docs: Switch to MkDocs and Material theme (#4565)
Switches from Sphinx to MkDocs, since it:
* supports Markdown natively without requiring hacks like `eval_rst`
* validates inline links, ensuring that they are not broken
* has a more pleasant live-reloading dev-server
* supports the nicer looking mkdocs-material theme
* is a third of the size of Sphinx (including deps)

The theme change is now possible since Read the Docs have just started
supporting use of custom themes (previously they would override the theme
and use `readthedocs` theme regardless).
2019-02-06 19:34:08 +00:00
Ed Morley 96fb922072 Bug 1522101 - Use Prettier to format YAML 2019-01-23 20:19:04 +00:00
Ed Morley e583700cb1 Bug 1522101 - Use `prettier --check` to validate formatting
Currently Prettier is used via the ESLint integration, which only supports
JS/JSX and not the other filetypes Prettier is able to format.

For now these additional filetypes are excluded by `.prettierignore`
entries, however these will be removed/fixes applied in later commits.
2019-01-23 20:19:04 +00:00
Ed Morley 4a6095784c
Travis: Remove deprecated `sudo` option (#4253)
Since all jobs are now being run on the GCE infra now, regardless of
what the option is set to:
https://blog.travis-ci.com/2018-10-04-combining-linux-infrastructures
2018-11-09 14:53:38 +00:00
Ed Morley 565ae4c13e
Bug 1364894 - Upgrade from Neutrino 4 to 9 (#4216)
Neutrino controls our frontend linting, transpilation, source-maps,
testing, dev-server and optimisation of production builds.

Highlights of the upgrade are:

* Major version updates to the individual tools within (such as webpack,
  Babel and ESLint), significantly improving performance, fixing
  transpilation/minification correctness bugs, adding support for newer
  ECMAScript features, and increasing linter coverage.
* Hot reloading in the dev server now works for all entry-points and not
  just the jobs view, shortening the feedback cycle.
* Reduced bundle size due to webpack 4's tree shaking, scope hoisting,
  automatic shared/vendor code chunk splitting (no need for the manually
  maintained 'vendor' list).
* CSS is now extracted out of JS, which improves performance, reduces
  bundle size and prevents the initial white flash of un-styled content.
* Support for dynamic imports/code splitting (needed for bug 1502192).
* Support for Jest via a new Jest preset (unblocks bug 1364045).
* Support for public class field declarations (unblocks bug 1480166).
* Improved source-maps (increases the quality of production exception
  trace-backs and fixes several debugger breakpoint bugs).
* Reduced amount of custom configuration required for our fairly complex
  frontend needs, reducing maintenance burden and allowing for easier
  future Neutrino upgrades.

In addition this PR:

* Fixes the WhiteNoise `immutable_file_test()` regex, so that it now
  correctly enables browser caching of images, fonts and source maps.
* Enables webpack-dev-server's overlay feature, which displays any
  compilation errors in the browser, saving having to switch back
  to the console (this can be enabled for warnings too if desired).
* Enables webpack-dev-server's automatic browser-opening feature,
  which saves having to manually navigate to `localhost:5000` after
  running `yarn start`.
* Switches Karma tests to run Firefox in headless mode, reducing the
  workflow disruption when running `yarn test`.
* Uses the new webpack `performance` option to enable maximum asset
  file size thresholds, to help prevent bundle-size regressions.
* Rewrites the `package.json` script commands so that they now work
  correctly on Windows, even when setting environment variables.

Performance comparison:

* Local `yarn build`:
  - Cached: 2m34s -> 23s
  - Uncached: 2m34s -> 58s
* Local `yarn start`:
  - Cached: 34.5s -> 13.6s
  - Uncached: 34.5s -> 31.3s
* Local `yarn test`
  - Cached: 61.5s -> 19.8s
  - Uncached: 61.5s -> 22.0s
* Local `yarn lint`
  - Cached: 3.8s -> 1.8s
  - Uncached: 13.7s -> 13.4s
* Travis end-to-end time:
  9 minutes -> 6 minutes
* Heroku deploy end-to-end time:
  14 minutes -> 9 minutes
2018-11-02 18:48:28 +00:00
Ed Morley 4ee2cd77c5
Bug 1502290 - Update to Node.js 11 (#4193)
https://nodejs.org/en/blog/release/v11.0.0/
2018-10-29 10:45:05 +00:00
Ed Morley 1f3908a4ed Bug 1495520 - Travis: Re-order job matrix/adjust naming
The Python 3 sub-job runs more than just linters, so the old name
was not correct. The comments have been removed since they mostly
duplicate the name in `env`.
2018-10-01 21:30:39 +01:00
Ed Morley ac28d21305 Bug 1495520 - Travis: Switch Python 3 job to GCE infrastructure
Since we need MySQL to be running, and it's no longer started by
default in the non-GCE Docker images:
https://github.com/travis-ci/travis-cookbooks/pull/988#issuecomment-425995190
2018-10-01 21:30:39 +01:00
Ed Morley ae0f12f5ba
Bug 1478344 - Travis: Switch from Ubuntu 14.04 to 16.04 (#3826)
* Adds a `rabbitmq-server` install step, since it's no longer
  installed in the image by default.
* Removes the MySQL 5.7 install step, since Ubuntu 16.04's default
  MySQL is now 5.7 rather than 5.6.
* Adjusts which services are manually started to account for changes
  in which are enabled by default in the new image.
2018-07-26 14:26:32 +02:00
George Hickman 1cce79f59b Move docs Makefile up to project root and build docs there 2018-07-23 12:58:04 +01:00
Ed Morley b880bcd30a
Bug 1460218 - Update to Node 10 (#3531)
Node.js 10 is the new LTS:
https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V10.md#10.1.0

This updates Vagrant, Travis and Heroku (the latter uses the version
from `package.json`) from Node 8.

Travis `yarn build` times are now 15% faster (189s -> 161s).
2018-05-09 11:49:49 +01:00
Ed Morley 8ba5d26a1f
Bug 1458517 - Update to Python 2.7.15 (#3507)
https://github.com/python/cpython/blob/2.7/Misc/NEWS.d/2.7.15rc1.rst
https://github.com/python/cpython/blob/2.7/Misc/NEWS.d/2.7.15.rst
2018-05-03 13:01:21 +01:00
Dave Hunt e63ff9d8bd Migrate test_get_next_results to Travis suite 2018-04-18 13:28:13 +01:00
Ed Morley 023d31885a
Bug 1453850 - Enable Python 2's `-3` mode on Travis (#3444)
This enables `DeprecationWarnings` for things that Python 2 knows
are not compatible with Python 3. The `error` entry in the pytest
`filterwarnings` setting ensures these will be surfaced as Exceptions
and so result in test failures.

See:
https://docs.python.org/2/using/cmdline.html#cmdoption-3

The removal of `sorted()` from `test_bug_job_map_api.py` is to fix:
`DeprecationWarning: dict inequality comparisons not supported in 3.x`
2018-04-13 23:14:36 +01:00
Ed Morley d789f62bf8
Bug 1452904 - Rebalance the Travis test chunks (#3424)
This merges the three separate non-selenium Python test jobs into
one, reducing the overall job count from 7 to 5. This helps avoid
hitting Travis concurrency limits, that delay starting the selenium
job (which is the long pole for the end to end time).
2018-04-10 19:09:05 +01:00