Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py: non-regression of user-feedback flow #546

Merged
merged 4 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clients/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ deploy-latest-mr:

.PHONY: test-e2e
test-e2e: deploy-latest-mr
poetry run pytest --e2e -s
poetry run pytest --e2e -s -rA

.PHONY: test
test:
poetry run pytest -s
poetry run pytest -s -rA

.PHONY: lint
lint:
Expand Down
2 changes: 2 additions & 0 deletions clients/python/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def tests(session: Session) -> None:
)
session.run(
"pytest",
"-rA",
*session.posargs,
)

Expand All @@ -81,6 +82,7 @@ def e2e_tests(session: Session) -> None:
session.run(
"pytest",
"--e2e",
"-rA",
"--cov",
"--cov-config=pyproject.toml",
*session.posargs,
Expand Down
33 changes: 33 additions & 0 deletions clients/python/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,39 @@ async def test_update_preserves_model_info(client: ModelRegistry):
assert updated_ma.model_format_version == model_fmt_version


@pytest.mark.e2e
async def test_update_existing_model_artifact(client: ModelRegistry):
"""Updating uri (or other properties) by re-using and call to update

reported via slack
"""
name = "test_model"
version = "1.0.0"
rm = client.register_model(
name,
"s3",
model_format_name="test_format",
model_format_version="test_version",
version=version,
)
assert rm.id
mv = client.get_model_version(name, version)
assert mv
assert mv.id
ma = client.get_model_artifact(name, version)
assert ma
assert ma.id

something_else = "https://something.else/model.onnx"
ma.uri = something_else
response = client.update(ma)
assert response
assert response.uri == something_else

ma = client.get_model_artifact(name, version)
assert ma.uri == something_else


@pytest.mark.e2e
async def test_get(client: ModelRegistry):
name = "test_model"
Expand Down