forked from mozilla/treeherder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
76 lines (69 loc) · 2.36 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
[tox]
envlist = py37
isolated_build = true
skipsdist=True
toxworkdir={toxinidir}/.tox
[testenv]
whitelist_externals =
sh
docker-compose
commands_pre =
docker-compose up --detach mysql redis rabbitmq
pip install -r {toxinidir}/requirements/dev.txt
pip install -r {toxinidir}/requirements/common.txt
commands =
{toxinidir}/manage.py check
sh -c "SITE_URL=https://treeherder.dev TREEHERDER_DEBUG=False ./manage.py check --deploy --fail-level WARNING"
# Running slow tests (DB required)
pytest tests/ --runslow
commands_post =
# This is to deal with running the containers with --detached
docker-compose down
[testenv:linters]
commands_pre =
pip install -r {toxinidir}/requirements/dev.txt
pip install -r {toxinidir}/requirements/common.txt
commands =
pip check
{toxinidir}/lints/queuelint.py
# This ensures that we don't loose the ability of installing locally pre-commit checks
pre-commit run --all-files
commands_post =
[testenv:docs]
commands_pre =
pip install poetry
poetry install --extras "docs"
commands =
mkdocs build
commands_post =
# This build is configured to catch issues on PRs that would only be detected as
# part of Heroku's build step when the code has already been merged to master.
# The step ./bin/post_compile requires the output of `yarn build`, thus, we need
# to build both the JS and Python builds
# In Heroku, the JS dev dependencies are *not* installed because the env variable
# YARN_PRODUCTION is detected by the buildpack, however, yarn does not care about
# that and needs an explicit flag (`--prod`)
# https://devcenter.heroku.com/articles/nodejs-support#only-installing-dependencies
# NODE_ENV=production is implicit as part of the command `yarn build` with `--mode production`
[testenv:heroku]
whitelist_externals =
yarn
post_compile
commands_pre =
pip install -r requirements.txt
yarn install --prod
commands =
yarn heroku-postbuild
./manage.py collectstatic --noinput
# This generates the revision and does the Brotly/Gzip compression
{toxinidir}/./bin/post_compile
commands_post =
[testenv:docker]
whitelist_externals=
docker-compose
commands_pre =
docker-compose build
commands =
docker-compose run -e TREEHERDER_DEBUG=False backend bash -c "pytest --cov --cov-report=xml tests/ --runslow"
[flake8]
per-file-ignores = treeherder/model/models.py:E402