Skip to content

Commit 2531a1c

Browse files
author
Brock Wade
committed
fix: extend testing
1 parent 71adb25 commit 2531a1c

File tree

1 file changed

+38
-3
lines changed

1 file changed

+38
-3
lines changed

tests/integ/sagemaker/workflow/test_workflow.py

+38-3
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
)
9191
from sagemaker.workflow.step_collections import RegisterModel
9292
from sagemaker.workflow.pipeline import Pipeline
93-
from sagemaker.workflow.utilities import hash_files_or_dirs
93+
from sagemaker.workflow.utilities import hash_files_or_dirs, hash_object
9494
from sagemaker.feature_store.feature_group import (
9595
FeatureGroup,
9696
FeatureDefinition,
@@ -1425,7 +1425,6 @@ def test_multi_step_framework_processing_pipeline_uploads(
14251425
)
14261426
try:
14271427
pipeline.create(role)
1428-
14291428
definition = json.loads(pipeline.definition())
14301429

14311430
source_dir_tar_prefix = (
@@ -1434,7 +1433,6 @@ def test_multi_step_framework_processing_pipeline_uploads(
14341433
)
14351434

14361435
run_procs = []
1437-
14381436
for step in definition["Steps"]:
14391437
for input_obj in step["Arguments"]["ProcessingInputs"]:
14401438
if input_obj["InputName"] == "entrypoint":
@@ -1447,6 +1445,43 @@ def test_multi_step_framework_processing_pipeline_uploads(
14471445
# verify all the run_proc.sh artifact paths are distinct
14481446
assert len(run_procs) == len(set(run_procs))
14491447

1448+
expected_source_dir_tar = (
1449+
f"{pipeline_name}"
1450+
f"/code/{hash_files_or_dirs([DATA_DIR + '/framework_processor_data'])}/sourcedir.tar.gz"
1451+
)
1452+
expected_query_step_artifact = (
1453+
f"{pipeline_name}/"
1454+
f"code/{hash_files_or_dirs([DATA_DIR + '/framework_processor_data/query_data.py'])}/"
1455+
f"query_data.py"
1456+
)
1457+
1458+
prepare_step_script = data_processor._generate_framework_script("preprocess.py")
1459+
expected_prepare_step_artifact = (
1460+
f"{pipeline_name}/" f"code/{hash_object(prepare_step_script)}/runproc.sh"
1461+
)
1462+
1463+
split_step_script = data_processor._generate_framework_script("train_test_split.py")
1464+
expected_split_step_artifact = (
1465+
f"{pipeline_name}/" f"code/{hash_object(split_step_script)}/runproc.sh"
1466+
)
1467+
1468+
eval_step_script = sk_processor._generate_framework_script("evaluate.py")
1469+
expected_eval_step_artifact = (
1470+
f"{pipeline_name}/" f"code/{hash_object(eval_step_script)}/runproc.sh"
1471+
)
1472+
1473+
expected_prefix = f"{pipeline_name}/code"
1474+
s3_code_objects = pipeline_session.list_s3_files(
1475+
bucket=default_bucket, key_prefix=expected_prefix
1476+
)
1477+
1478+
# verify
1479+
assert expected_source_dir_tar in s3_code_objects
1480+
assert expected_query_step_artifact in s3_code_objects
1481+
assert expected_prepare_step_artifact in s3_code_objects
1482+
assert expected_split_step_artifact in s3_code_objects
1483+
assert expected_eval_step_artifact in s3_code_objects
1484+
14501485
finally:
14511486
try:
14521487
pipeline.delete()

0 commit comments

Comments
 (0)