mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
wip
This commit is contained in:
parent
dbdccc42a2
commit
a0844839ca
1 changed files with 13 additions and 3 deletions
|
@ -382,7 +382,7 @@ def run_unit_tests(testdir, history_fname):
|
||||||
DOCKER_IMAGE,
|
DOCKER_IMAGE,
|
||||||
"bash",
|
"bash",
|
||||||
"-c",
|
"-c",
|
||||||
f"pytest /app/{test_file.name}",
|
f"python -m unittest {test_file.name}",
|
||||||
]
|
]
|
||||||
print(" ".join(command))
|
print(" ".join(command))
|
||||||
|
|
||||||
|
@ -398,8 +398,7 @@ def run_unit_tests(testdir, history_fname):
|
||||||
all_tests_passed = False
|
all_tests_passed = False
|
||||||
print(f"Test {test_file} failed")
|
print(f"Test {test_file} failed")
|
||||||
|
|
||||||
# remove timing info, to avoid randomizing the response to GPT
|
res = cleanup_test_output(result.stdout)
|
||||||
res = re.sub(r" in \d+\.\d+s", " in 1.0s", result.stdout)
|
|
||||||
|
|
||||||
except subprocess.TimeoutExpired:
|
except subprocess.TimeoutExpired:
|
||||||
all_tests_passed = False
|
all_tests_passed = False
|
||||||
|
@ -412,6 +411,17 @@ def run_unit_tests(testdir, history_fname):
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
def cleanup_test_output(output):
|
||||||
|
# remove timing info, to avoid randomizing the response to GPT
|
||||||
|
res = re.sub(
|
||||||
|
r"^Ran \d+ tests in \d+\.\d+s$",
|
||||||
|
"",
|
||||||
|
output,
|
||||||
|
flags=re.MULTILINE,
|
||||||
|
)
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
def build_docker():
|
def build_docker():
|
||||||
check_command = ["docker", "images", "-q", DOCKER_IMAGE]
|
check_command = ["docker", "images", "-q", DOCKER_IMAGE]
|
||||||
check_result = subprocess.run(check_command, stdout=subprocess.PIPE, text=True)
|
check_result = subprocess.run(check_command, stdout=subprocess.PIPE, text=True)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue