Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
45abdd6
v0
strickvl Oct 3, 2025
a2455ec
Refactor Modal step operator GPU configuration
strickvl Oct 3, 2025
87c725e
Small refactoring
strickvl Oct 3, 2025
4481a3f
Remove unnecessary asyncio complexity
strickvl Oct 3, 2025
0450853
Refactor token checks
strickvl Oct 3, 2025
705b910
Make environment parameter optional in launch method
strickvl Oct 3, 2025
d19ffeb
Simplify memory conversion using walrus operator
strickvl Oct 3, 2025
9e91e94
Use consistent truthy checks for None handling
strickvl Oct 3, 2025
fdbdea8
Extract timeout default into named constant
strickvl Oct 3, 2025
8cf809d
Fix GPU settings validation in Modal step operator
strickvl Oct 3, 2025
a839fef
Allow step-level modal_environment overrides
strickvl Oct 3, 2025
4dcf11b
Add unit tests for complex helper functions
strickvl Oct 3, 2025
6ffa074
Update docs page
strickvl Oct 3, 2025
00232ea
better error handling
strickvl Oct 3, 2025
ec878bc
Remove excess comments
strickvl Oct 3, 2025
37fd631
Add type hint for resource_settings parameter
strickvl Oct 3, 2025
72d70e2
Enforce timeout constraints in ModalStepOperatorSettings
strickvl Oct 3, 2025
b04ca61
Improve Modal sandbox command execution safety
strickvl Oct 3, 2025
581eda1
Enhance Modal step operator error handling for sandbox creation
strickvl Oct 3, 2025
ccef58b
Remove excessive comment
strickvl Oct 3, 2025
b2154d6
Refactor the get_gpu_values out to utils
strickvl Oct 5, 2025
e4d4af0
Fix darglint docstring errors in Modal integration
strickvl Oct 6, 2025
e37f6da
Merge branch 'develop' into feature/update-modal-step-operator
strickvl Oct 6, 2025
7bcf68c
Small changes
strickvl Oct 6, 2025
f4c753a
mypy fix
strickvl Oct 6, 2025
ae065d1
Tests go in the right folders
strickvl Oct 6, 2025
684cd2c
Add licenses
strickvl Oct 6, 2025
fb4dcb7
Remove dumb tests
strickvl Oct 6, 2025
cff126d
Merge branch 'develop' into feature/update-modal-step-operator
strickvl Oct 6, 2025
86ec76c
Revert Optional setting for environment
strickvl Oct 7, 2025
c999e47
Fix variable naming and error message in Modal step operator
strickvl Oct 7, 2025
31d1a63
Move memory calculation outside Modal runtime context
strickvl Oct 7, 2025
0599ddf
Remove unneeded guardrail
strickvl Oct 7, 2025
c54b2b4
Update comments
strickvl Oct 7, 2025
24bfd63
Remove extra modal pip install
strickvl Oct 7, 2025
1147e99
Adapt CLI tests for Click 8.2 compatibility
strickvl Oct 7, 2025
ad071ed
Adapt CLI tests for Click 8.2 compatibility
strickvl Oct 7, 2025
65129f7
Merge branch 'feature/update-modal-step-operator' of github.com:zenml…
strickvl Oct 7, 2025
05b0dde
Merge remote-tracking branch 'origin/develop' into feature/update-mod…
strickvl Oct 10, 2025
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
28 changes: 14 additions & 14 deletions tests/integration/functional/cli/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@
from uuid import uuid4

import pytest
from click.testing import CliRunner

from tests.integration.functional.cli.conftest import NAME, PREFIX
from tests.integration.functional.cli.utils import cli_runner
from zenml.cli.cli import cli
from zenml.client import Client


def test_model_list(clean_client_with_models: "Client"):
"""Test that zenml model list does not fail."""
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
list_command = cli.commands["model"].commands["list"]
result = runner.invoke(list_command)
assert result.exit_code == 0, result.stderr


