File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -36,19 +36,19 @@ jobs:
36
36
-e DATABASE_URL=postgres://testuser:testpassword@localhost:5432/testdb \
37
37
--network host \
38
38
intbot \
39
- make test
39
+ make in-container/tests
40
40
41
41
services :
42
42
postgres :
43
43
image : postgres:16.4
44
44
env :
45
- POSTGRES_USER : testuser
46
- POSTGRES_PASSWORD : testpassword
47
- POSTGRES_DB : testdb
45
+ POSTGRES_USER : intbot_user
46
+ POSTGRES_PASSWORD : intbot_password
47
+ POSTGRES_DB : intbot_database_test
48
48
ports :
49
- - 5432 :5432
49
+ - 14672 :5432
50
50
options : >-
51
- --health-cmd="pg_isready -U testuser -d testdb "
51
+ --health-cmd="pg_isready -U intbot_user -d intbot_database_test "
52
52
--health-interval=10s
53
53
--health-timeout=5s
54
54
--health-retries=5
Original file line number Diff line number Diff line change @@ -7,7 +7,10 @@ UV_RUN_DEV=cd intbot && DJANGO_ENV="dev" uv run
7
7
8
8
# Docker
9
9
DOCKER_RUN_WITH_PORT =docker run -p 4672:4672 --add-host=host.internal:host-gateway -e DJANGO_ENV="local_container" -it intbot:$(V )
10
+ DOCKER_RUN =docker run --add-host=host.internal:host-gateway -e DJANGO_ENV="test" -it intbot:$(V )
10
11
MANAGE =cd intbot && ./manage.py
12
+ # In container we run with migrations
13
+ CONTAINER_TEST_CMD=DJANGO_SETTINGS_MODULE ="intbot.settings" DJANGO_ENV="test" pytest --migrations
11
14
12
15
# Deployment
13
16
DEPLOY_CMD =cd deploy && uvx --from "ansible-core" ansible-playbook -i hosts.yml
@@ -108,6 +111,9 @@ in-container/migrate:
108
111
in-container/manage :
109
112
$(MANAGE ) $(ARG )
110
113
114
+ in-container/tests :
115
+ $(CONTAINER_TEST_CMD ) -vvv
116
+
111
117
112
118
# Docker management targets
113
119
# =========================
@@ -118,6 +124,9 @@ docker/build:
118
124
docker/run/gunicorn :
119
125
$(DOCKER_RUN_WITH_PORT ) make in-container/gunicorn
120
126
127
+ docker/run/tests :
128
+ $(DOCKER_RUN ) make in-container/tests
129
+
121
130
122
131
# Deploymenet targets
123
132
# ====================
You can’t perform that action at this time.
0 commit comments