mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
server: try reconcile both tests webrtc and upload with celery worker
This commit is contained in:
@@ -36,7 +36,13 @@ def dummy_processors():
|
|||||||
mock_long_summary.return_value = "LLM LONG SUMMARY"
|
mock_long_summary.return_value = "LLM LONG SUMMARY"
|
||||||
mock_short_summary.return_value = {"short_summary": "LLM SHORT SUMMARY"}
|
mock_short_summary.return_value = {"short_summary": "LLM SHORT SUMMARY"}
|
||||||
mock_translate.return_value = "Bonjour le monde"
|
mock_translate.return_value = "Bonjour le monde"
|
||||||
yield mock_translate, mock_topic, mock_title, mock_long_summary, mock_short_summary # noqa
|
yield (
|
||||||
|
mock_translate,
|
||||||
|
mock_topic,
|
||||||
|
mock_title,
|
||||||
|
mock_long_summary,
|
||||||
|
mock_short_summary,
|
||||||
|
) # noqa
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
@@ -159,6 +165,11 @@ def celery_config():
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope="session")
|
||||||
|
def celery_includes():
|
||||||
|
return ["reflector.pipelines.main_live_pipeline"]
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def fake_mp3_upload():
|
def fake_mp3_upload():
|
||||||
with patch(
|
with patch(
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class ThreadedUvicorn:
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
async def appserver(tmpdir, celery_session_app, celery_session_worker):
|
async def appserver(tmpdir, setup_database, celery_session_app, celery_session_worker):
|
||||||
from reflector.settings import settings
|
from reflector.settings import settings
|
||||||
from reflector.app import app
|
from reflector.app import app
|
||||||
|
|
||||||
@@ -57,6 +57,7 @@ def celery_includes():
|
|||||||
return ["reflector.pipelines.main_live_pipeline"]
|
return ["reflector.pipelines.main_live_pipeline"]
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("setup_database")
|
||||||
@pytest.mark.usefixtures("celery_session_app")
|
@pytest.mark.usefixtures("celery_session_app")
|
||||||
@pytest.mark.usefixtures("celery_session_worker")
|
@pytest.mark.usefixtures("celery_session_worker")
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
@@ -213,6 +214,7 @@ async def test_transcript_rtc_and_websocket(
|
|||||||
assert audio_resp.headers["Content-Type"] == "audio/mpeg"
|
assert audio_resp.headers["Content-Type"] == "audio/mpeg"
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("setup_database")
|
||||||
@pytest.mark.usefixtures("celery_session_app")
|
@pytest.mark.usefixtures("celery_session_app")
|
||||||
@pytest.mark.usefixtures("celery_session_worker")
|
@pytest.mark.usefixtures("celery_session_worker")
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
|
|||||||
@@ -3,30 +3,9 @@ import asyncio
|
|||||||
from httpx import AsyncClient
|
from httpx import AsyncClient
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
|
||||||
def celery_enable_logging():
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
|
||||||
def celery_config():
|
|
||||||
from tempfile import NamedTemporaryFile
|
|
||||||
|
|
||||||
with NamedTemporaryFile() as f:
|
|
||||||
yield {
|
|
||||||
"broker_url": "memory://",
|
|
||||||
"result_backend": f"db+sqlite:///{f.name}",
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
|
||||||
def celery_includes():
|
|
||||||
return ["reflector.pipelines.main_live_pipeline"]
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("setup_database")
|
@pytest.mark.usefixtures("setup_database")
|
||||||
@pytest.mark.usefixtures("celery_app")
|
@pytest.mark.usefixtures("celery_session_app")
|
||||||
@pytest.mark.usefixtures("celery_worker")
|
@pytest.mark.usefixtures("celery_session_worker")
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_transcript_upload_file(
|
async def test_transcript_upload_file(
|
||||||
tmpdir,
|
tmpdir,
|
||||||
|
|||||||
Reference in New Issue
Block a user