|
11 | 11 | from pydantic import ValidationError |
12 | 12 |
|
13 | 13 | from ai.backend.common.api_handlers import SENTINEL, Sentinel |
14 | | -from ai.backend.common.config import ModelDefinitionDraft |
15 | 14 | from ai.backend.common.data.model_deployment.types import DeploymentStrategy |
16 | 15 | from ai.backend.common.dto.manager.v2.deployment.request import ( |
17 | 16 | ActivateDeploymentInput, |
|
25 | 24 | DeploymentStrategyInput, |
26 | 25 | ExtraVFolderMountInput, |
27 | 26 | ImageInput, |
28 | | - ModelConfigInput, |
29 | 27 | ModelDefinitionInput, |
30 | 28 | ModelDeploymentMetadataInput, |
31 | 29 | ModelDeploymentNetworkAccessInput, |
32 | | - ModelHealthCheckInput, |
33 | 30 | ModelMountConfigInput, |
34 | 31 | ModelRuntimeConfigInput, |
35 | | - ModelServiceConfigInput, |
36 | 32 | ResourceConfigInput, |
37 | 33 | ResourceGroupInput, |
38 | 34 | ResourceSlotEntryInput, |
@@ -154,49 +150,6 @@ def test_with_extra_mounts(self) -> None: |
154 | 150 | assert rev.extra_mounts[0].mount_destination == "/data" |
155 | 151 |
|
156 | 152 |
|
157 | | -class TestModelDefinitionInputToDraft: |
158 | | - """``ModelDefinitionInput.to_draft`` converts the all-optional v2 |
159 | | - input DTO into the ``ModelDefinitionDraft`` consumed by the |
160 | | - revision merge chain. The conversion must preserve unset semantics |
161 | | - so omitted fields stay unset on the resulting draft — otherwise |
162 | | - every ``None`` would clobber lower-priority sources during merge |
163 | | - (BA-5983). |
164 | | - """ |
165 | | - |
166 | | - @pytest.mark.parametrize( |
167 | | - "input_dto", |
168 | | - [ |
169 | | - pytest.param(ModelDefinitionInput(), id="empty"), |
170 | | - pytest.param( |
171 | | - ModelDefinitionInput(models=[ModelConfigInput(name="only-name")]), |
172 | | - id="partial_name_only", |
173 | | - ), |
174 | | - pytest.param( |
175 | | - ModelDefinitionInput( |
176 | | - models=[ |
177 | | - ModelConfigInput( |
178 | | - name="m", |
179 | | - service=ModelServiceConfigInput( |
180 | | - port=8080, |
181 | | - health_check=ModelHealthCheckInput(path="/healthz"), |
182 | | - ), |
183 | | - ) |
184 | | - ] |
185 | | - ), |
186 | | - id="nested_service_and_health_check", |
187 | | - ), |
188 | | - ], |
189 | | - ) |
190 | | - def test_to_draft_preserves_set_fields(self, input_dto: ModelDefinitionInput) -> None: |
191 | | - draft = input_dto.to_draft() |
192 | | - assert isinstance(draft, ModelDefinitionDraft) |
193 | | - # ``model_fields_set`` on the draft must match what the caller |
194 | | - # explicitly set on the input — that is what the merge logic |
195 | | - # uses to distinguish "unset → defer to baseline" from |
196 | | - # "explicitly None → clobber baseline". |
197 | | - assert draft.model_fields_set == input_dto.model_fields_set |
198 | | - |
199 | | - |
200 | 153 | class TestExtraVFolderMountInput: |
201 | 154 | """Tests for ExtraVFolderMountInput model.""" |
202 | 155 |
|
|
0 commit comments