The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
ci: fix home path issue specific to blacksmith runners
Maciej Lisiewski19f6f1482c6d
diff --git a/tests/scripts/install/test_install_sh_shell_path.py b/tests/scripts/install/test_install_sh_shell_path.pyindex 103cc70ceac..38214f145db 100644--- a/tests/scripts/install/test_install_sh_shell_path.py+++ b/tests/scripts/install/test_install_sh_shell_path.py@@ -61,9 +61,16 @@ def _wire(home: Path, runs: int = 1) -> None:assert result.returncode == 0, result.stdout + result.stderr+# The login half of bash's startup ("looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that+# order, and reads and executes commands from the first one that exists and is readable"), run under+# --noprofile: the host's /etc/profile is not part of this contract and may rewrite HOME before bash looks+# for the user files (Blacksmith CI's /etc/profile.d/blacksmith.sh resets it to the runner's passwd home).+_LOGIN_FILES = 'for f in ~/.bash_profile ~/.bash_login ~/.profile; do if [ -r "$f" ]; then . "$f"; break; fi; done'++def _login_path(home: Path) -> list[str]:# Absolute path: the pinned PATH below has no bash on hosts like NixOS.- result = subprocess.run([shutil.which("bash"), "-lc", 'printf %s "$PATH"'],+ result = subprocess.run([shutil.which("bash"), "--noprofile", "--norc", "-c", f'{_LOGIN_FILES}; printf %s "$PATH"'],env={"HOME": str(home), "PATH": "/usr/local/bin:/usr/bin:/bin"},stdin=subprocess.DEVNULL, capture_output=True, text=True, timeout=30, check=False)assert result.returncode == 0, result.stderr