-
Notifications
You must be signed in to change notification settings - Fork 14
/
tox.ini
121 lines (119 loc) · 5.09 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
[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:lms}
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:5433/postgres}
tests: DATABASE_URL = {env:UNITTESTS_DATABASE_URL:postgresql://postgres@localhost:5433/lms_tests}
functests: DATABASE_URL = {env:FUNCTESTS_DATABASE_URL:postgresql://postgres@localhost:5433/lms_functests}
# Make `import lms` work in `make shell`.
dev: PYTHONPATH = .
dev: WEB_CONCURRENCY = {env:WEB_CONCURRENCY:2}
bddtests: DATABASE_URL = {env:BDDTESTS_DATABASE_URL:postgresql://postgres@localhost:5433/lms_bddtests}
dev,functests: H_FDW_DATABASE_URL = {env:H_FDW_DATABASE_URL:postgresql://lms-fdw:password@h_postgres_1:5432/postgres}
dev: BROKER_URL = {env:BROKER_URL:amqp://guest:guest@localhost:5674//}
dev: FEATURE_FLAGS_COOKIE_SECRET = {env:FEATURE_FLAGS_COOKIE_SECRET:notasecret}
dev: FEATURE_FLAGS_ALLOWED_IN_COOKIE = {env:FEATURE_FLAGS_ALLOWED_IN_COOKIE:vitalsource}
dev: H_AUTHORITY = {env:H_AUTHORITY:lms.hypothes.is}
dev: REGION_CODE = {env:REGION_CODE:us}
dev: H_API_URL_PUBLIC = {env:H_API_URL_PUBLIC:http://localhost:5000/api/}
dev: H_API_URL_PRIVATE = {env:H_API_URL_PRIVATE:http://localhost:5000/api/}
dev: MAILCHIMP_DIGESTS_SUBACCOUNT = {env:MAILCHIMP_DIGESTS_SUBACCOUNT:devdata}
dev: MAILCHIMP_DIGESTS_EMAIL = {env:MAILCHIMP_DIGESTS_EMAIL:[email protected]}
dev: MAILCHIMP_DIGESTS_NAME = {env:MAILCHIMP_DIGESTS_NAME:Hypothesis (Dev)}
dev: OAUTH2_STATE_SECRET = {env:OAUTH2_STATE_SECRET:notasecret}
dev: RPC_ALLOWED_ORIGINS = {env:RPC_ALLOWED_ORIGINS:http://localhost:5000}
dev: VIA_URL = {env:VIA_URL:http://localhost:9083}
dev: SESSION_COOKIE_SECRET = {env:SESSION_COOKIE_SECRET:notasecret}
dev: DISABLE_KEY_ROTATION=1
VIA_SECRET = not_a_secret
FDW_USERS = {env:FDW_USERS:report-fdw}
HTTP_HOST = {env:HTTP_HOST:localhost:8001}
tests,functests: REGION_CODE = us
tests,functests: H_AUTHORITY = lms.hypothes.is
passenv =
HOME
PYTEST_ADDOPTS
dev: DEBUG
dev: SENTRY_DSN
dev: NEW_RELIC_LICENSE_KEY
GUNICORN_CERTFILE
GUNICORN_KEYFILE
dev: FEATURE_FLAG_*
dev: GOOGLE_CLIENT_ID
dev: GOOGLE_DEVELOPER_KEY
dev: ONEDRIVE_CLIENT_ID
dev: ADMIN_AUTH_GOOGLE_CLIENT_ID
dev: ADMIN_AUTH_GOOGLE_CLIENT_SECRET
dev: H_CLIENT_ID
dev: H_CLIENT_SECRET
dev: H_JWT_CLIENT_ID
dev: H_JWT_CLIENT_SECRET
dev: MAILCHIMP_API_KEY
dev: LMS_SECRET
dev: VITALSOURCE_API_KEY
dev: BLACKBOARD_API_CLIENT_ID
dev: BLACKBOARD_API_CLIENT_SECRET
dev: JSTOR_API_URL
dev: JSTOR_API_SECRET
dev: DISABLE_KEY_ROTATION
dev: EMAIL_PREFERENCES_SECRET
dev: ADMIN_USERS
dev: HUBSPOT_API_KEY
dev: HUBSPOT_ACCOUNT_ID
deps =
pip-tools
pip-sync-faster
depends =
coverage: tests
allowlist_externals =
tests,functests: sh
bddtests: sh
commands_pre =
pip-sync-faster requirements/{env:TOX_ENV_NAME}.txt --pip-args '--disable-pip-version-check'
commands =
tests: sh bin/create-db lms_tests
functests: sh bin/create-db lms_functests
dev: {posargs:supervisord -c conf/supervisord-dev.conf}
format: ruff check --select I --fix lms tests bin
format: ruff format lms tests bin
checkformatting: ruff check --select I lms tests bin
checkformatting: ruff format --check lms tests bin
lint: ruff check --preview -q lms tests bin
{tests,functests}: python3 -m lms.scripts.init_db --delete --create
tests: python -m pytest --cov --cov-report= --cov-fail-under=0 --numprocesses logical --dist loadgroup --failed-first --new-first --no-header --quiet {posargs:tests/unit/}
functests: python -m pytest --failed-first --new-first --no-header --quiet {posargs:tests/functional/}
coverage: coverage combine
coverage: coverage report
typecheck: mypy lms
template: python3 bin/make_template {posargs}
bddtests: sh bin/create-db lms_bddtests
bddtests: python3 -m lms.scripts.init_db --delete --create
bddtests: behave {posargs:tests/bdd/}
[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