Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tests/integration/test_ado_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import os
import shutil
import subprocess
import sys
import tempfile
from pathlib import Path

Expand All @@ -31,7 +32,10 @@ def run_apm_command(cmd: str, cwd: Path, timeout: int = 60) -> subprocess.Comple
apm_path = apm_on_path
else:
# Fallback to local dev venv
apm_path = Path(__file__).parent.parent.parent / ".venv" / "bin" / "apm"
if sys.platform == "win32":
apm_path = Path(__file__).parent.parent.parent / ".venv" / "Scripts" / "apm.exe"
else:
apm_path = Path(__file__).parent.parent.parent / ".venv" / "bin" / "apm"

full_cmd = f"{apm_path} {cmd}"
result = subprocess.run(
Expand Down
23 changes: 16 additions & 7 deletions tests/integration/test_auto_install_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ def teardown_method(self):
"""Clean up test environment."""
os.chdir(self.original_dir)
if os.path.exists(self.test_dir):
shutil.rmtree(self.test_dir)
# ignore_errors=True: on Windows, recently-terminated subprocesses
# may still hold file locks on the temp directory (WinError 32).
# CI temp dirs are ephemeral — safe to leave behind if needed.
shutil.rmtree(self.test_dir, ignore_errors=True)
Comment on lines 71 to +75

def test_auto_install_virtual_prompt_first_run(self, temp_e2e_home):
"""Test auto-install on first run with virtual package reference.
Expand Down Expand Up @@ -126,8 +129,9 @@ def test_auto_install_virtual_prompt_first_run(self, temp_e2e_home):
break

# Wait for graceful shutdown
process.stdout.close()
try:
process.wait(timeout=5)
process.wait(timeout=10)
except subprocess.TimeoutExpired:
process.kill()
process.wait()
Comment on lines 131 to 137
Expand Down Expand Up @@ -185,7 +189,8 @@ def test_auto_install_uses_cache_on_second_run(self, temp_e2e_home):
if "Package installed and ready to run" in line:
process.terminate()
break
process.wait(timeout=5)
process.stdout.close()
process.wait(timeout=10)
except:
process.kill()
process.wait()
Expand Down Expand Up @@ -218,7 +223,8 @@ def test_auto_install_uses_cache_on_second_run(self, temp_e2e_home):
if "Executing" in line or "Package installed and ready to run" in line:
process.terminate()
break
process.wait(timeout=5)
process.stdout.close()
process.wait(timeout=10)
except:
process.kill()
process.wait()
Expand Down Expand Up @@ -265,7 +271,8 @@ def test_simple_name_works_after_install(self, temp_e2e_home):
if "Package installed and ready to run" in line:
process.terminate()
break
process.wait(timeout=5)
process.stdout.close()
process.wait(timeout=10)
except:
process.kill()
process.wait()
Expand Down Expand Up @@ -294,7 +301,8 @@ def test_simple_name_works_after_install(self, temp_e2e_home):
if "Executing" in line or "Auto-discovered" in line:
process.terminate()
break
process.wait(timeout=5)
process.stdout.close()
process.wait(timeout=10)
except:
process.kill()
process.wait()
Expand Down Expand Up @@ -340,7 +348,8 @@ def test_auto_install_with_qualified_path(self, temp_e2e_home):
if "Package installed and ready to run" in line:
process.terminate()
break
process.wait(timeout=5)
process.stdout.close()
process.wait(timeout=10)
except:
process.kill()
process.wait()
Expand Down
Loading