fix: add HOME environment variable to lxc_exec and improve fzf installation test
This commit is contained in:
+5
-4
@@ -4,7 +4,7 @@ import subprocess
|
||||
def lxc_exec(container: str, cmd: str, check: bool = True) -> subprocess.CompletedProcess:
|
||||
"""Run a command in the container as the jev user."""
|
||||
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,
|
||||
)
|
||||
|
||||
@@ -34,9 +34,10 @@ def test_install_uv(container: str) -> None:
|
||||
|
||||
def test_install_fzf(container: str) -> None:
|
||||
run_task(container, "install_fzf")
|
||||
for binary in ["fzf", "batcat"]:
|
||||
result = lxc_exec(container, f"which {binary}", check=False)
|
||||
assert result.returncode == 0, f"{binary!r} not found after install_fzf"
|
||||
result = lxc_exec(container, "test -f ~/.fzf/bin/fzf", check=False)
|
||||
assert result.returncode == 0, "fzf binary not found at ~/.fzf/bin/fzf 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:
|
||||
|
||||
Reference in New Issue
Block a user