"""Task 端到端真跑临时验证脚本。 手动运行: cd backend && python3 test_3sets_e2e.py """ import sys sys.path.insert(0, "/app") def main(): from app.core.database import SessionLocal from app.models.task import GenerationTask from app.constants.enums import TaskStatus from app.workers.tasks import run_generation_pipeline db = SessionLocal() try: task = GenerationTask( workspace_id=3, product_id=1, operator_id=3, theme="伪素颜·黄黑皮提亮·3套正交", text_count=1, image_count=2, track="ai", need_product_image=True, status=TaskStatus.PENDING, ) db.add(task) db.commit() db.refresh(task) task_id = task.id print(f"建task成功 task_id={task_id} image_count=2 (期望3套×2=6张)") finally: db.close() print(f"=== 同步执行 run_generation_pipeline({task_id}) ===") result = run_generation_pipeline.apply(args=[task_id]).get() print(f"=== 结果: {result} ===") if __name__ == "__main__": main()