mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 10:14:59 +00:00
fix: Use shell=True for npm test and fix path
This commit is contained in:
parent
674e935cf5
commit
479b5b7064
1 changed files with 9 additions and 2 deletions
|
@ -651,6 +651,8 @@ def run_test_real(
|
||||||
solution_files = config.get("files", {}).get("solution", [])
|
solution_files = config.get("files", {}).get("solution", [])
|
||||||
test_files = config.get("files", {}).get("test", [])
|
test_files = config.get("files", {}).get("test", [])
|
||||||
|
|
||||||
|
dump(original_dname)
|
||||||
|
dump(testdir)
|
||||||
# Copy all solution files
|
# Copy all solution files
|
||||||
for file_path in solution_files:
|
for file_path in solution_files:
|
||||||
src = testdir / Path(file_path)
|
src = testdir / Path(file_path)
|
||||||
|
@ -661,12 +663,14 @@ def run_test_real(
|
||||||
lang_part = str(testdir).split("/exercises/practice/")[0]
|
lang_part = str(testdir).split("/exercises/practice/")[0]
|
||||||
original_fname = (
|
original_fname = (
|
||||||
original_dname
|
original_dname
|
||||||
/ Path(lang_part)
|
/ Path(lang_part).name
|
||||||
/ "exercises"
|
/ "exercises"
|
||||||
/ "practice"
|
/ "practice"
|
||||||
/ testdir.name
|
/ testdir.name
|
||||||
/ file_path
|
/ file_path
|
||||||
)
|
)
|
||||||
|
dump(original_fname)
|
||||||
|
dump(src)
|
||||||
if original_fname.exists():
|
if original_fname.exists():
|
||||||
os.makedirs(src.parent, exist_ok=True)
|
os.makedirs(src.parent, exist_ok=True)
|
||||||
shutil.copy(original_fname, src)
|
shutil.copy(original_fname, src)
|
||||||
|
@ -680,6 +684,8 @@ def run_test_real(
|
||||||
original_fname = original_dname / testdir.name / file_path
|
original_fname = original_dname / testdir.name / file_path
|
||||||
if original_fname.exists():
|
if original_fname.exists():
|
||||||
os.makedirs(src.parent, exist_ok=True)
|
os.makedirs(src.parent, exist_ok=True)
|
||||||
|
dump("2", original_fname)
|
||||||
|
dump("2", src)
|
||||||
shutil.copy(original_fname, src)
|
shutil.copy(original_fname, src)
|
||||||
else:
|
else:
|
||||||
print(f"Warning: Test file not found: {src}")
|
print(f"Warning: Test file not found: {src}")
|
||||||
|
@ -847,7 +853,7 @@ def run_unit_tests(testdir, history_fname, test_files):
|
||||||
".rs": ["cargo", "test", "--", "--include-ignored"],
|
".rs": ["cargo", "test", "--", "--include-ignored"],
|
||||||
".cs": ["dotnet", "test"],
|
".cs": ["dotnet", "test"],
|
||||||
".go": ["go", "test", "./..."],
|
".go": ["go", "test", "./..."],
|
||||||
".js": ["npm", "test"],
|
".js": ["/aider/benchmark/npm-test.sh"],
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get unique file extensions from test files
|
# Get unique file extensions from test files
|
||||||
|
@ -871,6 +877,7 @@ def run_unit_tests(testdir, history_fname, test_files):
|
||||||
text=True,
|
text=True,
|
||||||
timeout=timeout,
|
timeout=timeout,
|
||||||
cwd=testdir,
|
cwd=testdir,
|
||||||
|
shell=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
success = result.returncode == 0
|
success = result.returncode == 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue