Skip to content

Commit e080822

Browse files
fix tests
1 parent 2b5cd84 commit e080822

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

tests/unitary/with_extras/aqua/test_deployment.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ class TestDataset:
259259
"MODEL_DEPLOY_PREDICT_ENDPOINT": "/v1/completions",
260260
"PARAMS": "--served-model-name odsc-llm --seed 42",
261261
},
262+
"cmd": [],
262263
"console_link": "https://cloud.oracle.com/data-science/model-deployments/ocid1.datasciencemodeldeployment.oc1.<region>.<MD_OCID>?region=region-name",
263264
"lifecycle_details": "",
264265
"shape_info": {
@@ -319,6 +320,13 @@ class TestDataset:
319320
"memory_in_gbs": None,
320321
}
321322

323+
aqua_deployment_tei_byoc_embeddings_cmd = [
324+
"--model-id",
325+
"/opt/ds/model/deployed_model/service_models/model-name/artifact/",
326+
"--port",
327+
"8080",
328+
]
329+
322330

323331
class TestAquaDeployment(unittest.TestCase):
324332
def setUp(self):
@@ -719,6 +727,7 @@ def test_create_deployment_for_tei_byoc_embedding_model(
719727
expected_result["shape_info"] = (
720728
TestDataset.aqua_deployment_tei_byoc_embeddings_shape_info
721729
)
730+
expected_result["cmd"] = TestDataset.aqua_deployment_tei_byoc_embeddings_cmd
722731
expected_result["environment_variables"] = (
723732
TestDataset.aqua_deployment_tei_byoc_embeddings_env_vars
724733
)

tests/unitary/with_extras/aqua/test_model.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def mock_get_container_config():
6464
yield mock_config
6565

6666

67-
@pytest.fixture(autouse=True, scope="class")
67+
@pytest.fixture(autouse=True, scope="function")
6868
def mock_get_hf_model_info():
6969
with patch.object(HfApi, "model_info") as mock_get_hf_model_info:
7070
test_hf_model_info = ModelInfo(
@@ -933,7 +933,7 @@ def test_import_model_with_missing_config(
933933
app.list = MagicMock(return_value=[])
934934

935935
if download_from_hf:
936-
with pytest.raises(AquaValueError):
936+
with pytest.raises(AquaRuntimeError):
937937
mock_get_hf_model_info.return_value.siblings = []
938938
with tempfile.TemporaryDirectory() as tmpdir:
939939
model: AquaModel = app.register(
@@ -1037,7 +1037,11 @@ def test_import_tei_model_byoc(
10371037
DataScienceModel.sync = MagicMock()
10381038
OCIDataScienceModel.create = MagicMock()
10391039

1040-
mock_list_objects.return_value = MagicMock(objects=[])
1040+
artifact_path = "service_models/model-name/commit-id/artifact"
1041+
obj1 = MagicMock(etag="12345-1234-1234-1234-123456789", size=150)
1042+
obj1.name = f"{artifact_path}/config.json"
1043+
objects = [obj1]
1044+
mock_list_objects.return_value = MagicMock(objects=objects)
10411045
ds_model = DataScienceModel()
10421046
os_path = "oci://aqua-bkt@aqua-ns/prefix/path"
10431047
model_name = "oracle/aqua-1t-mega-model"

0 commit comments

Comments
 (0)