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:
3636 -e DATABASE_URL=postgres://testuser:testpassword@localhost:5432/testdb \
3737 --network host \
3838 intbot \
39- make test
39+ make in-container/tests
4040
4141 services :
4242 postgres :
4343 image : postgres:16.4
4444 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
4848 ports :
49- - 5432 :5432
49+ - 14672 :5432
5050 options : >-
51- --health-cmd="pg_isready -U testuser -d testdb "
51+ --health-cmd="pg_isready -U intbot_user -d intbot_database_test "
5252 --health-interval=10s
5353 --health-timeout=5s
5454 --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
77
88# Docker
99DOCKER_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 )
1011MANAGE =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
1114
1215# Deployment
1316DEPLOY_CMD =cd deploy && uvx --from "ansible-core" ansible-playbook -i hosts.yml
@@ -108,6 +111,9 @@ in-container/migrate:
108111in-container/manage :
109112 $(MANAGE ) $(ARG )
110113
114+ in-container/tests :
115+ $(CONTAINER_TEST_CMD ) -vvv
116+
111117
112118# Docker management targets
113119# =========================
@@ -118,6 +124,9 @@ docker/build:
118124docker/run/gunicorn :
119125 $(DOCKER_RUN_WITH_PORT ) make in-container/gunicorn
120126
127+ docker/run/tests :
128+ $(DOCKER_RUN ) make in-container/tests
129+
121130
122131# Deploymenet targets
123132# ====================
You can’t perform that action at this time.
0 commit comments