IQ.Pilot Release Commit @ 92b3bb6

This commit is contained in:
IQ.Lvbs CI [bot]
2026-08-31 21:43:09 -05:00
parent dec9bace9f
commit 091e08e893
9 changed files with 125 additions and 2 deletions

View File

@@ -0,0 +1,66 @@
# Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos
import os
from pathlib import Path
import subprocess
IQ_COMMAND = Path(__file__).parents[1] / "iq.sh"
def make_checkout(tmp_path: Path) -> Path:
checkout = tmp_path / "checkout"
(checkout / "iqpilot").mkdir(parents=True)
(checkout / "launch_iqpilot.sh").touch()
return checkout
def run_pkg(checkout: Path, path: Path) -> subprocess.CompletedProcess[str]:
env = os.environ.copy()
env["PATH"] = f"{path}:{env['PATH']}"
return subprocess.run(
["bash", str(IQ_COMMAND), "--dir", str(checkout), "pkg"],
check=False,
capture_output=True,
env=env,
text=True,
)
def test_public_checkout_skips_private_package_source_setup(tmp_path: Path):
checkout = make_checkout(tmp_path)
result = run_pkg(checkout, tmp_path)
assert result.returncode == 0
assert "private package sources are not present" in result.stdout
assert "setup_private_packages.py" not in result.stderr
def test_internal_checkout_runs_private_package_source_setup(tmp_path: Path):
checkout = make_checkout(tmp_path)
setup_script = checkout / "iqpilot/tools/scripts/setup_private_packages.py"
setup_script.parent.mkdir(parents=True)
setup_script.touch()
python_log = tmp_path / "python.log"
python = tmp_path / "python3"
python.write_text(f"#!/usr/bin/env bash\nprintf '%s\\n' \"$*\" > {python_log!s}\n")
python.chmod(0o755)
result = run_pkg(checkout, tmp_path)
assert result.returncode == 0
assert python_log.read_text().strip() == "iqpilot/tools/scripts/setup_private_packages.py"
def test_public_checkout_runs_bundled_package_installer(tmp_path: Path):
checkout = make_checkout(tmp_path)
installer_log = tmp_path / "installer.log"
installer = checkout / "artifacts/runtime/ensure_private_installed.sh"
installer.parent.mkdir(parents=True)
installer.write_text(f"printf installed > {installer_log!s}\n")
result = run_pkg(checkout, tmp_path)
assert result.returncode == 0
assert installer_log.read_text() == "installed"