File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,4 +22,14 @@ GF_SECURITY_ADMIN_USER=admin
2222GF_SECURITY_ADMIN_PASSWORD = admin
2323# ==================CADDY==================
2424ADMIN_USER = admin
25- ADMIN_PASSWORD = admin
25+ ADMIN_PASSWORD = admin
26+ # ==================TESTS==================
27+ TEST_POSTGRES_DB = test_analizer
28+ TEST_POSTGRES_PASSWORD =
29+
30+ TEST_DB_ENGINE = postgresql+asyncpg
31+ TEST_DB_NAME = test_analizer
32+ TEST_DB_USER = postgres
33+ TEST_DB_PASSWORD =
34+ TEST_DB_HOST = test_db
35+ TEST_DB_PORT = 5431
Original file line number Diff line number Diff line change 1+ import asyncio
Original file line number Diff line number Diff line change 1111config = Config ('.env' )
1212
1313
14+ class TestDBSettings (BaseModel ):
15+ """
16+ Настройки тестовой базы данных
17+ """
18+
19+
20+
1421class DBSettings (BaseModel ):
1522 """
1623 Настройки DataBase
Original file line number Diff line number Diff line change @@ -68,6 +68,18 @@ services:
6868 env_file :
6969 - .env
7070
71+ test_db :
72+ restart : always
73+ image : postgres:16.3-alpine
74+ volumes :
75+ - test_postgres_data:/var/lib/postgresql/data/
76+ hostname : test_db
77+ expose :
78+ - 5431
79+ environment :
80+ - POSTGRES_DB=${TEST_POSTGRES_DB}
81+ - POSTGRES_PASSWORD=${TEST_POSTGRES_PASSWORD}
82+
7183 prometheus :
7284 image : prom/prometheus
7385 container_name : prometheus
@@ -143,6 +155,7 @@ services:
143155
144156volumes :
145157 postgres_data :
158+ test_postgres_data :
146159 rabbitmq-data :
147160 prometheus-data : {}
148161 grafana-data : {}
You can’t perform that action at this time.
0 commit comments