11services :
2-
3- end2endtest :
2+ integration_tests :
43 build :
54 context : ./server/workers/tests
65 dockerfile : ./Dockerfile.tests
7- container_name : end2endtest
8- hostname : " end2endtest "
6+ container_name : integration_tests
7+ hostname : " integration_tests "
98 environment :
109 POSTGRES_USER : ${POSTGRES_USER}
1110 POSTGRES_PASSWORD : ${POSTGRES_PASSWORD}
12- POSTGRES_HOST : ${POSTGRES_HOST}
13- POSTGRES_PORT : ${POSTGRES_PORT}
14- POSTGRES_HOSTS : ${POSTGRES_HOST}
15- POSTGRES_PORTS : ${POSTGRES_PORT}
16- DEFAULT_DATABASE : ${POSTGRES_DATABASE}
11+ POSTGRES_HOSTS : ${POSTGRES_HOSTS}
12+ POSTGRES_PORTS : ${POSTGRES_PORTS}
13+ DEFAULT_DATABASE : ${POSTGRES_DB}
1714 SERVICE_VERSION : " test_version"
1815 ports :
1916 - " 7575:80"
@@ -23,46 +20,55 @@ services:
2320 - db
2421 - backend
2522 restart : " no"
26- entrypoint : ["pytest", '/app/workers/tests/test_end2end.py', '-s', '-rfA']
23+ entrypoint :
24+ ["pytest", "/app/workers/tests/integration-tests.py", "-s", "-rfA"]
2725 networks :
2826 - test
2927
3028 db :
31- container_name : ${POSTGRES_HOST }
32- image : ' postgres:12.2-alpine'
29+ container_name : ${POSTGRES_HOSTS }
30+ image : " postgres:12.2-alpine"
3331 restart : " no"
34- hostname : ${POSTGRES_HOST }
32+ hostname : ${POSTGRES_HOSTS }
3533 environment :
3634 POSTGRES_USER : ${POSTGRES_USER}
3735 POSTGRES_PASSWORD : ${POSTGRES_PASSWORD}
38- POSTGRES_PORT : ${POSTGRES_PORT }
39- DEFAULT_DATABASE : ${POSTGRES_DATABASE }
36+ POSTGRES_PORT : ${POSTGRES_PORTS }
37+ DEFAULT_DATABASE : ${POSTGRES_DB }
4038 command : postgres -c config_file=/etc/postgresql.conf -c hba_file=/etc/pg_hba.conf
4139 volumes :
4240 - ./server/workers/tests/test_data/pg_hba_test_local.conf:/etc/pg_hba.conf
4341 - ./server/workers/tests/test_data/postgresql_test_local.conf:/etc/postgresql.conf
4442 ports :
45- - " ${POSTGRES_PORT }:${POSTGRES_PORT }"
43+ - " ${POSTGRES_PORTS }:${POSTGRES_PORTS }"
4644 networks :
4745 - test
4846
4947 redis :
50- image : ' redis:6.0-alpine'
51- restart : unless-stopped
52- hostname : " ${REDIS_HOST}"
53- # container_name: "${REDIS_HOST}"
54- environment :
55- REDIS_HOST : " ${REDIS_HOST}"
56- REDIS_PORT : " ${REDIS_PORT}"
57- REDIS_PASSWORD : " ${REDIS_PASSWORD}"
58- command : ["redis-server", "/etc/redis/redis.conf", "--bind", "${REDIS_HOST}", "--port", "${REDIS_PORT}"]
59- volumes :
60- - ' redis:/var/lib/redis/data'
61- - ./local_dev/redis.conf:/etc/redis/redis.conf
62- ports :
48+ image : " redis:6.0-alpine"
49+ restart : unless-stopped
50+ hostname : " ${REDIS_HOST}"
51+ # container_name: "${REDIS_HOST}"
52+ environment :
53+ REDIS_HOST : " ${REDIS_HOST}"
54+ REDIS_PORT : " ${REDIS_PORT}"
55+ REDIS_PASSWORD : " ${REDIS_PASSWORD}"
56+ command :
57+ [
58+ " redis-server" ,
59+ " /etc/redis/redis.conf" ,
60+ " --bind" ,
61+ " ${REDIS_HOST}" ,
62+ " --port" ,
63+ " ${REDIS_PORT}" ,
64+ ]
65+ volumes :
66+ - " redis:/var/lib/redis/data"
67+ - ./local_dev/redis.conf:/etc/redis/redis.conf
68+ ports :
6369 - " 127.0.0.1:${REDIS_PORT}:${REDIS_PORT}"
64- networks :
65- - test
70+ networks :
71+ - test
6672
6773 api :
6874 build :
@@ -81,13 +87,13 @@ services:
8187 FLASK_ENV : " ${FLASK_ENV}"
8288 POSTGRES_USER : " ${POSTGRES_USER}"
8389 POSTGRES_PASSWORD : " ${POSTGRES_PASSWORD}"
84- POSTGRES_HOST : " ${POSTGRES_HOST }"
85- DEFAULT_DATABASE : " ${POSTGRES_DATABASE }"
90+ POSTGRES_HOST : " ${POSTGRES_HOSTS }"
91+ DEFAULT_DATABASE : " ${POSTGRES_DB }"
8692 command : ["python", "api/tests/mock_app.py"]
8793 depends_on :
8894 - redis
8995 - db
90- networks :
96+ networks :
9197 - test
9298
9399 persistence :
@@ -101,11 +107,11 @@ services:
101107 SERVICE_VERSION : " test"
102108 BEHIND_PROXY : " false"
103109 FLASK_ENV : " development"
104- POSTGRES_HOSTS : ${POSTGRES_HOST }
105- POSTGRES_PORTS : ${POSTGRES_PORT }
110+ POSTGRES_HOSTS : ${POSTGRES_HOSTS }
111+ POSTGRES_PORTS : ${POSTGRES_PORTS }
106112 POSTGRES_USER : ${POSTGRES_USER}
107113 POSTGRES_PASSWORD : ${POSTGRES_PASSWORD}
108- DEFAULT_DATABASE : ${POSTGRES_DATABASE }
114+ DEFAULT_DATABASE : ${POSTGRES_DB }
109115 volumes :
110116 - ./server/workers/tests/mock_app.py:/persistence/mock_app.py
111117 command : ["python", "mock_app.py"]
0 commit comments