flare / test_controller.py
ciyidogan's picture
Update test_controller.py
6aaab23 verified
raw
history blame
632 Bytes
from fastapi import APIRouter, HTTPException, Request, Depends
from config_provider import get_config, ServiceConfig
from service_config import ServiceConfig
import random
router = APIRouter()
@router.get("/run_all")
def run_all_tests(config: ServiceConfig = Depends(get_config)):
# Mock test results
test_results = []
for project_name in config.projects.keys():
result = {
"project": project_name,
"status": random.choice(["passed", "failed"]),
"details": f"Mock test for {project_name}"
}
test_results.append(result)
return {"results": test_results}