forked from inspirehep/inspire-next
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.test.yml
238 lines (222 loc) · 6.38 KB
/
docker-compose.test.yml
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# INSPIRE is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with INSPIRE. If not, see <http://www.gnu.org/licenses/>.
#
# In applying this license, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.
version: '2.1'
services:
test-service_base:
# Overrides default inspirehep config.
extends:
file: services.yml
service: base
environment:
- APP_SQLALCHEMY_DATABASE_URI=postgresql+psycopg2://inspirehep:dbpass123@test-database:5432/inspirehep
- APP_BROKER_URL=amqp://guest:guest@test-rabbitmq:5672//
- APP_CELERY_RESULT_BACKEND=amqp://guest:guest@test-rabbitmq:5672//
- APP_CACHE_REDIS_URL=redis://test-redis:6379/0
- APP_ACCOUNTS_SESSION_REDIS_URL=redis://test-redis:6379/2
- APP_SEARCH_ELASTIC_HOSTS=test-indexer
unit:
extends:
service: test-service_base
volumes_from:
- test-static
command: bash -c "py.test inspirehep tests/unit && make -C docs html"
disambiguation:
extends:
service: test-service_base
command: py.test tests/integration/disambiguation
volumes_from:
- test-static
depends_on:
test-database:
condition: service_healthy
test-indexer:
condition: service_healthy
test-rabbitmq:
condition: service_healthy
test-redis:
condition: service_healthy
test-worker:
condition: service_started
workflows:
extends:
service: test-service_base
command: py.test tests/integration/workflows
volumes_from:
- test-static
depends_on:
test-database:
condition: service_healthy
test-indexer:
condition: service_healthy
test-rabbitmq:
condition: service_healthy
test-redis:
condition: service_healthy
test-worker:
condition: service_started
integration:
extends:
service: test-service_base
command: py.test tests/integration --ignore tests/integration/disambiguation --ignore tests/integration/workflows
volumes_from:
- test-static
depends_on:
test-database:
condition: service_healthy
test-indexer:
condition: service_healthy
test-rabbitmq:
condition: service_healthy
test-redis:
condition: service_healthy
test-worker:
condition: service_started
acceptance:
extends:
service: test-service_base
command: py.test --driver Remote --host selenium --port 4444 --capability browserName firefox --html=selenium-report.html tests/acceptance
volumes_from:
- test-static
depends_on:
test-database:
condition: service_healthy
test-indexer:
condition: service_healthy
test-rabbitmq:
condition: service_healthy
test-redis:
condition: service_healthy
test-worker:
condition: service_started
selenium:
condition: service_started
test-web:
condition: service_started
environment:
- SERVER_NAME=test-web:5000
visible_acceptance:
extends:
service: test-service_base
command: py.test --driver Firefox --host selenium --port 4444 --capability browserName firefox --html=selenium-report.html tests/acceptance
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
volumes_from:
- test-static
depends_on:
test-database:
condition: service_healthy
test-indexer:
condition: service_healthy
test-rabbitmq:
condition: service_healthy
test-redis:
condition: service_healthy
test-worker:
condition: service_started
selenium:
condition: service_started
test-web:
condition: service_started
environment:
- SERVER_NAME=test-web:5000
- DISPLAY=$DISPLAY
test-web:
extends:
service: test-service_base
command: gunicorn -b 0.0.0.0:5000 -t 3600 -w 1 --access-logfile "-" inspirehep.wsgi_with_coverage:application
volumes_from:
- test-static
depends_on:
test-database:
condition: service_healthy
test-indexer:
condition: service_healthy
test-rabbitmq:
condition: service_healthy
test-redis:
condition: service_healthy
environment:
- APP_SERVER_NAME=test-web:5000
test-worker:
extends:
service: test-service_base
command: celery worker -E -A inspirehep.celery --loglevel=INFO --purge
volumes_from:
- test-static
depends_on:
test-database:
condition: service_healthy
test-indexer:
condition: service_healthy
test-rabbitmq:
condition: service_healthy
test-redis:
condition: service_healthy
test-redis:
image: redis:3.2.3
healthcheck:
timeout: 5s
interval: 5s
retries: 5
test:
- "CMD"
- "bash"
- "-c"
- "exec 3<> /dev/tcp/127.0.0.1/6379 && echo PING >&3 && head -1 <&3 | grep PONG"
test-indexer:
extends:
file: services.yml
service: indexer
healthcheck:
timeout: 5s
interval: 5s
retries: 5
test:
- "CMD-SHELL"
- "curl http://localhost:9200/_cluster/health | grep '.status.:.\\(green\\|yellow\\)'"
test-rabbitmq:
image: rabbitmq
healthcheck:
timeout: 5s
interval: 5s
retries: 5
test:
- "CMD"
- "rabbitmqctl"
- "status"
test-database:
extends:
file: services.yml
service: database
healthcheck:
timeout: 5s
interval: 5s
retries: 5
test:
- "CMD-SHELL"
- "pg_isready --dbname=inspirehep --host=localhost --username=inspirehep"
selenium:
image: selenium/standalone-firefox:2.53.1-beryllium
test-static:
extends:
file: services.yml
service: static