-
Notifications
You must be signed in to change notification settings - Fork 4
/
tox.ini
181 lines (173 loc) · 5.52 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
[tox]
envlist = py27,translations,docs,ui,build-artifacts,py3
skip_missing_interpreters = True
[testenv]
description = Default testing environment, run unit test suite
deps =
--requirement=requirements.dev.txt
pytest-cov
setenv =
TESTING = true
passenv =
FLASK_APP
LANG
PERSISTENCE_DIR
PG*
REDIS*
SECRET_KEY
SQLALCHEMY_DATABASE_TEST_URI
TRAVIS*
CI
# ignore all tests that require celery in background
# todo: fix tests and remove `--ignore`
commands =
py.test \
--ignore tests/integration_tests \
--cov portal \
--cov-report xml:"{toxinidir}/coverage.xml" \
--ignore tests/test_assessment_engine.py \
--ignore tests/test_clinical.py \
--ignore tests/test_consent.py \
--ignore tests/test_coredata.py \
--ignore tests/test_communication.py \
--ignore tests/test_date_tools.py \
--ignore tests/test_demographics.py \
--ignore tests/test_encounter.py \
--ignore tests/test_exclusion_persistence.py \
--ignore tests/test_fhir.py \
--ignore tests/test_group.py \
--ignore tests/test_healthcheck.py \
--ignore tests/test_i18n.py \
--ignore tests/test_identifier.py \
--ignore tests/test_intervention.py \
--ignore tests/test_model_persistence.py \
--ignore tests/test_next_step.py \
--ignore tests/test_notification.py \
--ignore tests/test_organization.py \
--ignore tests/test_patch_flask_user.py \
--ignore tests/test_patient.py \
--ignore tests/test_portal.py \
--ignore tests/test_practitioner.py \
--ignore tests/test_procedure.py \
--ignore tests/test_qb_timeline.py \
--ignore tests/test_questionnaire_bank.py \
--ignore tests/test_recur.py \
--ignore tests/test_reference.py \
--ignore tests/test_reporting.py \
--ignore tests/test_research_protocol.py \
--ignore tests/test_scheduled_job.py \
--ignore tests/test_site_persistence.py \
--ignore tests/test_table_preference.py \
--ignore tests/test_telecom.py \
--ignore tests/test_timeout.py \
--ignore tests/test_tou.py \
--ignore tests/test_truenth.py \
--ignore tests/test_user_document.py \
--ignore tests/test_user.py \
[]
allowlist_externals = sh
[testenv:celery_background]
description = Environment for tests that require celery running in background
commands =
# start celery in background, only on continuous integration
# Todo: migrate tests to fixtures
sh -c ' \
if [ "$CI" = true ]; then \
celery \
--app portal.celery_worker.celery \
worker \
--detach \
--queues celery,low_priority \
--loglevel info ; \
fi \
'
py.test \
--cov portal \
--cov-report xml:"{toxinidir}/coverage.xml" \
--timeout=3600 \
--timeout_method=thread \
tests/test_assessment_engine.py \
tests/test_clinical.py \
tests/test_consent.py \
tests/test_coredata.py \
tests/test_communication.py \
tests/test_date_tools.py \
tests/test_demographics.py \
tests/test_encounter.py \
tests/test_exclusion_persistence.py \
tests/test_fhir.py \
tests/test_group.py \
tests/test_healthcheck.py \
tests/test_i18n.py \
tests/test_identifier.py \
tests/test_intervention.py \
tests/test_model_persistence.py \
tests/test_next_step.py \
tests/test_notification.py \
tests/test_organization.py \
tests/test_patch_flask_user.py \
tests/test_patient.py \
tests/test_portal.py \
tests/test_practitioner.py \
tests/test_procedure.py \
tests/test_qb_timeline.py \
tests/test_questionnaire_bank.py \
tests/test_recur.py \
tests/test_reference.py \
tests/test_reporting.py \
tests/test_research_protocol.py \
tests/test_scheduled_job.py \
tests/test_site_persistence.py \
tests/test_table_preference.py \
tests/test_telecom.py \
tests/test_timeout.py \
tests/test_tou.py \
tests/test_truenth.py \
tests/test_user_document.py \
tests/test_user.py \
[]
[testenv:docs]
description = Test documentation generation
changedir = docs
commands =
sphinx-build \
-W \
-n \
-b html \
-d {envtmpdir}/doctrees \
source {envtmpdir}/html
[testenv:ui]
description = Run selenium tests
passenv =
{[testenv]passenv}
DISPLAY
SAUCE_*
commands =
sh -c "{toxinidir}/bin/build-frontend-files.sh"
py.test tests/integration_tests/ []
[testenv:build-artifacts]
description = Build docker artifacts and prerequisites (debian package) test deploy and check health
deps = docker-compose>=1.19
skip_install = True
passenv =
DOCKER_IMAGE_TAG
DOCKER_REPOSITORY
setenv =
SECRET_KEY = {env:PYTHONHASHSEED}
SERVER_NAME = localhost:8008
EXTERNAL_PORT = 8008
PORTAL_ENV_FILE = {envtmpdir}/portal.env
COMPOSE_PROJECT_NAME = tox-{envname}
# wait until after first healthcheck occurs
# check health and cleanup
commands =
sh -c "{toxinidir}/tests/test_deploy.sh"
[testenv:translations]
description = Extract frontend and backend strings
setenv =
{[testenv]setenv}
FLASK_APP = {toxinidir}/manage.py
commands =
sh -c "{toxinidir}/bin/extract-frontend-strings.sh"
flask sync
flask extract-i18n