ciyidogan commited on
Commit
391c1a5
·
verified ·
1 Parent(s): ce309a8

Update test_controller.py

Browse files
Files changed (1) hide show
  1. test_controller.py +17 -8
test_controller.py CHANGED
@@ -1,11 +1,20 @@
1
- from fastapi import APIRouter
2
- from log import log
 
3
 
4
  router = APIRouter()
5
 
6
- @router.post("/run")
7
- def run_all_tests():
8
- log("🚦 Running all test scenarios (mock implementation)")
9
- # Burada test runner fonksiyonunu çağıracağız.
10
- # Şimdilik sadece dummy dönüş yapıyoruz.
11
- return {"status": "success", "message": "Test runner triggered (not yet implemented)"}
 
 
 
 
 
 
 
 
 
1
+ from fastapi import APIRouter, Depends
2
+ from app import get_config, ServiceConfig
3
+ import random
4
 
5
  router = APIRouter()
6
 
7
+ @router.get("/run_all")
8
+ def run_all_tests(config: ServiceConfig = Depends(get_config)):
9
+ # Mock test results
10
+ test_results = []
11
+ for project_name in config.projects.keys():
12
+ result = {
13
+ "project": project_name,
14
+ "status": random.choice(["passed", "failed"]),
15
+ "details": f"Mock test for {project_name}"
16
+ }
17
+ test_results.append(result)
18
+
19
+ return {"results": test_results}
20
+