-
Notifications
You must be signed in to change notification settings - Fork 433
/
Copy pathtox.ini
105 lines (103 loc) · 4.32 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
[tox]
envlist = tests
skipsdist = true
requires =
tox>=3.25.0,<4
tox-envfile
tox-faster
tox-run-command
[testenv]
skip_install = true
setenv =
PYTHONUNBUFFERED = 1
OBJC_DISABLE_INITIALIZE_FORK_SAFETY = YES
dev: DEV = {env:DEV:true}
dev: SENTRY_ENVIRONMENT = {env:SENTRY_ENVIRONMENT:dev}
dev: NEW_RELIC_APP_NAME = {env:NEW_RELIC_APP_NAME:h}
dev: NEW_RELIC_ENVIRONMENT = {env:NEW_RELIC_ENVIRONMENT:dev}
dev,tests,functests: PYTHONDEVMODE = {env:PYTHONDEVMODE:1}
tests: COVERAGE_FILE = {env:COVERAGE_FILE:.coverage.{envname}}
dev: ALEMBIC_CONFIG = {env:ALEMBIC_CONFIG:conf/alembic.ini}
dev: DATABASE_URL = {env:DATABASE_URL:postgresql://postgres@localhost:5432/postgres}
tests: DATABASE_URL = {env:UNITTESTS_DATABASE_URL:postgresql://postgres@localhost:5432/h_tests}
functests: DATABASE_URL = {env:FUNCTESTS_DATABASE_URL:postgresql://postgres@localhost:5432/h_functests}
# Make `import h` work in `make shell`.
dev: PYTHONPATH = .
dev: WEB_CONCURRENCY = {env:WEB_CONCURRENCY:2}
REPORT_FDW_USERS=lms-fdw report-fdw
dev: AUTHORITY = {env:AUTHORITY:localhost}
dev: HTTP_HOST = {env:HTTP_HOST:localhost:5000}
dev: APP_URL = {env:APP_URL:http://localhost:5000}
dev: WEBSOCKET_URL = {env:WEBSOCKET_URL:ws://localhost:5001/ws}
dev: ENABLE_WEB = {env:ENABLE_WEB:true}
dev: ENABLE_WEBSOCKET = {env:ENABLE_WEBSOCKET:true}
dev: ENABLE_WORKER = {env:ENABLE_WORKER:true}
dev: JWE_SECRET_LMS = {env:JWE_SECRET_LMS:SUPER_SECRET}
dev: H_API_AUTH_COOKIE_SECRET_KEY = {env:H_API_AUTH_COOKIE_SECRET_KEY:"dev_h_api_auth_cookie_secret_key"}
dev: H_API_AUTH_COOKIE_SALT = {env:H_API_AUTH_COOKIE_SALT:"dev_h_api_auth_cookie_salt"}
dev: REPLICA_DATABASE_URL = {env:DATABASE_URL:postgresql://postgres@localhost/postgres}
tests: ELASTICSEARCH_INDEX = {env:ELASTICSEARCH_INDEX:hypothesis-tests}
functests: ELASTICSEARCH_INDEX = {env:ELASTICSEARCH_INDEX:hypothesis-functests}
{tests,functests}: AUTHORITY = {env:AUTHORITY:example.com}
passenv =
HOME
PYTEST_ADDOPTS
dev: DEBUG
dev: SENTRY_DSN
dev: NEW_RELIC_LICENSE_KEY
GUNICORN_CERTFILE
GUNICORN_KEYFILE
dev: BOUNCER_URL
dev: CLIENT_OAUTH_ID
dev: CLIENT_RPC_ALLOWED_ORIGINS
dev: CLIENT_URL
dev: GOOGLE_ANALYTICS_MEASUREMENT_ID
dev: SENTRY_DSN_CLIENT
dev: SENTRY_DSN_FRONTEND
dev: SENTRY_ENVIRONMENT
dev: USE_HTTPS
dev: NEW_RELIC_APP_NAME
dev: NODE_ENV
dev: PROXY_AUTH
{tests,functests}: DATABASE_URL
{tests,functests}: ELASTICSEARCH_URL
functests: BROKER_URL
deps =
pip-tools
pip-sync-faster
depends =
coverage: tests
allowlist_externals =
tests,functests: sh
commands_pre =
pip-sync-faster requirements/{env:TOX_ENV_NAME}.txt --pip-args '--disable-pip-version-check'
commands =
tests: sh bin/create-db h_tests
functests: sh bin/create-db h_functests
dev: {posargs:supervisord -c conf/supervisord-dev.conf}
format: ruff check --select I --fix h tests bin
format: ruff format h tests bin
checkformatting: ruff check --select I h tests bin
checkformatting: ruff format --check h tests bin
lint: {posargs:ruff check h tests bin}
{tests,functests}: python3 -m h.scripts.init_db --delete --create
tests: python -m pytest --cov --cov-report= --cov-fail-under=0 {posargs:--numprocesses logical --dist loadgroup tests/unit/}
functests: python -m pytest --failed-first --new-first --no-header --quiet {posargs:tests/functional/}
coverage: coverage combine
coverage: coverage report
typecheck: mypy h
template: python3 bin/make_template {posargs}
docs: sphinx-autobuild -qT --open-browser -b dirhtml -d {envdir}/doctrees docs {envdir}/html
checkdocs: sphinx-build -qTWn -b dirhtml -d {envdir}/doctrees docs {envdir}/html
[testenv:dev]
# By default when you Ctrl-c the `make dev` command tox is too aggressive about
# killing supervisor. tox kills supervisor before supervisor has had time to
# stop or kill its child processes, resulting in detached child processes being
# left running and other problems.
#
# Fix this by configuring tox to wait a long time before sending any further
# SIGINTs (after the first one) or SIGTERMs or SIGKILLs to supervisor.
# Just trust supervisor to clean up all its child processes and stop.
suicide_timeout = 60.0
interrupt_timeout = 60.0
terminate_timeout = 60.0