| 71 | |
| 72 | |
| 73 | def test_bash_string_args(tmpdir, user_script_fp): |
| 74 | bash_script = f""" |
| 75 | ARGS="--prompt 'DeepSpeed is the best'" |
| 76 | echo ${{ARGS}}|xargs deepspeed --num_nodes 1 --num_gpus 1 {user_script_fp} |
| 77 | """ |
| 78 | |
| 79 | bash_fp = tmpdir.join("bash_script.sh") |
| 80 | with open(bash_fp, "w") as f: |
| 81 | f.write(bash_script) |
| 82 | |
| 83 | p = subprocess.Popen(["bash", bash_fp], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 84 | out, err = p.communicate() |
| 85 | assert "ARG PARSE SUCCESS" in out.decode("utf-8"), f"User args not parsed correctly: {err.decode('utf-8')}" |
| 86 | |
| 87 | |
| 88 | def test_add_export_with_special_characters(dummy_runner): |