Add automated tests with GitHub Actions - TP4

This commit is contained in:
Rassaby Ludovic
2025-10-14 13:00:02 +04:00
parent 9add6d9ec4
commit 9d75b6c9e9
9 changed files with 417 additions and 0 deletions
+24
View File
@@ -62,6 +62,30 @@ services:
networks:
- dockezr_network
# Service de test
test:
build:
context: ./backend
dockerfile: Dockerfile.test
container_name: dockezr_test
environment:
DATABASE_URL: postgresql://user:password@db:5432/dockezr
API_BASE_URL: http://backend:8000
depends_on:
db:
condition: service_healthy
backend:
condition: service_started
networks:
- dockezr_network
command: >
sh -c "echo '⏳ Attente du backend...' &&
sleep 15 &&
echo '🧪 Lancement des tests...' &&
pytest test_api.py -v --tb=short"
profiles:
- test
networks:
dockezr_network:
driver: bridge