fix: add HOME environment variable to lxc_exec and improve fzf installation test

This commit is contained in:
Jev
2026-04-08 07:21:48 +02:00
parent 6f8b88898f
commit 0e3440ffce
+5 -4
View File
@@ -4,7 +4,7 @@ import subprocess
def lxc_exec(container: str, cmd: str, check: bool = True) -> subprocess.CompletedProcess: def lxc_exec(container: str, cmd: str, check: bool = True) -> subprocess.CompletedProcess:
"""Run a command in the container as the jev user.""" """Run a command in the container as the jev user."""
return subprocess.run( return subprocess.run(
["lxc", "exec", container, "--user", "1000", "--", "bash", "-lc", cmd], ["lxc", "exec", container, "--user", "1000", "--env", "HOME=/home/jev", "--", "bash", "-lc", cmd],
check=check, check=check,
) )
@@ -34,9 +34,10 @@ def test_install_uv(container: str) -> None:
def test_install_fzf(container: str) -> None: def test_install_fzf(container: str) -> None:
run_task(container, "install_fzf") run_task(container, "install_fzf")
for binary in ["fzf", "batcat"]: result = lxc_exec(container, "test -f ~/.fzf/bin/fzf", check=False)
result = lxc_exec(container, f"which {binary}", check=False) assert result.returncode == 0, "fzf binary not found at ~/.fzf/bin/fzf after install_fzf"
assert result.returncode == 0, f"{binary!r} not found after install_fzf" result = lxc_exec(container, "which batcat", check=False)
assert result.returncode == 0, "batcat not found after install_fzf"
def test_install_zoxide(container: str) -> None: def test_install_zoxide(container: str) -> None: