Skip to content

Commit f023b87

Browse files
committed
test(serve): pick latest Nova SFT job without requiring its model package
The training_job_name fixture required the job's output model package to still exist, but the resource cleaner keeps only the oldest and newest package in the group, so every job's package was deleted and all dependent tests skipped. Build/deploy resolve artifacts from the job manifest (not the model package), so just pick the latest completed sft-nova-integ job. X-AI-Prompt: Stop requiring the Nova SFT job's output model package to exist in the fixture so tests stop skipping X-AI-Tool: kiro-cli
1 parent dd2bef8 commit f023b87

1 file changed

Lines changed: 10 additions & 19 deletions

File tree

‎sagemaker-serve/tests/integ/test_nova_model_customization_deployment.py‎

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,12 @@ def sagemaker_session():
9090

9191
@pytest.fixture(scope="module")
9292
def training_job_name():
93-
"""Most recent completed Nova SFT training job whose output model package
94-
still exists.
93+
"""Most recent completed Nova SFT training job.
9594
9695
Discovered at runtime rather than hardcoded so the test does not depend on a
97-
job name that may be cleaned up.
96+
job name that may be cleaned up. Build/deploy resolve artifacts from the
97+
job's manifest (output_data_config), so a registered output model package is
98+
not required.
9899
"""
99100
sm_client = boto3.client("sagemaker", region_name=AWS_REGION)
100101
jobs = sm_client.list_training_jobs(
@@ -105,22 +106,12 @@ def training_job_name():
105106
MaxResults=20,
106107
).get("TrainingJobSummaries", [])
107108

108-
for job in jobs:
109-
name = job["TrainingJobName"]
110-
detail = sm_client.describe_training_job(TrainingJobName=name)
111-
mp_arn = detail.get("OutputModelPackageArn")
112-
if not mp_arn:
113-
continue
114-
try:
115-
sm_client.describe_model_package(ModelPackageName=mp_arn)
116-
return name
117-
except sm_client.exceptions.ClientError:
118-
continue
119-
120-
pytest.skip(
121-
"No completed Nova SFT training job with an existing output model "
122-
"package was found. Ensure the scheduled Nova SFT workflow has run."
123-
)
109+
if not jobs:
110+
pytest.skip(
111+
"No completed Nova SFT training job found. "
112+
"Ensure the scheduled Nova SFT workflow has run."
113+
)
114+
return jobs[0]["TrainingJobName"]
124115

125116

126117
@pytest.fixture(scope="module")

0 commit comments

Comments
 (0)