Skip to content

Commit 6328855

Browse files
Fixing test failure
1 parent 530c407 commit 6328855

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/datacustomcode/deploy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ def prepare_dependency_archive(
268268
shutil.copy(os.path.join(parent_dir, "requirements.txt"), temp_dir)
269269
shutil.copy(os.path.join(parent_dir, "build_native_dependencies.sh"), temp_dir)
270270
cmd = docker_run_cmd(docker_network, temp_dir)
271-
# Run docker run from parent_dir for consistency
272-
cmd_output(cmd, env=docker_env, cwd=parent_dir)
271+
# Docker run doesn't need cwd since temp_dir is absolute and mounted
272+
cmd_output(cmd, env=docker_env)
273273
if package_type == "function":
274274
source_py_files = os.path.join(temp_dir, "py-files")
275275
if os.path.exists(source_py_files):

tests/test_deploy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def join_side_effect(*args):
131131

132132
# Verify docker run command was called
133133
mock_docker_run_cmd.assert_called_once_with("default", "/tmp/test_dir")
134-
mock_cmd_output.assert_any_call("mock run command", env=ANY, cwd="/test")
134+
mock_cmd_output.assert_any_call("mock run command", env=ANY)
135135

136136
# Verify archives directory was created
137137
mock_makedirs.assert_called_once_with("payload/archives", exist_ok=True)
@@ -219,7 +219,7 @@ def join_side_effect(*args):
219219

220220
# Verify docker run command was called
221221
mock_docker_run_cmd.assert_called_once_with("default", "/tmp/test_dir")
222-
mock_cmd_output.assert_any_call("mock run command", env=ANY, cwd="/test")
222+
mock_cmd_output.assert_any_call("mock run command", env=ANY)
223223

224224
# Verify archives directory was created
225225
mock_makedirs.assert_called_once_with("payload/archives", exist_ok=True)
@@ -491,7 +491,7 @@ def exists_side_effect(path):
491491

492492
# Verify docker run command was called
493493
mock_docker_run_cmd.assert_called_once_with("default", "/tmp/test_dir")
494-
mock_cmd_output.assert_any_call("mock run command", env=ANY, cwd="/test")
494+
mock_cmd_output.assert_any_call("mock run command", env=ANY)
495495

496496
# Verify payload directory was created
497497
mock_makedirs.assert_called_once_with("payload", exist_ok=True)

0 commit comments

Comments
 (0)