From 1023d0726a355ccdf92fee2dba684d972bd2533a Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 20 Sep 2024 18:43:15 +0000 Subject: [PATCH] p Signed-off-by: kevin --- scripts/pipeline_generator/utils.py | 4 ++-- scripts/tests/pipeline_generator/test_utils.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/pipeline_generator/utils.py b/scripts/pipeline_generator/utils.py index 12911a7..51dd6eb 100644 --- a/scripts/pipeline_generator/utils.py +++ b/scripts/pipeline_generator/utils.py @@ -39,8 +39,8 @@ def get_agent_queue(no_gpu: Optional[bool], gpu_type: Optional[str], num_gpus: O def get_full_test_command(test_commands: List[str], step_working_dir: str) -> str: """Convert test commands into one-line command with the right directory.""" working_dir = step_working_dir or DEFAULT_WORKING_DIR - test_commands_str = "; ".join(test_commands) - return f"cd {working_dir}; {test_commands_str}" + test_commands_str = ";\n".join(test_commands) + return f"cd {working_dir};\n{test_commands_str}" def get_multi_node_test_command( diff --git a/scripts/tests/pipeline_generator/test_utils.py b/scripts/tests/pipeline_generator/test_utils.py index 74ab72f..5281a93 100644 --- a/scripts/tests/pipeline_generator/test_utils.py +++ b/scripts/tests/pipeline_generator/test_utils.py @@ -27,9 +27,9 @@ def test_get_agent_queue(no_gpu: bool, gpu_type: str, num_gpus: int, expected_re @pytest.mark.parametrize( ("test_commands", "step_working_dir", "expected_result"), [ - (["echo 'hello'"], None, "cd /vllm-workspace/tests; echo 'hello'"), - (["echo 'hello'"], "/vllm-workspace/tests", "cd /vllm-workspace/tests; echo 'hello'"), - (["echo 'hello1'", "echo 'hello2'"], None, "cd /vllm-workspace/tests; echo 'hello1'; echo 'hello2'"), + (["echo 'hello'"], None, "cd /vllm-workspace/tests;\necho 'hello'"), + (["echo 'hello'"], "/vllm-workspace/tests", "cd /vllm-workspace/tests;\necho 'hello'"), + (["echo 'hello1'", "echo 'hello2'"], None, "cd /vllm-workspace/tests;\necho 'hello1';\necho 'hello2'"), ], ) def test_get_full_test_command(test_commands: List[str], step_working_dir: str, expected_result: str):