Padmanav commited on
Commit
2b92050
·
1 Parent(s): 1838326

fix: add missing 'success' key to run_tests return dict

Browse files
Files changed (1) hide show
  1. app/tools/pytest_runner.py +8 -0
app/tools/pytest_runner.py CHANGED
@@ -35,6 +35,7 @@ def run_tests(local_path: str) -> dict[str, Any]:
35
  "output": "",
36
  "timed_out": False,
37
  "oom_killed": False,
 
38
  }
39
 
40
  # Minimal safe env: inherit PATH so pytest is findable, but strip
@@ -54,6 +55,13 @@ def run_tests(local_path: str) -> dict[str, Any]:
54
  except subprocess.TimeoutExpired:
55
  summary["output"] = "pytest timed out"
56
  summary["timed_out"] = True
 
 
 
 
 
 
 
57
  return summary
58
 
59
  summary["timed_out"] = result["timed_out"]
 
35
  "output": "",
36
  "timed_out": False,
37
  "oom_killed": False,
38
+ "success": False,
39
  }
40
 
41
  # Minimal safe env: inherit PATH so pytest is findable, but strip
 
55
  except subprocess.TimeoutExpired:
56
  summary["output"] = "pytest timed out"
57
  summary["timed_out"] = True
58
+ summary["success"] = (
59
+ not result["timed_out"]
60
+ and not result["oom_killed"]
61
+ and summary["failed"] == 0
62
+ and summary["errors"] == 0
63
+ and summary["passed"] > 0
64
+ )
65
  return summary
66
 
67
  summary["timed_out"] = result["timed_out"]