From 661be163164040e5910ccd26499f97f1ccc7816b Mon Sep 17 00:00:00 2001 From: Bill Date: Sun, 30 Nov 2025 18:16:28 -0500 Subject: [PATCH] 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. --- docker-compose.test.yml | 10 ++++++++++ tests/test_integration.py | 14 ++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 docker-compose.test.yml diff --git a/docker-compose.test.yml b/docker-compose.test.yml new file mode 100644 index 0000000..6c0cb14 --- /dev/null +++ b/docker-compose.test.yml @@ -0,0 +1,10 @@ +services: + ffmpeg-worker: + build: . + ports: + - "8099:8000" + volumes: + - ./data:/data + environment: + - DATA_PATH=/data + - FFMPEG_TIMEOUT=3600 diff --git a/tests/test_integration.py b/tests/test_integration.py index ac41f1c..b3a076a 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -8,7 +8,7 @@ import time import requests import os -WORKER_URL = "http://localhost:8000" +WORKER_URL = "http://localhost:8099" @pytest.fixture(scope="module") @@ -29,8 +29,11 @@ def docker_compose(): "-c:v", "libx264", "-pix_fmt", "yuv420p", test_input ], check=True, capture_output=True) - # Start docker-compose - subprocess.run(["docker-compose", "up", "-d", "--build"], check=True) + # Start docker-compose with test config (uses port 8099 to avoid conflicts) + subprocess.run([ + "docker-compose", "-f", "docker-compose.test.yml", "-p", "ffmpeg-worker-test", + "up", "-d", "--build" + ], check=True) # Wait for service to be ready for _ in range(30): @@ -47,7 +50,10 @@ def docker_compose(): yield # 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):