@@ -128,3 +128,73 @@ def test_install_wrapper_translates_installer_flags_for_local_template_run(tmp_p
128128 "GAUSS_SETUP_MODE" : "skip" ,
129129 "GAUSS_RECREATE_VENV" : "1" ,
130130 }
131+
132+
133+ def test_install_wrapper_supports_empty_morph_passthrough_on_bash_nounset (tmp_path ):
134+ repo = tmp_path / "repo"
135+ scripts_dir = repo / "scripts"
136+ scripts_dir .mkdir (parents = True )
137+ shutil .copy2 (REPO_ROOT / "scripts" / "install.sh" , scripts_dir / "install.sh" )
138+
139+ runner_bin = repo / ".opengauss-installer-venv" / "bin"
140+ runner_bin .mkdir (parents = True )
141+ _write_executable (
142+ runner_bin / "python" ,
143+ """#!/usr/bin/env bash
144+ exit 0
145+ """ ,
146+ )
147+
148+ args_log = tmp_path / "morph-noargs.txt"
149+ _write_executable (
150+ runner_bin / "morphcloud" ,
151+ f"""#!/usr/bin/env bash
152+ set -euo pipefail
153+ printf '%s\\ n' "$@" > "{ args_log } "
154+ """ ,
155+ )
156+
157+ fake_bin = tmp_path / "bin"
158+ fake_bin .mkdir ()
159+ _write_executable (
160+ fake_bin / "uv" ,
161+ """#!/usr/bin/env bash
162+ set -euo pipefail
163+ exit 0
164+ """ ,
165+ )
166+ _write_executable (
167+ fake_bin / "tmux" ,
168+ """#!/usr/bin/env bash
169+ set -euo pipefail
170+ exit 1
171+ """ ,
172+ )
173+
174+ env = os .environ .copy ()
175+ env ["PATH" ] = f"{ fake_bin } :{ env ['PATH' ]} "
176+ env ["OPEN_GAUSS_AUTO_ATTACH" ] = "0"
177+
178+ result = subprocess .run (
179+ [
180+ "bash" ,
181+ "scripts/install.sh" ,
182+ "--gauss-home" ,
183+ "/tmp/custom-gauss-home" ,
184+ "--workspace-dir" ,
185+ "/tmp/custom-workspace" ,
186+ "--skip-setup" ,
187+ ],
188+ cwd = repo ,
189+ env = env ,
190+ text = True ,
191+ capture_output = True ,
192+ )
193+ assert result .returncode == 0 , result .stderr + result .stdout
194+ assert args_log .read_text (encoding = "utf-8" ).splitlines () == [
195+ "devbox" ,
196+ "template" ,
197+ "run" ,
198+ "opengauss" ,
199+ "--experimental-run-locally" ,
200+ ]
0 commit comments