Skip to content

Commit

Permalink
py: non-regression of user-feedback flow (#546)
Browse files Browse the repository at this point in the history
* py: reproducer for 400 bad request

Signed-off-by: Matteo Mortari <[email protected]>

* pytest report

Signed-off-by: Matteo Mortari <[email protected]>

* pytest -rA parameter

Signed-off-by: Matteo Mortari <[email protected]>

* Update clients/python/tests/test_client.py

Co-authored-by: Isabella Basso <[email protected]>
Signed-off-by: Matteo Mortari <[email protected]>

---------

Signed-off-by: Matteo Mortari <[email protected]>
Co-authored-by: Isabella Basso <[email protected]>
  • Loading branch information
tarilabs and isinyaaa authored Nov 11, 2024
1 parent f1efdd2 commit 46bb151
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
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

0 comments on commit 46bb151

Please sign in to comment.