Skip to content

Commit 2e699d7

Browse files
claytonparnellknikure
authored andcommitted
add testing
1 parent 5d98320 commit 2e699d7

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/sagemaker/processing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,7 @@ def _pack_and_upload_code(
17301730
"sagemaker_session unspecified when creating your Processor to have one set up "
17311731
"automatically."
17321732
)
1733-
if ("sourcedir.tar.gz" in estimator.uploaded_code.s3_prefix):
1733+
if ("/sourcedir.tar.gz" in estimator.uploaded_code.s3_prefix):
17341734
# Upload the bootstrapping code as s3://.../jobname/source/runproc.sh.
17351735
entrypoint_s3_uri = estimator.uploaded_code.s3_prefix.replace(
17361736
"sourcedir.tar.gz",

tests/integ/test_xgboost.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,26 @@ def xgboost_training_job(
4040
)
4141

4242

43+
def test_sourcedir_naming(
44+
sagemaker_session,
45+
xgboost_latest_version,
46+
xgboost_latest_py_version,
47+
cpu_instance_type,
48+
):
49+
with pytest.raises(RuntimeError):
50+
processor = XGBoostProcessor(
51+
framework_version=xgboost_latest_version,
52+
role=ROLE,
53+
instance_count=1,
54+
instance_type=cpu_instance_type,
55+
sagemaker_session=sagemaker_session,
56+
)
57+
processor.run(
58+
source_dir="s3://bucket/deps.tar.gz",
59+
code="main_script.py",
60+
)
61+
62+
4363
@pytest.mark.release
4464
def test_framework_processing_job_with_deps(
4565
sagemaker_session,

0 commit comments

Comments
 (0)