mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24:59 +00:00
added back timeout
This commit is contained in:
parent
ec4dc74de4
commit
b852c35828
1 changed files with 17 additions and 10 deletions
|
@ -369,20 +369,27 @@ def run_unit_tests(testdir, history_fname):
|
||||||
]
|
]
|
||||||
print(" ".join(command))
|
print(" ".join(command))
|
||||||
|
|
||||||
result = subprocess.run(
|
timeout = 60
|
||||||
command,
|
try:
|
||||||
stdout=subprocess.PIPE,
|
result = subprocess.run(
|
||||||
stderr=subprocess.STDOUT,
|
command,
|
||||||
text=True,
|
stdout=subprocess.PIPE,
|
||||||
)
|
stderr=subprocess.STDOUT,
|
||||||
|
text=True,
|
||||||
res = result.stdout
|
timeout=timeout,
|
||||||
res = cleanup_test_output(res)
|
)
|
||||||
|
except subprocess.TimeoutExpired:
|
||||||
|
success = False
|
||||||
|
res = f"Tests timed out after {timeout} secs!"
|
||||||
|
else:
|
||||||
|
success = result.returncode == 0
|
||||||
|
res = result.stdout
|
||||||
|
res = cleanup_test_output(res)
|
||||||
|
|
||||||
with history_fname.open("a") as fh:
|
with history_fname.open("a") as fh:
|
||||||
fh.write(f"```\n{res}\n```")
|
fh.write(f"```\n{res}\n```")
|
||||||
|
|
||||||
if result.returncode != 0:
|
if not success:
|
||||||
print(f"Tests failed: {testdir}")
|
print(f"Tests failed: {testdir}")
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue