feat: configure Celery with per-feature queue lanes and a smoke task
Routes are pre-declared for FC-2/FC-3 task modules (import, ml, thumbnail, download, scan, maintenance). Queue lanes match the ImageRepo pattern where beat+maintenance run on a separate worker so long imports don't starve periodic tasks. Smoke ping task confirms the wiring in eager mode for CI. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
"""Smoke test — celery runs the ping task in eager mode (no broker required)."""
|
||||
|
||||
import pytest
|
||||
|
||||
from backend.app.celery_app import celery
|
||||
from backend.app.tasks.smoke import ping
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def celery_eager():
|
||||
celery.conf.task_always_eager = True
|
||||
celery.conf.task_eager_propagates = True
|
||||
yield
|
||||
celery.conf.task_always_eager = False
|
||||
|
||||
|
||||
def test_ping_returns_pong():
|
||||
result = ping.delay()
|
||||
assert result.get(timeout=1) == "pong"
|
||||
|
||||
|
||||
def test_ping_with_value():
|
||||
result = ping.delay("hello")
|
||||
assert result.get(timeout=1) == "hello"
|
||||
Reference in New Issue
Block a user