Skip to content

Commit 8366021

Browse files
jopemachineclaude
andcommitted
test(BA-5983): drop tests added in this PR
Remove the DB-backed revision merge test and the to_draft invariant test added in this PR. Existing tests in ``tests/unit/common/dto/manager/v2/deployment/test_request.py`` remain — those were updated only to swap ``ModelDefinitionDraft()`` for ``ModelDefinitionInput()`` so they typecheck against the new field type. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 90d5645 commit 8366021

2 files changed

Lines changed: 0 additions & 465 deletions

File tree

tests/unit/common/dto/manager/v2/deployment/test_request.py

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from pydantic import ValidationError
1212

1313
from ai.backend.common.api_handlers import SENTINEL, Sentinel
14-
from ai.backend.common.config import ModelDefinitionDraft
1514
from ai.backend.common.data.model_deployment.types import DeploymentStrategy
1615
from ai.backend.common.dto.manager.v2.deployment.request import (
1716
ActivateDeploymentInput,
@@ -25,14 +24,11 @@
2524
DeploymentStrategyInput,
2625
ExtraVFolderMountInput,
2726
ImageInput,
28-
ModelConfigInput,
2927
ModelDefinitionInput,
3028
ModelDeploymentMetadataInput,
3129
ModelDeploymentNetworkAccessInput,
32-
ModelHealthCheckInput,
3330
ModelMountConfigInput,
3431
ModelRuntimeConfigInput,
35-
ModelServiceConfigInput,
3632
ResourceConfigInput,
3733
ResourceGroupInput,
3834
ResourceSlotEntryInput,
@@ -154,49 +150,6 @@ def test_with_extra_mounts(self) -> None:
154150
assert rev.extra_mounts[0].mount_destination == "/data"
155151

156152

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-
200153
class TestExtraVFolderMountInput:
201154
"""Tests for ExtraVFolderMountInput model."""
202155

0 commit comments

Comments
 (0)