def test_model_create_short_names(clean_client_with_models: "Client"):
"""Test that zenml model create does not fail with short names."""
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
create_command = cli.commands["model"].commands["register"]
model_name = PREFIX + str(uuid4())
result = runner.invoke(
Expand Down Expand Up @@ -82,7 +82,7 @@ def test_model_create_short_names(clean_client_with_models: "Client"):

def test_model_create_full_names(clean_client_with_models: "Client"):
"""Test that zenml model create does not fail with full names."""
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
create_command = cli.commands["model"].commands["register"]
model_name = PREFIX + str(uuid4())
result = runner.invoke(
Expand Down Expand Up @@ -131,7 +131,7 @@ def test_model_create_full_names(clean_client_with_models: "Client"):

def test_model_create_only_required(clean_client_with_models: "Client"):
"""Test that zenml model create does not fail."""
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
create_command = cli.commands["model"].commands["register"]
model_name = PREFIX + str(uuid4())
result = runner.invoke(
Expand All @@ -155,7 +155,7 @@ def test_model_create_only_required(clean_client_with_models: "Client"):

def test_model_update(clean_client_with_models: "Client"):
"""Test that zenml model update does not fail."""
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
update_command = cli.commands["model"].commands["update"]
result = runner.invoke(
update_command,
Expand Down Expand Up @@ -185,7 +185,7 @@ def test_model_create_without_required_fails(
clean_client_with_models: "Client",
):
"""Test that zenml model create fails."""
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
create_command = cli.commands["model"].commands["register"]
result = runner.invoke(
create_command,
Expand All @@ -195,7 +195,7 @@ def test_model_create_without_required_fails(

def test_model_delete_found(clean_client_with_models: "Client"):
"""Test that zenml model delete does not fail."""
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
name = PREFIX + str(uuid4())
create_command = cli.commands["model"].commands["register"]
runner.invoke(
Expand All @@ -212,7 +212,7 @@ def test_model_delete_found(clean_client_with_models: "Client"):

def test_model_delete_not_found(clean_client_with_models: "Client"):
"""Test that zenml model delete fail."""
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
name = PREFIX + str(uuid4())
delete_command = cli.commands["model"].commands["delete"]
result = runner.invoke(
Expand All @@ -224,15 +224,15 @@ def test_model_delete_not_found(clean_client_with_models: "Client"):

def test_model_version_list(clean_client_with_models: "Client"):
"""Test that zenml model version list does not fail."""
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
list_command = cli.commands["model"].commands["version"].commands["list"]
result = runner.invoke(list_command, args=[f"--model={NAME}"])
assert result.exit_code == 0, result.stderr


def test_model_version_delete_found(clean_client_with_models: "Client"):
"""Test that zenml model version delete does not fail."""
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
model_name = PREFIX + str(uuid4())
model_version_name = PREFIX + str(uuid4())
model = clean_client_with_models.create_model(
Expand All @@ -254,7 +254,7 @@ def test_model_version_delete_found(clean_client_with_models: "Client"):

def test_model_version_delete_not_found(clean_client_with_models: "Client"):
"""Test that zenml model version delete fail."""
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
model_name = PREFIX + str(uuid4())
model_version_name = PREFIX + str(uuid4())
clean_client_with_models.create_model(
Expand All @@ -278,7 +278,7 @@ def test_model_version_links_list(
command: str, clean_client_with_models: "Client"
):
"""Test that zenml model version artifacts list fails."""
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
list_command = cli.commands["model"].commands[command]
result = runner.invoke(
list_command,
Expand All @@ -289,7 +289,7 @@ def test_model_version_links_list(

def test_model_version_update(clean_client_with_models: "Client"):
"""Test that zenml model version stage update pass."""
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
update_command = (
cli.commands["model"].commands["version"].commands["update"]
)
Expand Down
18 changes: 9 additions & 9 deletions tests/integration/functional/cli/test_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"""Test zenml tag CLI commands."""

import pytest
from click.testing import CliRunner

from tests.integration.functional.cli.utils import (
cli_runner,
random_resource_name,
tags_killer,
)
Expand All @@ -29,7 +29,7 @@
def test_tag_list():
"""Test that zenml tag list does not fail."""
with tags_killer():
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
list_command = cli.commands["tag"].commands["list"]
result = runner.invoke(list_command)
assert result.exit_code == 0, result.stderr
Expand All @@ -38,7 +38,7 @@ def test_tag_list():
def test_tag_create_short_names():
"""Test that zenml tag create does not fail with short names."""
with tags_killer(0):
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
create_command = cli.commands["tag"].commands["register"]
tag_name = random_resource_name()
result = runner.invoke(
Expand All @@ -55,7 +55,7 @@ def test_tag_create_short_names():
def test_tag_create_full_names():
"""Test that zenml tag create does not fail with full names."""
with tags_killer(0):
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
create_command = cli.commands["tag"].commands["register"]
tag_name = random_resource_name()
result = runner.invoke(
Expand All @@ -72,7 +72,7 @@ def test_tag_create_full_names():
def test_tag_create_only_required():
"""Test that zenml tag create does not fail."""
with tags_killer(0):
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
create_command = cli.commands["tag"].commands["register"]
tag_name = random_resource_name()
result = runner.invoke(
Expand All @@ -93,7 +93,7 @@ def test_tag_update():
"""Test that zenml tag update does not fail."""
with tags_killer(1) as tags:
tag: TagResponse = tags[0]
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
update_command = cli.commands["tag"].commands["update"]
color_to_set = "yellow" if tag.color.value != "yellow" else "grey"
result = runner.invoke(
Expand Down Expand Up @@ -138,7 +138,7 @@ def test_tag_update():
def test_tag_create_without_required_fails():
"""Test that zenml tag create fails."""
with tags_killer(0):
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
create_command = cli.commands["tag"].commands["register"]
result = runner.invoke(
create_command,
Expand All @@ -150,7 +150,7 @@ def test_tag_delete_found():
"""Test that zenml tag delete does not fail."""
with tags_killer(1) as tags:
tag: TagResponse = tags[0]
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
delete_command = cli.commands["tag"].commands["delete"]
result = runner.invoke(
delete_command,
Expand All @@ -165,7 +165,7 @@ def test_tag_delete_found():
def test_tag_delete_not_found():
"""Test that zenml tag delete fail."""
with tags_killer(0):
runner = CliRunner(mix_stderr=False)
runner = cli_runner()
delete_command = cli.commands["tag"].commands["delete"]
result = runner.invoke(
delete_command,
Expand Down
13 changes: 13 additions & 0 deletions tests/integration/functional/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing
# permissions and limitations under the License.
import inspect
from contextlib import contextmanager
from typing import Generator, Optional, Tuple

from click.testing import CliRunner

from tests.harness.harness import TestHarness
from zenml.cli import cli
from zenml.cli.utils import (
Expand All @@ -35,6 +38,16 @@
]


def cli_runner(**kwargs) -> CliRunner:
"""Return a Click runner that stays compatible across Click releases."""
runner_kwargs = dict(kwargs)
if "mix_stderr" not in runner_kwargs:
params = inspect.signature(CliRunner.__init__).parameters
if "mix_stderr" in params:
runner_kwargs["mix_stderr"] = False
return CliRunner(**runner_kwargs)


# ----- #
# USERS #
# ----- #
Expand Down
Loading