fix: use separate port for integration tests to avoid conflicts

Integration tests now use port 8099 via docker-compose.test.yml with an
isolated project name, preventing conflicts with other services running
on port 8000.
This commit is contained in:
2025-11-30 18:16:28 -05:00
parent 6bc29e0841
commit 661be16316
2 changed files with 20 additions and 4 deletions

10
docker-compose.test.yml Normal file
View File

@@ -0,0 +1,10 @@
services:
ffmpeg-worker:
build: .
ports:
- "8099:8000"
volumes:
- ./data:/data
environment:
- DATA_PATH=/data
- FFMPEG_TIMEOUT=3600

View File

@@ -8,7 +8,7 @@ import time
import requests import requests
import os import os
WORKER_URL = "http://localhost:8000" WORKER_URL = "http://localhost:8099"
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
@@ -29,8 +29,11 @@ def docker_compose():
"-c:v", "libx264", "-pix_fmt", "yuv420p", test_input "-c:v", "libx264", "-pix_fmt", "yuv420p", test_input
], check=True, capture_output=True) ], check=True, capture_output=True)
# Start docker-compose # Start docker-compose with test config (uses port 8099 to avoid conflicts)
subprocess.run(["docker-compose", "up", "-d", "--build"], check=True) subprocess.run([
"docker-compose", "-f", "docker-compose.test.yml", "-p", "ffmpeg-worker-test",
"up", "-d", "--build"
], check=True)
# Wait for service to be ready # Wait for service to be ready
for _ in range(30): for _ in range(30):
@@ -47,7 +50,10 @@ def docker_compose():
yield yield
# Cleanup # Cleanup
subprocess.run(["docker-compose", "down"], check=True) subprocess.run([
"docker-compose", "-f", "docker-compose.test.yml", "-p", "ffmpeg-worker-test",
"down"
], check=True)
def test_full_workflow(docker_compose): def test_full_workflow(docker_compose):