Skip to content

Commit dfe9192

Browse files
update inference integ test to add dependency for testing wait until inservice (#121)
1 parent ec8a6b2 commit dfe9192

9 files changed

+19
-320
lines changed

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"pytest==8.3.2",
8282
"pytest-cov==5.0.0",
8383
"pytest-order==1.3.0",
84+
"pytest-dependency==0.6.0",
8485
"tox==4.18.0",
8586
"ruff==0.6.2",
8687
"hera-workflows==5.16.3",

test/integration_tests/inference/cli/test_cli_custom_fsx_inference.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def sagemaker_client():
4343
return boto3.client("sagemaker", region_name=REGION)
4444

4545
# --------- Custom Endpoint Tests ---------
46-
46+
@pytest.mark.dependency(name="create")
4747
def test_custom_create(runner, custom_endpoint_name):
4848
result = runner.invoke(custom_create, [
4949
"--namespace", NAMESPACE,
@@ -72,6 +72,7 @@ def test_custom_list(runner, custom_endpoint_name):
7272
assert custom_endpoint_name in result.output
7373

7474

75+
@pytest.mark.dependency(name="describe")
7576
def test_custom_describe(runner, custom_endpoint_name):
7677
result = runner.invoke(custom_describe, [
7778
"--name", custom_endpoint_name,
@@ -82,6 +83,7 @@ def test_custom_describe(runner, custom_endpoint_name):
8283
assert custom_endpoint_name in result.output
8384

8485

86+
@pytest.mark.dependency(depends=["create", "describe"])
8587
def test_wait_until_inservice(custom_endpoint_name):
8688
"""Poll SDK until specific JumpStart endpoint reaches DeploymentComplete"""
8789
print(f"[INFO] Waiting for JumpStart endpoint '{custom_endpoint_name}' to be DeploymentComplete...")

test/integration_tests/inference/cli/test_cli_custom_inference.py

Lines changed: 0 additions & 142 deletions
This file was deleted.

test/integration_tests/inference/cli/test_cli_custom_s3_inference.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def sagemaker_client():
4343
return boto3.client("sagemaker", region_name=REGION)
4444

4545
# --------- Custom Endpoint Tests ---------
46-
46+
@pytest.mark.dependency(name="create")
4747
def test_custom_create(runner, custom_endpoint_name):
4848
result = runner.invoke(custom_create, [
4949
"--namespace", NAMESPACE,
@@ -72,6 +72,7 @@ def test_custom_list(runner, custom_endpoint_name):
7272
assert custom_endpoint_name in result.output
7373

7474

75+
@pytest.mark.dependency(name="describe")
7576
def test_custom_describe(runner, custom_endpoint_name):
7677
result = runner.invoke(custom_describe, [
7778
"--name", custom_endpoint_name,
@@ -82,6 +83,7 @@ def test_custom_describe(runner, custom_endpoint_name):
8283
assert custom_endpoint_name in result.output
8384

8485

86+
@pytest.mark.dependency(depends=["create", "describe"])
8587
def test_wait_until_inservice(custom_endpoint_name):
8688
"""Poll SDK until specific JumpStart endpoint reaches DeploymentComplete"""
8789
print(f"[INFO] Waiting for JumpStart endpoint '{custom_endpoint_name}' to be DeploymentComplete...")

test/integration_tests/inference/cli/test_cli_jumpstart_inference.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def sagemaker_client():
2828
return boto3.client("sagemaker", region_name=REGION)
2929

3030
# --------- JumpStart Endpoint Tests ---------
31-
31+
@pytest.mark.dependency(name="create")
3232
def test_js_create(runner, js_endpoint_name):
3333
result = runner.invoke(js_create, [
3434
"--namespace", NAMESPACE,
@@ -46,6 +46,7 @@ def test_js_list(runner, js_endpoint_name):
4646
assert js_endpoint_name in result.output
4747

4848

49+
@pytest.mark.dependency(name="describe")
4950
def test_js_describe(runner, js_endpoint_name):
5051
result = runner.invoke(js_describe, [
5152
"--name", js_endpoint_name,
@@ -56,6 +57,7 @@ def test_js_describe(runner, js_endpoint_name):
5657
assert js_endpoint_name in result.output
5758

5859

60+
@pytest.mark.dependency(depends=["create", "describe"])
5961
def test_wait_until_inservice(js_endpoint_name):
6062
"""Poll SDK until specific JumpStart endpoint reaches DeploymentComplete"""
6163
print(f"[INFO] Waiting for JumpStart endpoint '{js_endpoint_name}' to be DeploymentComplete...")

test/integration_tests/inference/sdk/test_sdk_custom_fsx_inference.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def custom_endpoint():
8484
worker=worker,
8585
)
8686

87+
@pytest.mark.dependency(name="create")
8788
def test_create_endpoint(custom_endpoint):
8889
custom_endpoint.create(namespace=NAMESPACE)
8990
assert custom_endpoint.metadata.name == ENDPOINT_NAME
@@ -93,10 +94,12 @@ def test_list_endpoint():
9394
names = [ep.metadata.name for ep in endpoints]
9495
assert ENDPOINT_NAME in names
9596

97+
@pytest.mark.dependency(name="describe")
9698
def test_get_endpoint():
9799
ep = HPEndpoint.get(name=ENDPOINT_NAME, namespace=NAMESPACE)
98100
assert ep.modelName == MODEL_NAME
99101

102+
@pytest.mark.dependency(depends=["create", "describe"])
100103
def test_wait_until_inservice():
101104
"""Poll SDK until specific JumpStart endpoint reaches DeploymentComplete"""
102105
print(f"[INFO] Waiting for JumpStart endpoint '{ENDPOINT_NAME}' to be DeploymentComplete...")

0 commit comments

Comments
 (0)